Set MinSize() in respect to em_unit
This commit is contained in:
parent
710bb66dfc
commit
fe91edc521
1 changed files with 6 additions and 3 deletions
|
@ -56,7 +56,8 @@ wxFrame(NULL, wxID_ANY, SLIC3R_BUILD, wxDefaultPosition, wxDefaultSize, wxDEFAUL
|
||||||
|
|
||||||
// initialize default width_unit according to the width of the one symbol ("x") of the current system font
|
// initialize default width_unit according to the width of the one symbol ("x") of the current system font
|
||||||
const wxSize size = GetTextExtent("m");
|
const wxSize size = GetTextExtent("m");
|
||||||
wxGetApp().set_em_unit(size.x-1);
|
// wxGetApp().set_em_unit(size.x-1);
|
||||||
|
wxGetApp().set_em_unit(std::max<size_t>(10, size.x - 1));
|
||||||
|
|
||||||
// initialize tabpanel and menubar
|
// initialize tabpanel and menubar
|
||||||
init_tabpanel();
|
init_tabpanel();
|
||||||
|
@ -76,12 +77,14 @@ wxFrame(NULL, wxID_ANY, SLIC3R_BUILD, wxDefaultPosition, wxDefaultSize, wxDEFAUL
|
||||||
sizer->SetSizeHints(this);
|
sizer->SetSizeHints(this);
|
||||||
SetSizer(sizer);
|
SetSizer(sizer);
|
||||||
Fit();
|
Fit();
|
||||||
|
|
||||||
|
const wxSize min_size = wxSize(76*wxGetApp().em_unit(), 49*wxGetApp().em_unit());
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
// Using SetMinSize() on Mac messes up the window position in some cases
|
// Using SetMinSize() on Mac messes up the window position in some cases
|
||||||
// cf. https://groups.google.com/forum/#!topic/wx-users/yUKPBBfXWO0
|
// cf. https://groups.google.com/forum/#!topic/wx-users/yUKPBBfXWO0
|
||||||
SetSize(wxSize(760, 490));
|
SetSize(min_size/*wxSize(760, 490)*/);
|
||||||
#else
|
#else
|
||||||
SetMinSize(wxSize(760, 490));
|
SetMinSize(min_size/*wxSize(760, 490)*/);
|
||||||
SetSize(GetMinSize());
|
SetSize(GetMinSize());
|
||||||
#endif
|
#endif
|
||||||
Layout();
|
Layout();
|
||||||
|
|
Loading…
Reference in a new issue