diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2005-05-26 13:54:53 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2005-05-26 13:54:53 +0000 |
| commit | db98aaac869add42f37d46db2e461e665a404dc0 (patch) | |
| tree | c1b9220033f0a647030d1f4a65c00457773dd43c | |
| parent | d47f353023a16e3fbb906ce5a2e9c7e2e0bd8d76 (diff) | |
Selected tabs are now drawn slightly larger than unselected tabs
so they stand out more (STR #882)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4371 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -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); |
