FL: Mute colors in Clean theme.

This commit is contained in:
Jonathan Moore Liles 2012-04-11 22:48:47 -07:00
parent 12532e1fbc
commit 25a0b8afc6
1 changed files with 30 additions and 22 deletions

View File

@ -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