diff options
author | Jorge Arellano Cid <jcid@dillo.org> | 2011-08-05 09:28:29 -0400 |
---|---|---|
committer | Jorge Arellano Cid <jcid@dillo.org> | 2011-08-05 09:28:29 -0400 |
commit | 4a021ae7d68a7b1701a6567ad14feea90b6a833f (patch) | |
tree | 13a2d9d8da8c3b95aeea62c34660d97d3b605079 /src/ui.hh | |
parent | 97fcaa47455240d4ae2c6b4a254e4d3cbccd110e (diff) |
Fix: Don't confuse FLTK when tabs overflow.
When tabs overflow width, FLTK starts resizing the last tab label. This
patch handles the case more gracefully.
Diffstat (limited to 'src/ui.hh')
-rw-r--r-- | src/ui.hh | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -48,6 +48,7 @@ class CustTabs; * The resizable child get's the remaining space. */ class CustGroupHorizontal : public Fl_Group { + Fl_Widget *rsz; public: CustGroupHorizontal(int x,int y,int w ,int h,const char *l = 0) : Fl_Group(x,y,w,h,l) { }; @@ -57,13 +58,24 @@ public: int sum = 0, _x = x(); int children_ = children(); + if (resizable()) + rsz = resizable(); + for (int i=0; i < children_; i++) if (a[i] != resizable() && a[i]->visible()) sum += a[i]->w(); for (int i=0; i < children_; i++) { - if (a[i] == resizable()) { - a[i]->resize(_x, y(), w() - sum, h()); + if (a[i] == rsz) { + if (w() > sum) { + a[i]->resize(_x, y(), w()-sum, h()); + if (!resizable()) + resizable(rsz); + } else { + /* widgets overflow width */ + a[i]->resize(_x, y(), 0, h()); + resizable(NULL); + } } else { a[i]->resize(_x, y(), a[i]->w(), h()); } |