Browse Source

FL: Mute colors in Clean theme.

tags/non-daw-v1.2.0
Jonathan Moore Liles 13 years ago
parent
commit
25a0b8afc6
1 changed files with 30 additions and 22 deletions
  1. +30
    -22
      FL/Clean_Theme.C

+ 30
- 22
FL/Clean_Theme.C View File

@@ -25,59 +25,67 @@


#include "FL/Fl_Theme.H" #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) static void rect(int x, int y, int w, int h, Fl_Color bc)
{ {
// clean_color( bc );
fl_rect( x, y, w, h, bc ); fl_rect( x, y, w, h, bc );
} }


static void rectf ( int x, int y,int w, int h, Fl_Color 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) 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) static void up_box(int x, int y, int w, int h, Fl_Color c)
{ {
rectf(x, y, w, h, 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) 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) 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 ) ); 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 static void
init_theme ( 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 void


Loading…
Cancel
Save