diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ui.hh | 16 | ||||
-rw-r--r-- | src/uicmd.cc | 5 |
2 files changed, 19 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()); } diff --git a/src/uicmd.cc b/src/uicmd.cc index c7bb5a8a..88dedd96 100644 --- a/src/uicmd.cc +++ b/src/uicmd.cc @@ -194,6 +194,11 @@ int CustTabs::handle(int e) a_Timeout_add(0.0, a_UIcmd_close_all_bw, NULL); ret = 1; } + } else if (e == FL_ENTER) { + /* WORKAROUND: when tabs overflow width, the resizable is set to NULL, + * and the close button loses its position. This call fixes it. */ + if (!resizable()) + rearrange(); } return (ret) ? ret : CustGroupHorizontal::handle(e); |