diff --git a/src/toolbars/DeviceToolBar.h b/src/toolbars/DeviceToolBar.h index 8299a6b8a..b49f3c0fe 100644 --- a/src/toolbars/DeviceToolBar.h +++ b/src/toolbars/DeviceToolBar.h @@ -56,6 +56,7 @@ class DeviceToolBar:public ToolBar { /// When the prefs don't exist this value is used. /// It should be small enough to work on tiny screens int GetInitialWidth() {return 520;} + virtual int GetMinToolbarWidth() {return 200;} private: int ChangeHost(); void FillHostDevices(); diff --git a/src/toolbars/ToolBar.cpp b/src/toolbars/ToolBar.cpp index 1659ce375..f45e8d833 100644 --- a/src/toolbars/ToolBar.cpp +++ b/src/toolbars/ToolBar.cpp @@ -265,11 +265,16 @@ void ToolBar::ReCreateButtons() // Set the true AND minimum sizes and do final layout if(IsResizable()) - {// EM: allows narrow Meter Toolbar - sz.SetWidth(GetInitialWidth()); + { + sz.SetWidth(GetMinToolbarWidth()); SetMinSize(sz); + sz.SetWidth(GetInitialWidth()); + SetSize(sz); + } + else + { + SetInitialSize(sz); } - SetInitialSize(sz); Layout(); } diff --git a/src/toolbars/ToolBar.h b/src/toolbars/ToolBar.h index f8c40796e..3355d002f 100644 --- a/src/toolbars/ToolBar.h +++ b/src/toolbars/ToolBar.h @@ -102,6 +102,7 @@ class ToolBar:public wxPanel /// Resizable toolbars should implement this. virtual int GetInitialWidth() {return -1;} + virtual int GetMinToolbarWidth() {return GetInitialWidth();} protected: AButton *MakeButton(teBmps eUp,