@@ -28,7 +28,7 @@ | |||||
#include "FL/Fl_Theme.H" | #include "FL/Fl_Theme.H" | ||||
#include <math.h> | #include <math.h> | ||||
float fl_box_saturation = 0.2f; | |||||
float fl_box_saturation = 0.8f; | |||||
bool fl_boxes_use_gradients = true; | bool fl_boxes_use_gradients = true; | ||||
bool fl_debug_boxes = false; | bool fl_debug_boxes = false; | ||||
@@ -152,7 +152,7 @@ static void shade_rect_down(int x, int y, int w, int h, Fl_Color bc) | |||||
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) | ||||
{ | { | ||||
frame_rect_up(x, y, w, h, fl_darker(c)); | |||||
frame_rect_up(x, y, w, h, c); | |||||
} | } | ||||
static void thin_up_box(int x, int y, int w, int h, Fl_Color c) | static void thin_up_box(int x, int y, int w, int h, Fl_Color c) | ||||
@@ -172,12 +172,15 @@ static void down_frame(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) | static void down_box(int x, int y, int w, int h, Fl_Color c) | ||||
{ | { | ||||
shade_rect_down(x, y, w, h, fl_lighter(c)); | |||||
shade_rect_down(x, y, w, h, c == FL_BACKGROUND_COLOR || c == FL_BACKGROUND2_COLOR ? fl_darker(c) : c ); | |||||
} | } | ||||
static void thin_down_box(int x, int y, int w, int h, Fl_Color c) | static void thin_down_box(int x, int y, int w, int h, Fl_Color c) | ||||
{ | { | ||||
down_box(x, y, w, h, fl_lighter(c)); | |||||
down_box(x, y, w, h, | |||||
FL_BACKGROUND_COLOR == c || FL_BACKGROUND2_COLOR == c | |||||
? fl_darker(c) | |||||
: c ); | |||||
} | } | ||||
static void border_box(int x, int y, int w, int h, Fl_Color c) | static void border_box(int x, int y, int w, int h, Fl_Color c) | ||||
@@ -64,7 +64,10 @@ static void down_frame(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) | static void down_box(int x, int y, int w, int h, Fl_Color c) | ||||
{ | { | ||||
rectf(x, y, w, h, c ); | |||||
rectf(x, y, w, h, | |||||
FL_BACKGROUND_COLOR == c || FL_BACKGROUND2_COLOR == c | |||||
? fl_darker(c) | |||||
: c ); | |||||
rect(x, y, w, h, fl_color_average( FL_WHITE, c, 0.2 ) ); | rect(x, y, w, h, fl_color_average( FL_WHITE, c, 0.2 ) ); | ||||
} | } | ||||
@@ -352,7 +352,10 @@ down_box ( int x, int y, int w, int h, Fl_Color c ) | |||||
if ( w > 6 && h > 6 ) | if ( w > 6 && h > 6 ) | ||||
{ | { | ||||
// shade_rect( x + 2, y + 2, w - 4, h - 5, "STUVWWWVT", c ); | // shade_rect( x + 2, y + 2, w - 4, h - 5, "STUVWWWVT", c ); | ||||
fl_rectf( x + 2, y + 2, w - 4, h - 5 , fl_darker( c ) ); | |||||
fl_rectf( x + 2, y + 2, w - 4, h - 5 , | |||||
FL_BACKGROUND_COLOR == c || FL_BACKGROUND2_COLOR == c | |||||
? fl_darker(c) | |||||
: c ); | |||||
down_frame( x, y, w, h, c ); | down_frame( x, y, w, h, c ); | ||||
} | } | ||||
else | else | ||||
@@ -140,7 +140,10 @@ static void down_frame(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) | static void down_box(int x, int y, int w, int h, Fl_Color c) | ||||
{ | { | ||||
shade_rect_down(x + 1, y, w - 2, h, c); | |||||
shade_rect_down(x + 1, y, w - 2, h, | |||||
FL_BACKGROUND_COLOR == c || FL_BACKGROUND2_COLOR == c | |||||
? fl_darker(c) | |||||
: c ); | |||||
down_frame(x, y, w, h, fl_darker(c)); | down_frame(x, y, w, h, fl_darker(c)); | ||||
//draw the inner rect. | //draw the inner rect. | ||||
//frame_rect(x + 1, y + 1, w - 3, h - 3, fl_color_average(c, FL_BLACK, .65)); | //frame_rect(x + 1, y + 1, w - 3, h - 3, fl_color_average(c, FL_BLACK, .65)); | ||||
@@ -48,11 +48,19 @@ static void cairo_color(Fl_Color c) | |||||
static Fl_Color border_color ( Fl_Color c ) | static Fl_Color border_color ( Fl_Color c ) | ||||
{ | { | ||||
return fl_color_average( FL_FOREGROUND_COLOR, c, 0.20f ); | return fl_color_average( FL_FOREGROUND_COLOR, c, 0.20f ); | ||||
/* return fl_color_average( FL_FOREGROUND_COLOR, c, 0.33f ); */ | |||||
/* return fl_color_average( FL_FOREGROUND_COLOR, c, 0.50f ); */ | |||||
} | } | ||||
static Fl_Color interior_color ( Fl_Color c ) | static Fl_Color interior_color ( Fl_Color c ) | ||||
{ | { | ||||
return fl_color_average( FL_BACKGROUND_COLOR, c, 0.50f ); | |||||
return fl_color_average( FL_BACKGROUND_COLOR, c, 0.33f ); | |||||
} | |||||
static Fl_Color outer_border_color ( Fl_Color c ) | |||||
{ | |||||
/* return fl_darker( interior_color( c ) ); */ | |||||
return fl_color_average( c, FL_BACKGROUND_COLOR, 0.50f ); | |||||
} | } | ||||
static void rect_path ( float x, float y, float w, float h, double radius ) | static void rect_path ( float x, float y, float w, float h, double radius ) | ||||
@@ -96,23 +104,34 @@ static void draw_rectf(int x, int y, int w, int h, Fl_Color bc, double radius = | |||||
static void up_box(int x, int y, int w, int h, Fl_Color bc) | static void up_box(int x, int y, int w, int h, Fl_Color bc) | ||||
{ | { | ||||
draw_rectf( x, y, w, h, interior_color( bc ) ); | draw_rectf( x, y, w, h, interior_color( bc ) ); | ||||
draw_rect( x, y, w, h, border_color( bc ) ); | |||||
/* draw_rect( x, y, w, h, border_color( bc ) ); */ | |||||
draw_rect( x+1, y+1, w-2, h-2, border_color( bc ) ); | |||||
draw_rect( x, y, w, h, outer_border_color( bc ) ); | |||||
} | } | ||||
static void up_frame(int x, int y, int w, int h, Fl_Color bc) | static void up_frame(int x, int y, int w, int h, Fl_Color bc) | ||||
{ | { | ||||
draw_rect( x,y,w,h, border_color(bc) ); | |||||
/* draw_rect( x, y, w, h, border_color( bc ) ); */ | |||||
draw_rect( x+1,y+1,w-2,h-2, border_color(bc) ); | |||||
draw_rect( x, y, w, h, outer_border_color( bc ) ); | |||||
} | } | ||||
static void down_frame(int x, int y, int w, int h, Fl_Color bc) | static void down_frame(int x, int y, int w, int h, Fl_Color bc) | ||||
{ | { | ||||
draw_rect( x,y,w,h, bc ); | |||||
/* draw_rect( x, y, w, h, bc ); */ | |||||
draw_rect( x+1,y+1,w-2,h-2, bc ); | |||||
draw_rect( x, y, w, h, outer_border_color( bc ) ); | |||||
} | } | ||||
static void down_box(int x, int y, int w, int h, Fl_Color bc) | static void down_box(int x, int y, int w, int h, Fl_Color bc) | ||||
{ | { | ||||
draw_rectf( x, y, w, h, interior_color( bc ) ); | |||||
draw_rect( x, y, w, h, bc ); | |||||
draw_rectf( x, y, w, h, | |||||
FL_BACKGROUND_COLOR == bc || FL_BACKGROUND2_COLOR == bc | |||||
? fl_darker(interior_color(bc)) | |||||
: interior_color( bc ) ); | |||||
/* draw_rect( x, y, w, h, bc ); */ | |||||
draw_rect( x+1, y+1, w-2, h-2, bc ); | |||||
draw_rect( x, y, w, h, outer_border_color( bc ) ); | |||||
} | } | ||||
static void border_box(int x, int y, int w, int h, Fl_Color bc) | static void border_box(int x, int y, int w, int h, Fl_Color bc) | ||||
@@ -120,6 +139,9 @@ static void border_box(int x, int y, int w, int h, Fl_Color bc) | |||||
cairo_color( interior_color( bc ) ); | cairo_color( interior_color( bc ) ); | ||||
fl_rectf( x, y, w, h ); | fl_rectf( x, y, w, h ); | ||||
cairo_color( border_color( bc ) ); | cairo_color( border_color( bc ) ); | ||||
/* fl_rect( x, y, w, h, bc ); */ | |||||
fl_rect( x+1, y+1, w-2, h-2, bc ); | |||||
cairo_color( outer_border_color( bc ) ); | |||||
fl_rect( x, y, w, h, bc ); | fl_rect( x, y, w, h, bc ); | ||||
} | } | ||||