Re: ui colors again
Jorge Arellano Cid <[email protected]>
| Newsgroups | gmane.comp.web.dillo.devel |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Jan 02, 2013 at 09:05:16PM +0000, corvid wrote:
> Jorge wrote:
> > For instance, adding these vars to the current set:
> >
> > tab_bg_color, tab_fg_color,
> > tab_text_active_color, tab_text_inactive_color
> > ui_button_highlight_color
> > menu_active_item_color,
> >
> > would allow for huge themability options.
> >
> > I know it looks like an overkill, but yesterday, playing with
> > the "toy" color chooser, with colors/themes I never use, found
> > that some of our "good defaults" are poor choices for completely
> > different color schemes.
> >
> > The good part is that with a detailed color vars set, a theme
> > becomes a small set of integers. Quite easy to handle.
>
> Okay, I'll add a bunch of prefs for us to experiment with.
Good.
Attached goes some test code I used to test tab colors. HTH.
FWIW, I get close to the traditional colors with:
ui_fg_color=140040
ui_main_bg_color=c6c6c6
ui_text_bg_color=bfdabf
ui_tab_active_color=87aca7
ui_tab_inactive_color=silver
> > Ideally yes. Now, it needs some care. For instance, the "toy"
> > chooser changes ui background well, but doesn't update the colors
> > of inactive buttons with the new backgrounds (which makes a huge
> > difference with bluish backgrounds. e.g. ui_main_bg_color=0070c0).
>
> Yeah, I'll put a little more time into the toy later. Background also
> needs to update the gray ramp so that box colors work better, for
> instance...
OK.
--
Cheers
Jorge.-
_______________________________________________
Dillo-dev mailing list
[email protected]
http://lists.auriga.wearlab.de/cgi-bin/mailman/listinfo/dillo-dev
tab_color_prefs.diff
(text/x-diff, 2.9 KB)
diff -r 028e7d7aa28a src/dillo.cc
--- a/src/dillo.cc Wed Jan 02 17:03:52 2013 -0300
+++ b/src/dillo.cc Wed Jan 02 19:36:53 2013 -0300
@@ -392,6 +392,10 @@ int main(int argc, char **argv)
setColor(prefs.ui_main_bg_color, Fl::background);
setColor(prefs.ui_text_bg_color, Fl::background2);
setColor(prefs.ui_fg_color, Fl::foreground);
+ if (prefs.ui_tab_active_color == -1)
+ prefs.ui_tab_active_color = prefs.ui_text_bg_color;
+ if (prefs.ui_tab_inactive_color == -1)
+ prefs.ui_tab_inactive_color = prefs.ui_main_bg_color;
unsigned rgb = Fl::get_color(fl_contrast(FL_SELECTION_COLOR,
FL_BACKGROUND2_COLOR));
diff -r 028e7d7aa28a src/prefs.c
--- a/src/prefs.c Wed Jan 02 17:03:52 2013 -0300
+++ b/src/prefs.c Wed Jan 02 19:36:53 2013 -0300
@@ -102,6 +102,8 @@ void a_Prefs_init(void)
prefs.ui_fg_color = -1;
prefs.ui_main_bg_color = -1;
prefs.ui_text_bg_color = -1;
+ prefs.ui_tab_active_color = -1;
+ prefs.ui_tab_inactive_color = -1;
prefs.w3c_plus_heuristics = TRUE;
prefs.penalty_hyphen = 100;
diff -r 028e7d7aa28a src/prefs.h
--- a/src/prefs.h Wed Jan 02 17:03:52 2013 -0300
+++ b/src/prefs.h Wed Jan 02 19:36:53 2013 -0300
@@ -47,6 +47,8 @@ struct _DilloPrefs {
int32_t ui_fg_color;
int32_t ui_main_bg_color;
int32_t ui_text_bg_color;
+ int32_t ui_tab_active_color;
+ int32_t ui_tab_inactive_color;
bool_t contrast_visited_color;
bool_t show_tooltip;
char *theme;
diff -r 028e7d7aa28a src/prefsparser.cc
--- a/src/prefsparser.cc Wed Jan 02 17:03:52 2013 -0300
+++ b/src/prefsparser.cc Wed Jan 02 19:36:53 2013 -0300
@@ -112,6 +112,8 @@ int PrefsParser::parseOption(char *name,
{ "ui_fg_color", &prefs.ui_fg_color, PREFS_COLOR },
{ "ui_main_bg_color", &prefs.ui_main_bg_color, PREFS_COLOR },
{ "ui_text_bg_color", &prefs.ui_text_bg_color, PREFS_COLOR },
+ { "ui_tab_active_color", &prefs.ui_tab_active_color, PREFS_COLOR },
+ { "ui_tab_inactive_color", &prefs.ui_tab_inactive_color, PREFS_COLOR },
{ "w3c_plus_heuristics", &prefs.w3c_plus_heuristics, PREFS_BOOL },
{ "penalty_hyphen", &prefs.penalty_hyphen, PREFS_FRACTION_100 },
{ "penalty_hyphen_2", &prefs.penalty_hyphen_2, PREFS_FRACTION_100 },
diff -r 028e7d7aa28a src/uicmd.cc
--- a/src/uicmd.cc Wed Jan 02 17:03:52 2013 -0300
+++ b/src/uicmd.cc Wed Jan 02 19:36:53 2013 -0300
@@ -137,8 +137,8 @@ public:
Pack = NULL;
focus_counter = 0;
tab_w = 50, tab_h = th, ctab_h = 1, btn_w = 20, ctl_w = 1*btn_w+2;
- tabcolor_active = fl_lighter(FL_BACKGROUND2_COLOR);
- tabcolor_inactive = fl_lighter(FL_BACKGROUND_COLOR);
+ tabcolor_active = prefs.ui_tab_active_color << 8;
+ tabcolor_inactive = prefs.ui_tab_inactive_color << 8;
resize(0,0,ww,ctab_h);
/* tab buttons go inside a pack within a scroll */
Scroll = new Fl_Scroll(0,0,ww-ctl_w,ctab_h);