summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2010-12-18 15:31:44 +0000
committerAlbrecht Schlosser <albrechts.fltk@online.de>2010-12-18 15:31:44 +0000
commit403ee0ce23a0c62ffec254448a327bcc8158b34e (patch)
tree811e4fefb49cdff33e2d4db1c58f4c0911492ccb /src
parent15e1ddf3c9c0ea6e24b331c848e4e40c8cb6ca35 (diff)
Fixed Fl_Tabs selection border drawing, if tabs are at the bottom of
the widget (STR #2480). Thanks for the patch. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8053 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Tabs.cxx14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/Fl_Tabs.cxx b/src/Fl_Tabs.cxx
index c62b2478e..6f1c3674b 100644
--- a/src/Fl_Tabs.cxx
+++ b/src/Fl_Tabs.cxx
@@ -40,6 +40,7 @@
#define BORDER 2
#define EXTRASPACE 10
+#define SELECTION_BORDER 5
// return the left edges of each tab (plus a fake left edge for a tab
// past the right-hand one). These position are actually of the left
@@ -311,14 +312,11 @@ void Fl_Tabs::draw() {
draw_box(box(), x(), y()+(H>=0?H:0), w(), h()-(H>=0?H:-H), c);
if (selection_color() != c) {
- // Draw the top 5 lines of the tab pane in the selection color so
- // that the user knows which tab is selected...
- if (H >= 0) fl_push_clip(x(), y() + H, w(), 5);
- else fl_push_clip(x(), y() + h() - H - 4, w(), 5);
-
- draw_box(box(), x(), y()+(H>=0?H:0), w(), h()-(H>=0?H:-H),
- selection_color());
-
+ // Draw the top or bottom SELECTION_BORDER lines of the tab pane in the
+ // selection color so that the user knows which tab is selected...
+ int clip_y = (H >= 0) ? y() + H : y() + h() + H - SELECTION_BORDER;
+ fl_push_clip(x(), clip_y, w(), SELECTION_BORDER);
+ draw_box(box(), x(), clip_y, w(), SELECTION_BORDER, selection_color());
fl_pop_clip();
}
if (v) draw_child(*v);