diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-10-18 14:23:22 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-10-18 14:23:22 +0300 |
commit | a40b81c0f954d5aa98cc425ecbc2991af72d2898 (patch) | |
tree | 932fb91a51825cc1eb0d68020c10e48b340704a0 /src/ui/util.c | |
parent | 6fbbdb349a94d75859bc4a22d7f08927d8680ca5 (diff) |
Added more document color themes
The dark and light themes are now configurable in Preferences.
Diffstat (limited to 'src/ui/util.c')
-rw-r--r-- | src/ui/util.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/ui/util.c b/src/ui/util.c index c99df1fd..5762f8d1 100644 --- a/src/ui/util.c +++ b/src/ui/util.c | |||
@@ -965,10 +965,27 @@ iWidget *makePreferences_Widget(void) { | |||
965 | } | 965 | } |
966 | /* Colors. */ { | 966 | /* Colors. */ { |
967 | appendTwoColumnPage_(tabs, "Colors", '3', &headings, &values); | 967 | appendTwoColumnPage_(tabs, "Colors", '3', &headings, &values); |
968 | addChild_Widget(headings, iClob(makeHeading_Widget("Dark theme:"))); | 968 | for (int i = 0; i < 2; ++i) { |
969 | addChild_Widget(values, iClob(new_LabelWidget("Colorful", 0, 0, 0))); | 969 | const iBool isDark = (i == 0); |
970 | addChild_Widget(headings, iClob(makeHeading_Widget("Light theme:"))); | 970 | const char *mode = isDark ? "dark" : "light"; |
971 | addChild_Widget(values, iClob(new_LabelWidget("White", 0, 0, 0))); | 971 | const iMenuItem themes[] = { |
972 | { "Colorful Dark", 0, 0, format_CStr("doctheme.%s.set arg:%d", mode, colorfulDark_GmDocumentTheme) }, | ||
973 | { "Colorful Light", 0, 0, format_CStr("doctheme.%s.set arg:%d", mode, colorfulLight_GmDocumentTheme) }, | ||
974 | { "Black", 0, 0, format_CStr("doctheme.%s.set arg:%d", mode, black_GmDocumentTheme) }, | ||
975 | { "Gray", 0, 0, format_CStr("doctheme.%s.set arg:%d", mode, gray_GmDocumentTheme) }, | ||
976 | { "Sepia", 0, 0, format_CStr("doctheme.%s.set arg:%d", mode, sepia_GmDocumentTheme) }, | ||
977 | { "White", 0, 0, format_CStr("doctheme.%s.set arg:%d", mode, white_GmDocumentTheme) }, | ||
978 | { "High Contrast", 0, 0, format_CStr("doctheme.%s.set arg:%d", mode, highContrast_GmDocumentTheme) }, | ||
979 | }; | ||
980 | addChild_Widget(headings, iClob(makeHeading_Widget(isDark ? "Dark theme:" : "Light theme:"))); | ||
981 | setId_Widget(addChild_Widget(values, | ||
982 | iClob(makeMenuButton_LabelWidget( | ||
983 | themes[0].label, themes, iElemCount(themes)))), | ||
984 | format_CStr("prefs.doctheme.%s", mode)); | ||
985 | } | ||
986 | //addChild_Widget(values, iClob(new_LabelWidget("Colorful", 0, 0, 0))); | ||
987 | // addChild_Widget(headings, iClob(makeHeading_Widget("Light theme:"))); | ||
988 | // addChild_Widget(values, iClob(new_LabelWidget("White", 0, 0, 0))); | ||
972 | addChild_Widget(headings, iClob(makeHeading_Widget("Saturation:"))); | 989 | addChild_Widget(headings, iClob(makeHeading_Widget("Saturation:"))); |
973 | iWidget *sats = new_Widget(); | 990 | iWidget *sats = new_Widget(); |
974 | /* Saturation levels. */ { | 991 | /* Saturation levels. */ { |