From 25a0b8afc65afc68ff34da7c8abecf1d7721d34a Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Wed, 11 Apr 2012 22:48:47 -0700 Subject: [PATCH] FL: Mute colors in Clean theme. --- FL/Clean_Theme.C | 52 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/FL/Clean_Theme.C b/FL/Clean_Theme.C index 4ee8ebd..82209a7 100644 --- a/FL/Clean_Theme.C +++ b/FL/Clean_Theme.C @@ -25,59 +25,67 @@ #include "FL/Fl_Theme.H" -/* static void clean_color(Fl_Color c) */ -/* { */ -/* /\* if (Fl::draw_box_active()) *\/ */ -/* /\* fl_color(c); *\/ */ -/* /\* else *\/ */ -/* /\* fl_color(fl_inactive(c)); *\/ */ - -/* } */ +static void clean_color(Fl_Color c) +{ + c = fl_color_average( FL_GRAY, c, 0.4 ); + + if (Fl::draw_box_active()) + fl_color(c); + else + fl_color(fl_inactive(c)); +} static void rect(int x, int y, int w, int h, Fl_Color bc) { +// clean_color( bc ); fl_rect( x, y, w, h, bc ); } static void rectf ( int x, int y,int w, int h, Fl_Color bc ) { - fl_rectf( x, y, w, h, fl_color_average( FL_WHITE, bc, 0.05 ) ); + clean_color(fl_color_average( FL_WHITE, bc, 0.05 ) ); + fl_rectf( x, y, w, h ); } static void up_frame(int x, int y, int w, int h, Fl_Color c) { - rect(x, y, w, h, fl_color_average( FL_WHITE, c, 0.1 ) ); + rect(x, y, w, h, fl_color_average( FL_WHITE, c, 0.2 ) ); } static void up_box(int x, int y, int w, int h, Fl_Color c) { rectf(x, y, w, h, c ); - rect(x, y, w, h, fl_color_average( FL_WHITE, c, 0.1 ) ); + rect(x, y, w, h, fl_color_average( FL_WHITE, c, 0.2 ) ); } static void down_frame(int x, int y, int w, int h, Fl_Color c) { - rect(x, y, w, h, fl_color_average( FL_BLACK, c, 0.1 ) ); + rect(x, y, w, h, fl_color_average( FL_BLACK, c, 0.2 ) ); } static void down_box(int x, int y, int w, int h, Fl_Color c) { rectf(x, y, w, h, fl_color_average( FL_WHITE, c, 0.2 ) ); - rect(x, y, w, h, fl_color_average( FL_BLACK, c, 0.1 ) ); + rect(x, y, w, h, fl_color_average( FL_WHITE, c, 0.4 ) ); +} + +static void flat_box( int x, int y, int w, int h, Fl_Color c ) +{ + rectf( x, y, w, h, c ); } static void init_theme ( void ) { - /* replace the gtk+ boxes... (is there a better way?) */ - Fl::set_boxtype( FL_UP_BOX, up_box, 1,1,1,1 ); - Fl::set_boxtype( FL_DOWN_BOX, down_box, 1,1,1,1 ); - Fl::set_boxtype( FL_THIN_UP_BOX, up_box, 1,1,1,1 ); - Fl::set_boxtype( FL_THIN_DOWN_BOX, down_box, 1,1,1,1 ); - Fl::set_boxtype( FL_UP_FRAME, up_frame, 1,1,1,1 ); - Fl::set_boxtype( FL_DOWN_FRAME, down_frame, 1,1,1,1 ); - Fl::set_boxtype( FL_ROUND_UP_BOX, up_box, 1,1,1,1 ); - Fl::set_boxtype( FL_ROUND_DOWN_BOX, down_box, 1,1,1,1 ); + Fl::set_boxtype( FL_UP_BOX, up_box, 1,1,2,2 ); + Fl::set_boxtype( FL_DOWN_BOX, down_box, 1,1,2,2 ); + Fl::set_boxtype( FL_THIN_UP_BOX, up_box, 1,1,2,2 ); + Fl::set_boxtype( FL_THIN_DOWN_BOX, down_box, 1,1,2,2 ); + Fl::set_boxtype( FL_UP_FRAME, up_frame, 1,1,2,2 ); + Fl::set_boxtype( FL_DOWN_FRAME, down_frame, 1,1,2,2 ); + Fl::set_boxtype( FL_ROUND_UP_BOX, up_box, 1,1,2,2 ); + Fl::set_boxtype( FL_ROUND_DOWN_BOX, down_box, 1,1,2,2 ); + Fl::set_boxtype( FL_FLAT_BOX, flat_box, 0, 0, 0, 0 ); } void -- 2.11.4.GIT