diff options
author | Jorge Arellano Cid <jcid@dillo.org> | 2011-08-05 09:28:26 -0400 |
---|---|---|
committer | Jorge Arellano Cid <jcid@dillo.org> | 2011-08-05 09:28:26 -0400 |
commit | 97fcaa47455240d4ae2c6b4a254e4d3cbccd110e (patch) | |
tree | 2c3e7f9f503e2c505bd34236d4135a4d45dda8fe /src/uicmd.cc | |
parent | d27ee4a09a9c0dd8a994eb3ac49cbacc7017e556 (diff) |
Fix resize for the corner case of starting dillo in a tiny window
FLTK has no problem in resizing from a "fitting" size into a "compressed" one,
but if it starts compressed, things go wild.
Diffstat (limited to 'src/uicmd.cc')
-rw-r--r-- | src/uicmd.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/uicmd.cc b/src/uicmd.cc index 864113d6..c7bb5a8a 100644 --- a/src/uicmd.cc +++ b/src/uicmd.cc @@ -210,12 +210,16 @@ UI *CustTabs::add_new_tab(UI *old_ui, int focus) Wizard->resize(0,ctab_h,Wizard->w(),window()->h()-ctab_h); resize(0,0,window()->w(),ctab_h); // tabbar CloseBtn->show(); + child(0)->size(tab_w,ctab_h); child(0)->show(); // first tab button window()->init_sizes(); } + /* The UI is constructed in a comfortable fitting size, and then resized + * so FLTK doesn't get confused later with even smaller dimensions! */ current(0); - UI *new_ui = new UI(0,ctab_h,Wizard->w(),Wizard->h(),0,old_ui); + UI *new_ui = new UI(0,0,UI_MIN_W,UI_MIN_H,0,old_ui); + new_ui->resize(0,ctab_h,Wizard->w(),Wizard->h()); new_ui->tabs(this); Wizard->add(new_ui); new_ui->show(); @@ -276,6 +280,7 @@ void CustTabs::remove_tab(UI *ui) // hide tabbar ctab_h = 1; CloseBtn->hide(); + child(0)->size(0,0); child(0)->hide(); // first tab button resize(0,0,window()->w(),ctab_h); // tabbar Wizard->resize(0,ctab_h,Wizard->w(),window()->h()-ctab_h); |