summaryrefslogtreecommitdiff
path: root/src/app.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-10-11 16:00:57 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-10-11 16:00:57 +0300
commit684c6d25fc4465440d09f9ad14cf8876f2c3a0c2 (patch)
treee6a6c576a3ca44d2d079687b860d413a298a88de /src/app.c
parent52cb8a8d24408e21101dfe9465cf28eaaf287c13 (diff)
Added a preference for heading font
Body and heading fonts can be selected separately.
Diffstat (limited to 'src/app.c')
-rw-r--r--src/app.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/app.c b/src/app.c
index 347e3661..ac93d511 100644
--- a/src/app.c
+++ b/src/app.c
@@ -169,6 +169,7 @@ static iString *serializePrefs_App_(const iApp *d) {
169 appendFormat_String(str, "sidebar.mode arg:%d\n", mode_SidebarWidget(sidebar)); 169 appendFormat_String(str, "sidebar.mode arg:%d\n", mode_SidebarWidget(sidebar));
170 appendFormat_String(str, "uiscale arg:%f\n", uiScale_Window(d->window)); 170 appendFormat_String(str, "uiscale arg:%f\n", uiScale_Window(d->window));
171 appendFormat_String(str, "font.set arg:%d\n", d->prefs.font); 171 appendFormat_String(str, "font.set arg:%d\n", d->prefs.font);
172 appendFormat_String(str, "headingfont.set arg:%d\n", d->prefs.headingFont);
172 appendFormat_String(str, "zoom.set arg:%d\n", d->prefs.zoomPercent); 173 appendFormat_String(str, "zoom.set arg:%d\n", d->prefs.zoomPercent);
173 appendFormat_String(str, "linewidth.set arg:%d\n", d->prefs.lineWidth); 174 appendFormat_String(str, "linewidth.set arg:%d\n", d->prefs.lineWidth);
174 appendFormat_String(str, "prefs.biglede.changed arg:%d\n", d->prefs.bigFirstParagraph); 175 appendFormat_String(str, "prefs.biglede.changed arg:%d\n", d->prefs.bigFirstParagraph);
@@ -834,6 +835,14 @@ iBool handleCommand_App(const char *cmd) {
834 postCommand_App("window.unfreeze"); 835 postCommand_App("window.unfreeze");
835 return iTrue; 836 return iTrue;
836 } 837 }
838 else if (equal_Command(cmd, "headingfont.set")) {
839 setFreezeDraw_Window(get_Window(), iTrue);
840 d->prefs.headingFont = arg_Command(cmd);
841 setHeadingFont_Text(d->prefs.headingFont);
842 postCommand_App("font.changed");
843 postCommand_App("window.unfreeze");
844 return iTrue;
845 }
837 else if (equal_Command(cmd, "zoom.set")) { 846 else if (equal_Command(cmd, "zoom.set")) {
838 setFreezeDraw_Window(get_Window(), iTrue); /* no intermediate draws before docs updated */ 847 setFreezeDraw_Window(get_Window(), iTrue); /* no intermediate draws before docs updated */
839 d->prefs.zoomPercent = arg_Command(cmd); 848 d->prefs.zoomPercent = arg_Command(cmd);
@@ -1016,6 +1025,10 @@ iBool handleCommand_App(const char *cmd) {
1016 selected_WidgetFlag, 1025 selected_WidgetFlag,
1017 iTrue); 1026 iTrue);
1018 setFlags_Widget( 1027 setFlags_Widget(
1028 findChild_Widget(dlg, format_CStr("prefs.headingfont.%d", d->prefs.headingFont)),
1029 selected_WidgetFlag,
1030 iTrue);
1031 setFlags_Widget(
1019 findChild_Widget(dlg, format_CStr("prefs.linewidth.%d", d->prefs.lineWidth)), 1032 findChild_Widget(dlg, format_CStr("prefs.linewidth.%d", d->prefs.lineWidth)),
1020 selected_WidgetFlag, 1033 selected_WidgetFlag,
1021 iTrue); 1034 iTrue);