diff options
author | corvid <corvid@lavabit.com> | 2012-12-30 03:38:42 +0000 |
---|---|---|
committer | corvid <corvid@lavabit.com> | 2012-12-30 03:38:42 +0000 |
commit | aaab52c26db7ab85b263820947232d7eff8eebb3 (patch) | |
tree | eeeaa33783c6ec53f18638c1c7669128f31fcf1c /src/dillo.cc | |
parent | 08fcee0f972badaa2dc71ae5008fc5ae71dde1a3 (diff) |
ui color fg/bg preferences
Recent mailing list: http://lists.auriga.wearlab.de/pipermail/dillo-dev/2012-December/009661.html
The earlier thread begins with: http://lists.auriga.wearlab.de/pipermail/dillo-dev/2011-September/008890.html
Diffstat (limited to 'src/dillo.cc')
-rw-r--r-- | src/dillo.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/dillo.cc b/src/dillo.cc index 1b7ca4f5..7fa471c8 100644 --- a/src/dillo.cc +++ b/src/dillo.cc @@ -237,6 +237,12 @@ static void checkPreferredFonts() checkFont(prefs.font_fantasy, "fantasy"); } +static void setColor(int32_t color, void (*fn) (uchar, uchar, uchar)) +{ + if (color != -1) + fn(color >> 16, (color >> 8) & 0xff, color & 0xff); +} + /* * Given a command line argument, build a DilloUrl for it. */ @@ -382,6 +388,14 @@ int main(int argc, char **argv) Fl::scheme(prefs.theme); + setColor(prefs.ui_main_bg_color, Fl::background); + setColor(prefs.ui_text_bg_color, Fl::background2); + setColor(prefs.ui_fg_color, Fl::foreground); + + unsigned rgb = Fl::get_color(fl_contrast(FL_SELECTION_COLOR, + FL_BACKGROUND2_COLOR)); + Fl::set_color(FL_SELECTION_COLOR, rgb); + if (!prefs.show_tooltip) { // turn off UI tooltips Fl::option(Fl::OPTION_SHOW_TOOLTIPS, false); |