diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-09-26 12:56:07 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-09-26 12:56:07 +0300 |
commit | 790a2c49a0290ce872ec8929b063337eacde9880 (patch) | |
tree | d4bcc54ece3b4bec58fad9f1920ed2ca0c70c6b8 /src/app.c | |
parent | 84d3089735bd81a9d628acf416b481f2535765cf (diff) |
Preferences: Added side icon, hover outline
Diffstat (limited to 'src/app.c')
-rw-r--r-- | src/app.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -169,6 +169,8 @@ static iString *serializePrefs_App_(const iApp *d) { | |||
169 | appendFormat_String(str, "zoom.set arg:%d\n", d->prefs.zoomPercent); | 169 | appendFormat_String(str, "zoom.set arg:%d\n", d->prefs.zoomPercent); |
170 | appendFormat_String(str, "linewidth.set arg:%d\n", d->prefs.lineWidth); | 170 | appendFormat_String(str, "linewidth.set arg:%d\n", d->prefs.lineWidth); |
171 | appendFormat_String(str, "prefs.biglede.changed arg:%d\n", d->prefs.bigFirstParagraph); | 171 | appendFormat_String(str, "prefs.biglede.changed arg:%d\n", d->prefs.bigFirstParagraph); |
172 | appendFormat_String(str, "prefs.sideicon.changed arg:%d\n", d->prefs.sideIcon); | ||
173 | appendFormat_String(str, "prefs.hoveroutline.changed arg:%d\n", d->prefs.hoverOutline); | ||
172 | appendFormat_String(str, "theme.set arg:%d auto:1\n", d->prefs.theme); | 174 | appendFormat_String(str, "theme.set arg:%d auto:1\n", d->prefs.theme); |
173 | appendFormat_String(str, "ostheme arg:%d\n", d->prefs.useSystemTheme); | 175 | appendFormat_String(str, "ostheme arg:%d\n", d->prefs.useSystemTheme); |
174 | appendFormat_String(str, "saturation.set arg:%d\n", (int) ((d->prefs.saturation * 100) + 0.5f)); | 176 | appendFormat_String(str, "saturation.set arg:%d\n", (int) ((d->prefs.saturation * 100) + 0.5f)); |
@@ -868,6 +870,16 @@ iBool handleCommand_App(const char *cmd) { | |||
868 | postCommand_App("document.layout.changed"); | 870 | postCommand_App("document.layout.changed"); |
869 | return iTrue; | 871 | return iTrue; |
870 | } | 872 | } |
873 | else if (equal_Command(cmd, "prefs.sideicon.changed")) { | ||
874 | d->prefs.sideIcon = arg_Command(cmd) != 0; | ||
875 | refresh_App(); | ||
876 | return iTrue; | ||
877 | } | ||
878 | else if (equal_Command(cmd, "prefs.hoveroutline.changed")) { | ||
879 | d->prefs.hoverOutline = arg_Command(cmd) != 0; | ||
880 | refresh_App(); | ||
881 | return iTrue; | ||
882 | } | ||
871 | else if (equal_Command(cmd, "saturation.set")) { | 883 | else if (equal_Command(cmd, "saturation.set")) { |
872 | d->prefs.saturation = (float) arg_Command(cmd) / 100.0f; | 884 | d->prefs.saturation = (float) arg_Command(cmd) / 100.0f; |
873 | postCommandf_App("theme.changed auto:1"); | 885 | postCommandf_App("theme.changed auto:1"); |
@@ -982,6 +994,7 @@ iBool handleCommand_App(const char *cmd) { | |||
982 | iWidget *dlg = makePreferences_Widget(); | 994 | iWidget *dlg = makePreferences_Widget(); |
983 | updatePrefsThemeButtons_(dlg); | 995 | updatePrefsThemeButtons_(dlg); |
984 | setText_InputWidget(findChild_Widget(dlg, "prefs.downloads"), &d->prefs.downloadDir); | 996 | setText_InputWidget(findChild_Widget(dlg, "prefs.downloads"), &d->prefs.downloadDir); |
997 | setToggle_Widget(findChild_Widget(dlg, "prefs.hoveroutline"), d->prefs.hoverOutline); | ||
985 | setToggle_Widget(findChild_Widget(dlg, "prefs.ostheme"), d->prefs.useSystemTheme); | 998 | setToggle_Widget(findChild_Widget(dlg, "prefs.ostheme"), d->prefs.useSystemTheme); |
986 | setToggle_Widget(findChild_Widget(dlg, "prefs.retainwindow"), d->prefs.retainWindowSize); | 999 | setToggle_Widget(findChild_Widget(dlg, "prefs.retainwindow"), d->prefs.retainWindowSize); |
987 | setText_InputWidget(findChild_Widget(dlg, "prefs.uiscale"), | 1000 | setText_InputWidget(findChild_Widget(dlg, "prefs.uiscale"), |
@@ -994,6 +1007,7 @@ iBool handleCommand_App(const char *cmd) { | |||
994 | selected_WidgetFlag, | 1007 | selected_WidgetFlag, |
995 | iTrue); | 1008 | iTrue); |
996 | setToggle_Widget(findChild_Widget(dlg, "prefs.biglede"), d->prefs.bigFirstParagraph); | 1009 | setToggle_Widget(findChild_Widget(dlg, "prefs.biglede"), d->prefs.bigFirstParagraph); |
1010 | setToggle_Widget(findChild_Widget(dlg, "prefs.sideicon"), d->prefs.sideIcon); | ||
997 | setFlags_Widget( | 1011 | setFlags_Widget( |
998 | findChild_Widget( | 1012 | findChild_Widget( |
999 | dlg, format_CStr("prefs.saturation.%d", (int) (d->prefs.saturation * 3.99f))), | 1013 | dlg, format_CStr("prefs.saturation.%d", (int) (d->prefs.saturation * 3.99f))), |