diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_Tabs.cxx | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/src/Fl_Tabs.cxx b/src/Fl_Tabs.cxx index 26e092f3e..d57b92bc9 100644 --- a/src/Fl_Tabs.cxx +++ b/src/Fl_Tabs.cxx @@ -377,7 +377,11 @@ void Fl_Tabs::draw_tab(int x1, int x2, int W, int H, Fl_Widget* o, int what) { char prev_draw_shortcut = fl_draw_shortcut; fl_draw_shortcut = 1; - Fl_Boxtype bt = (o==push_ &&!sel) ? fl_down(box()) : box(); + Fl_Boxtype bt = (o == push_ && !sel) ? fl_down(box()) : box(); + Fl_Color bc = sel ? selection_color() : o->selection_color(); + + // Save the label color + Fl_Color oc = o->labelcolor(); // compute offsets to make selected tab look bigger int yofs = sel ? 0 : BORDER; @@ -390,20 +394,12 @@ void Fl_Tabs::draw_tab(int x1, int x2, int W, int H, Fl_Widget* o, int what) { H += dh; - Fl_Color c = sel ? selection_color() : o->selection_color(); - - draw_box(bt, x1, y() + yofs, W, H + 10 - yofs, c); - - // Save the previous label color - Fl_Color oc = o->labelcolor(); + draw_box(bt, x1, y() + yofs, W, H + 10 - yofs, bc); // Draw the label using the current color... o->labelcolor(sel ? labelcolor() : o->labelcolor()); o->draw_label(x1, y() + yofs, W, H - yofs, FL_ALIGN_CENTER); - // Restore the original label color... - o->labelcolor(oc); - if (Fl::focus() == this && o->visible()) draw_focus(box(), x1, y(), W, H); @@ -416,26 +412,21 @@ void Fl_Tabs::draw_tab(int x1, int x2, int W, int H, Fl_Widget* o, int what) { H += dh; - Fl_Color c = sel ? selection_color() : o->selection_color(); - - draw_box(bt, x1, y() + h() - H - 10, W, H + 10 - yofs, c); - - // Save the previous label color - Fl_Color oc = o->labelcolor(); + draw_box(bt, x1, y() + h() - H - 10, W, H + 10 - yofs, bc); // Draw the label using the current color... o->labelcolor(sel ? labelcolor() : o->labelcolor()); o->draw_label(x1, y() + h() - H, W, H - yofs, FL_ALIGN_CENTER); - // Restore the original label color... - o->labelcolor(oc); - if (Fl::focus() == this && o->visible()) draw_focus(box(), x1, y() + h() - H, W, H); fl_pop_clip(); } fl_draw_shortcut = prev_draw_shortcut; + + // Restore the original label color + o->labelcolor(oc); } /** |
