diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-09-07 13:14:59 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-09-07 13:14:59 +0300 |
commit | ab893836d09a178460b9e64e76e42c89836e5721 (patch) | |
tree | 4f802d963792fb8692dad8d61a0010b12d1210a8 /src/ui/util.c | |
parent | c3e5a0c2d4168515804dc0823c93d0522982108c (diff) |
Added image colorization preference
Option to colorize images to grayscale, text color, or preformatted color.
Diffstat (limited to 'src/ui/util.c')
-rw-r--r-- | src/ui/util.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/ui/util.c b/src/ui/util.c index b6ecc7d5..8a42f75b 100644 --- a/src/ui/util.c +++ b/src/ui/util.c | |||
@@ -1831,6 +1831,23 @@ iWidget *makePreferences_Widget(void) { | |||
1831 | addRadioButton_(sats, "prefs.saturation.0", "0 %", "saturation.set arg:0"); | 1831 | addRadioButton_(sats, "prefs.saturation.0", "0 %", "saturation.set arg:0"); |
1832 | } | 1832 | } |
1833 | addChildFlags_Widget(values, iClob(sats), arrangeHorizontal_WidgetFlag | arrangeSize_WidgetFlag); | 1833 | addChildFlags_Widget(values, iClob(sats), arrangeHorizontal_WidgetFlag | arrangeSize_WidgetFlag); |
1834 | /* Colorize images. */ { | ||
1835 | addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.imagestyle}"))); | ||
1836 | const iMenuItem imgStyles[] = { | ||
1837 | { "${prefs.imagestyle.original}", 0, 0, format_CStr("imagestyle.set arg:%d", original_ImageStyle) }, | ||
1838 | { "${prefs.imagestyle.grayscale}", 0, 0, format_CStr("imagestyle.set arg:%d", grayscale_ImageStyle) }, | ||
1839 | { "${prefs.imagestyle.text}", 0, 0, format_CStr("imagestyle.set arg:%d", textColorized_ImageStyle) }, | ||
1840 | { "${prefs.imagestyle.preformat}", 0, 0, format_CStr("imagestyle.set arg:%d", preformatColorized_ImageStyle) }, | ||
1841 | }; | ||
1842 | iLabelWidget *button = makeMenuButton_LabelWidget( | ||
1843 | imgStyles[findWidestItemLabel_(imgStyles, iElemCount(imgStyles))].label, | ||
1844 | imgStyles, | ||
1845 | iElemCount(imgStyles)); | ||
1846 | setBackgroundColor_Widget(findChild_Widget(as_Widget(button), "menu"), | ||
1847 | uiBackgroundMenu_ColorId); | ||
1848 | setId_Widget(addChildFlags_Widget(values, iClob(button), alignLeft_WidgetFlag), | ||
1849 | "prefs.imagestyle"); | ||
1850 | } | ||
1834 | } | 1851 | } |
1835 | /* Fonts. */ { | 1852 | /* Fonts. */ { |
1836 | setId_Widget(appendTwoColumnTabPage_Widget(tabs, "${heading.prefs.fonts}", '4', &headings, &values), "prefs.page.fonts"); | 1853 | setId_Widget(appendTwoColumnTabPage_Widget(tabs, "${heading.prefs.fonts}", '4', &headings, &values), "prefs.page.fonts"); |