summaryrefslogtreecommitdiff
path: root/src/Fl_Tabs.cxx
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2005-05-26 13:54:53 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2005-05-26 13:54:53 +0000
commitdb98aaac869add42f37d46db2e461e665a404dc0 (patch)
treec1b9220033f0a647030d1f4a65c00457773dd43c /src/Fl_Tabs.cxx
parentd47f353023a16e3fbb906ce5a2e9c7e2e0bd8d76 (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
Diffstat (limited to 'src/Fl_Tabs.cxx')
-rw-r--r--src/Fl_Tabs.cxx11
1 files changed, 7 insertions, 4 deletions
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);