First experiment to fix layouts on hdpi
This commit is contained in:
parent
1605c23e25
commit
ba6206ab62
@ -246,6 +246,7 @@ void GUI_App::init_fonts()
|
||||
{
|
||||
m_small_font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
|
||||
m_bold_font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).Bold();
|
||||
|
||||
#ifdef __WXMAC__
|
||||
m_small_font.SetPointSize(11);
|
||||
m_bold_font.SetPointSize(13);
|
||||
|
@ -80,6 +80,8 @@ class GUI_App : public wxApp
|
||||
wxFont m_small_font;
|
||||
wxFont m_bold_font;
|
||||
|
||||
size_t m_width_unit;
|
||||
|
||||
wxLocale* m_wxLocale{ nullptr };
|
||||
|
||||
#if ENABLE_IMGUI
|
||||
@ -106,6 +108,8 @@ public:
|
||||
|
||||
const wxFont& small_font() { return m_small_font; }
|
||||
const wxFont& bold_font() { return m_bold_font; }
|
||||
size_t width_unit() const { return m_width_unit; }
|
||||
void set_width_unit(const size_t width_unit) { m_width_unit = width_unit; }
|
||||
|
||||
void recreate_GUI();
|
||||
void system_info();
|
||||
|
@ -53,6 +53,12 @@ wxFrame(NULL, wxID_ANY, SLIC3R_BUILD, wxDefaultPosition, wxDefaultSize, wxDEFAUL
|
||||
SLIC3R_VERSION +
|
||||
_(L(" - Remember to check for updates at http://github.com/prusa3d/slic3r/releases")));
|
||||
|
||||
|
||||
// initialize default width_unit according to the width of the one symbol ("x") of the current system font
|
||||
const wxString x_str = "x";
|
||||
const wxSize size = GetTextExtent(x_str);
|
||||
wxGetApp().set_width_unit(size.x);
|
||||
|
||||
// initialize tabpanel and menubar
|
||||
init_tabpanel();
|
||||
init_menubar();
|
||||
|
@ -213,7 +213,7 @@ void SlicedInfo::SetTextAndShow(SlisedInfoIdx idx, const wxString& text, const w
|
||||
}
|
||||
|
||||
PresetComboBox::PresetComboBox(wxWindow *parent, Preset::Type preset_type) :
|
||||
wxBitmapComboBox(parent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200,-1), 0, nullptr, wxCB_READONLY),
|
||||
wxBitmapComboBox(parent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(30 * wxGetApp().width_unit()/*200*/, -1), 0, nullptr, wxCB_READONLY),
|
||||
preset_type(preset_type),
|
||||
last_selected(wxNOT_FOUND)
|
||||
{
|
||||
@ -519,7 +519,7 @@ void Sidebar::priv::show_preset_comboboxes()
|
||||
Sidebar::Sidebar(Plater *parent)
|
||||
: wxPanel(parent), p(new priv(parent))
|
||||
{
|
||||
p->scrolled = new wxScrolledWindow(this, wxID_ANY, wxDefaultPosition, wxSize(400, -1));
|
||||
p->scrolled = new wxScrolledWindow(this, wxID_ANY, wxDefaultPosition, wxSize(60 * wxGetApp().width_unit()/*400*/, -1));
|
||||
p->scrolled->SetScrollbars(0, 20, 1, 2);
|
||||
|
||||
// Sizer in the scrolled area
|
||||
|
@ -96,7 +96,7 @@ void Tab::create_preset_tab()
|
||||
#endif //__WXOSX__
|
||||
|
||||
// preset chooser
|
||||
m_presets_choice = new wxBitmapComboBox(panel, wxID_ANY, "", wxDefaultPosition, wxSize(270, -1), 0, 0,wxCB_READONLY);
|
||||
m_presets_choice = new wxBitmapComboBox(panel, wxID_ANY, "", wxDefaultPosition, wxSize(40 * wxGetApp().width_unit()/*270*/, -1), 0, 0, wxCB_READONLY);
|
||||
|
||||
auto color = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
|
||||
|
||||
@ -201,7 +201,7 @@ void Tab::create_preset_tab()
|
||||
m_hsizer->Add(m_left_sizer, 0, wxEXPAND | wxLEFT | wxTOP | wxBOTTOM, 3);
|
||||
|
||||
// tree
|
||||
m_treectrl = new wxTreeCtrl(panel, wxID_ANY, wxDefaultPosition, wxSize(185, -1),
|
||||
m_treectrl = new wxTreeCtrl(panel, wxID_ANY, wxDefaultPosition, wxSize(30 * wxGetApp().width_unit()/*185*/, -1),
|
||||
wxTR_NO_BUTTONS | wxTR_HIDE_ROOT | wxTR_SINGLE | wxTR_NO_LINES | wxBORDER_SUNKEN | wxWANTS_CHARS);
|
||||
m_left_sizer->Add(m_treectrl, 1, wxEXPAND);
|
||||
m_icons = new wxImageList(16, 16, true, 1);
|
||||
|
Loading…
Reference in New Issue
Block a user