From db98aaac869add42f37d46db2e461e665a404dc0 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Thu, 26 May 2005 13:54:53 +0000 Subject: 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 --- src/Fl_Tabs.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') 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); -- cgit v1.2.3