From 4cea3aee0c4153c7b7c2fc485b2e4ef37cbd3f19 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Thu, 9 Jul 2015 00:10:44 +0000 Subject: Fix box background drawing for deactivated widgets (STR #2907). Two new static methods have been introduced: - Fl::box_color(Fl_Color c) returns the bg color dependent on the widget's state (inactive_r()). - Fl::set_box_color(Fl_Color c) sets the correct bg color dependent on the widget's state by calling fl_color(Fl::box_color(c)). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10781 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/fl_gtk.cxx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/fl_gtk.cxx') diff --git a/src/fl_gtk.cxx b/src/fl_gtk.cxx index edf3f920a..7b4126692 100644 --- a/src/fl_gtk.cxx +++ b/src/fl_gtk.cxx @@ -30,11 +30,9 @@ extern void fl_internal_boxtype(Fl_Boxtype, Fl_Box_Draw_F*); static void gtk_color(Fl_Color c) { - if (Fl::draw_box_active()) fl_color(c); - else fl_color(fl_inactive(c)); + Fl::set_box_color(c); } - static void gtk_up_frame(int x, int y, int w, int h, Fl_Color c) { gtk_color(fl_color_average(FL_WHITE, c, 0.5)); fl_xyline(x + 2, y + 1, x + w - 3); @@ -204,7 +202,7 @@ static void draw(int which, int x,int y,int w,int h, int inset) } static void gtk_round_up_box(int x, int y, int w, int h, Fl_Color c) { - fl_color(c); + gtk_color(c); draw(FILL, x, y, w, h, 2); gtk_color(fl_color_average(FL_BLACK, c, 0.025f)); @@ -235,7 +233,7 @@ static void gtk_round_up_box(int x, int y, int w, int h, Fl_Color c) { } static void gtk_round_down_box(int x, int y, int w, int h, Fl_Color c) { - fl_color(c); + gtk_color(c); draw(FILL, x, y, w, h, 2); gtk_color(fl_color_average(FL_BLACK, c, 0.05f)); -- cgit v1.2.3