summaryrefslogtreecommitdiff
path: root/src/app.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/app.c')
-rw-r--r--src/app.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/app.c b/src/app.c
index d7cedc42..5971f0ed 100644
--- a/src/app.c
+++ b/src/app.c
@@ -179,6 +179,8 @@ static iString *serializePrefs_App_(const iApp *d) {
179 appendFormat_String(str, "prefs.dialogtab arg:%d\n", d->prefs.dialogTab); 179 appendFormat_String(str, "prefs.dialogtab arg:%d\n", d->prefs.dialogTab);
180 appendFormat_String(str, "font.set arg:%d\n", d->prefs.font); 180 appendFormat_String(str, "font.set arg:%d\n", d->prefs.font);
181 appendFormat_String(str, "headingfont.set arg:%d\n", d->prefs.headingFont); 181 appendFormat_String(str, "headingfont.set arg:%d\n", d->prefs.headingFont);
182 appendFormat_String(str, "prefs.mono.gemini.changed arg:%d\n", d->prefs.monospaceGemini);
183 appendFormat_String(str, "prefs.mono.gopher.changed arg:%d\n", d->prefs.monospaceGopher);
182 appendFormat_String(str, "zoom.set arg:%d\n", d->prefs.zoomPercent); 184 appendFormat_String(str, "zoom.set arg:%d\n", d->prefs.zoomPercent);
183 appendFormat_String(str, "smoothscroll arg:%d\n", d->prefs.smoothScrolling); 185 appendFormat_String(str, "smoothscroll arg:%d\n", d->prefs.smoothScrolling);
184 appendFormat_String(str, "linewidth.set arg:%d\n", d->prefs.lineWidth); 186 appendFormat_String(str, "linewidth.set arg:%d\n", d->prefs.lineWidth);
@@ -724,7 +726,7 @@ static void updateColorThemeButton_(iLabelWidget *button, int theme) {
724 iForEach(ObjectList, i, children_Widget(findChild_Widget(as_Widget(button), "menu"))) { 726 iForEach(ObjectList, i, children_Widget(findChild_Widget(as_Widget(button), "menu"))) {
725 iLabelWidget *item = i.object; 727 iLabelWidget *item = i.object;
726 if (!cmp_String(command_LabelWidget(item), command)) { 728 if (!cmp_String(command_LabelWidget(item), command)) {
727 updateText_LabelWidget(button, label_LabelWidget(item)); 729 updateText_LabelWidget(button, text_LabelWidget(item));
728 break; 730 break;
729 } 731 }
730 } 732 }
@@ -987,6 +989,29 @@ iBool handleCommand_App(const char *cmd) {
987 postCommand_App("document.layout.changed"); 989 postCommand_App("document.layout.changed");
988 return iTrue; 990 return iTrue;
989 } 991 }
992 else if (equal_Command(cmd, "prefs.mono.gemini.changed") ||
993 equal_Command(cmd, "prefs.mono.gopher.changed")) {
994 const iBool isSet = (arg_Command(cmd) != 0);
995 setFreezeDraw_Window(d->window, iTrue);
996 if (startsWith_CStr(cmd, "prefs.mono.gemini")) {
997 d->prefs.monospaceGemini = isSet;
998 }
999 else {
1000 d->prefs.monospaceGopher = isSet;
1001 }
1002 resetFonts_Text(); /* clear the glyph cache */
1003 postCommand_App("font.changed");
1004 postCommand_App("window.unfreeze");
1005 return iTrue;
1006 }
1007 else if (equal_Command(cmd, "prefs.mono.gopher.changed")) {
1008 setFreezeDraw_Window(d->window, iTrue);
1009 d->prefs.monospaceGopher = arg_Command(cmd) != 0;
1010 resetFonts_Text(); /* clear the glyph cache */
1011 postCommand_App("font.changed");
1012 postCommand_App("window.unfreeze");
1013 return iTrue;
1014 }
990 else if (equal_Command(cmd, "prefs.biglede.changed")) { 1015 else if (equal_Command(cmd, "prefs.biglede.changed")) {
991 d->prefs.bigFirstParagraph = arg_Command(cmd) != 0; 1016 d->prefs.bigFirstParagraph = arg_Command(cmd) != 0;
992 postCommand_App("document.layout.changed"); 1017 postCommand_App("document.layout.changed");
@@ -1137,6 +1162,12 @@ iBool handleCommand_App(const char *cmd) {
1137 findChild_Widget(dlg, format_CStr("prefs.headingfont.%d", d->prefs.headingFont)), 1162 findChild_Widget(dlg, format_CStr("prefs.headingfont.%d", d->prefs.headingFont)),
1138 selected_WidgetFlag, 1163 selected_WidgetFlag,
1139 iTrue); 1164 iTrue);
1165 setFlags_Widget(findChild_Widget(dlg, "prefs.mono.gemini"),
1166 selected_WidgetFlag,
1167 d->prefs.monospaceGemini);
1168 setFlags_Widget(findChild_Widget(dlg, "prefs.mono.gopher"),
1169 selected_WidgetFlag,
1170 d->prefs.monospaceGopher);
1140 setFlags_Widget( 1171 setFlags_Widget(
1141 findChild_Widget(dlg, format_CStr("prefs.linewidth.%d", d->prefs.lineWidth)), 1172 findChild_Widget(dlg, format_CStr("prefs.linewidth.%d", d->prefs.lineWidth)),
1142 selected_WidgetFlag, 1173 selected_WidgetFlag,