summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ui.hh5
-rw-r--r--src/uicmd.cc7
2 files changed, 11 insertions, 1 deletions
diff --git a/src/ui.hh b/src/ui.hh
index 68b7a972..57611f86 100644
--- a/src/ui.hh
+++ b/src/ui.hh
@@ -31,6 +31,11 @@ typedef enum {
UI_HIDDEN = 1
} UIPanelmode;
+
+// Min size to fit the full UI
+#define UI_MIN_W 600
+#define UI_MIN_H 200
+
// Private classes
class CustProgressBox;
class CustTabs;
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);