diff options
| -rw-r--r-- | CHANGES | 2 | ||||
| -rw-r--r-- | src/Fl_Tabs.cxx | 11 |
2 files changed, 9 insertions, 4 deletions
@@ -2,6 +2,8 @@ CHANGES IN FLTK 1.1.7 - Documentation fixes (STR #648, STR #692, STR #730, STR #744, STR #745) + - Selected tabs are now drawn slightly larger than + unselected tabs so they stand out more (STR #882) - FL_PLASTIC_DOWN_BOX drew with artifacts (STR #852) - Changed initializations on WIN32 (STR #862) - Fl_Preferences::getUserdataPath() didn't work for diff --git a/src/Fl_Tabs.cxx b/src/Fl_Tabs.cxx index 8d46e8726..1669ed947 100644 --- a/src/Fl_Tabs.cxx +++ b/src/Fl_Tabs.cxx @@ -281,6 +281,9 @@ void Fl_Tabs::draw_tab(int x1, int x2, int W, int H, Fl_Widget* o, int what) { int dh = Fl::box_dh(box()); int dy = Fl::box_dy(box()); + // compute offsets to make selected tab look bigger + int yofs = sel ? 0 : BORDER; + if ((x2 < x1+W) && what == RIGHT) x1 = x2 - W; if (H >= 0) { @@ -291,14 +294,14 @@ void Fl_Tabs::draw_tab(int x1, int x2, int W, int H, Fl_Widget* o, int what) { Fl_Color c = sel ? selection_color() : o->selection_color(); - draw_box(box(), x1, y(), W, H + 10, c); + draw_box(box(), x1, y() + yofs, W, H + 10 - yofs, c); // Save the previous label color Fl_Color oc = o->labelcolor(); // Draw the label using the current color... o->labelcolor(sel ? labelcolor() : o->labelcolor()); - o->draw_label(x1, y(), W, H, FL_ALIGN_CENTER); + o->draw_label(x1, y() + yofs, W, H - yofs, FL_ALIGN_CENTER); // Restore the original label color... o->labelcolor(oc); @@ -317,14 +320,14 @@ void Fl_Tabs::draw_tab(int x1, int x2, int W, int H, Fl_Widget* o, int what) { Fl_Color c = sel ? selection_color() : o->selection_color(); - draw_box(box(), x1, y() + h() - H - 10, W, H + 10, c); + draw_box(box(), x1, y() + h() - H - 10, W, H + 10 - yofs, c); // Save the previous label color Fl_Color oc = o->labelcolor(); // Draw the label using the current color... o->labelcolor(sel ? labelcolor() : o->labelcolor()); - o->draw_label(x1, y() + h() - H, W, H, FL_ALIGN_CENTER); + o->draw_label(x1, y() + h() - H, W, H - yofs, FL_ALIGN_CENTER); // Restore the original label color... o->labelcolor(oc); |
