summaryrefslogtreecommitdiff
path: root/src/Fl_Tabs.cxx
diff options
context:
space:
mode:
authorBill Spitzak <spitzak@gmail.com>2000-08-12 08:42:12 +0000
committerBill Spitzak <spitzak@gmail.com>2000-08-12 08:42:12 +0000
commitfb06bd8019a0bb1d8288f42b0b68d4e5a1348f54 (patch)
tree5091f1623bf2763193358f70e02d3cf6c587ff13 /src/Fl_Tabs.cxx
parent797d78d86c4ce3bc830b5fcd30ac5a6c73d0ee42 (diff)
Patch from Mike Lindner to make the turning on/off of scrollbars on
Fl_Scroll smarter. It appears to work with my own tests. He did not handle FL_ALIGN_TOP correctly, fixed that. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1285 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Tabs.cxx')
-rw-r--r--src/Fl_Tabs.cxx17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/Fl_Tabs.cxx b/src/Fl_Tabs.cxx
index 353d06b13..fe85eb126 100644
--- a/src/Fl_Tabs.cxx
+++ b/src/Fl_Tabs.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Tabs.cxx,v 1.6.2.6 2000/06/05 21:20:57 mike Exp $"
+// "$Id: Fl_Tabs.cxx,v 1.6.2.7 2000/08/12 08:42:12 spitzak Exp $"
//
// Tab widget for the Fast Light Tool Kit (FLTK).
//
@@ -34,7 +34,8 @@
#include <FL/fl_draw.H>
#define BORDER 10
-#define TABSLOPE 8
+#define TABSLOPE 5
+#define EXTRASPACE 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
@@ -52,8 +53,8 @@ int Fl_Tabs::tab_positions(int* p, int* w) {
if (o->visible()) selected = i;
if (o->label()) {
int wt = 0; int ht = 0; o->measure_label(wt,ht);
- w[i] = wt+TABSLOPE;
- if (2*TABSLOPE > w[i]) w[i] = 2*TABSLOPE;
+ w[i] = wt+TABSLOPE+EXTRASPACE;
+ //if (2*TABSLOPE > w[i]) w[i] = 2*TABSLOPE;
} else
w[i] = 2*TABSLOPE;
p[i+1] = p[i]+w[i];
@@ -257,9 +258,9 @@ void Fl_Tabs::draw_tab(int x1, int x2, int W, int H, Fl_Widget* o, int what) {
fl_color(!sel && o==push_ ? FL_DARK3 : FL_LIGHT3);
fl_line(x1, y()+h()+H, x1+TABSLOPE, y()+h()-1);
}
- if (W > TABSLOPE)
- o->draw_label(what==LEFT ? x1+TABSLOPE : x2-W+TABSLOPE,
- y()+(H<0?h()+H-3:0), W-TABSLOPE,
+ if (W > TABSLOPE+EXTRASPACE/2)
+ o->draw_label((what==LEFT ? x1 : x2-W)+(TABSLOPE+EXTRASPACE/2),
+ y()+(H<0?h()+H-2:0), W-(TABSLOPE+EXTRASPACE/2),
(H<0?-H:H)+3, FL_ALIGN_CENTER);
}
@@ -271,5 +272,5 @@ Fl_Tabs::Fl_Tabs(int X,int Y,int W, int H, const char *l) :
}
//
-// End of "$Id: Fl_Tabs.cxx,v 1.6.2.6 2000/06/05 21:20:57 mike Exp $".
+// End of "$Id: Fl_Tabs.cxx,v 1.6.2.7 2000/08/12 08:42:12 spitzak Exp $".
//