diff --git a/src/slic3r/GUI/Field.cpp b/src/slic3r/GUI/Field.cpp index bedb3718e..d3fef44d3 100644 --- a/src/slic3r/GUI/Field.cpp +++ b/src/slic3r/GUI/Field.cpp @@ -743,9 +743,7 @@ boost::any& CheckBox::get_value() void CheckBox::msw_rescale() { Field::msw_rescale(); - - wxCheckBox* field = dynamic_cast(window); - field->SetMinSize(wxSize(-1, int(1.5f*field->GetFont().GetPixelSize().y +0.5f))); + window->SetInitialSize(window->GetBestSize()); } diff --git a/src/slic3r/GUI/GUI_ObjectManipulation.cpp b/src/slic3r/GUI/GUI_ObjectManipulation.cpp index a2d687db0..aea771844 100644 --- a/src/slic3r/GUI/GUI_ObjectManipulation.cpp +++ b/src/slic3r/GUI/GUI_ObjectManipulation.cpp @@ -1409,7 +1409,7 @@ void ObjectManipulation::msw_rescale() editor->msw_rescale(); // rescale "inches" checkbox - m_check_inch->SetMinSize(wxSize(-1, int(1.5f * m_check_inch->GetFont().GetPixelSize().y + 0.5f))); + m_check_inch->SetInitialSize(m_check_inch->GetBestSize()); get_og()->msw_rescale(); } diff --git a/src/slic3r/GUI/OG_CustomCtrl.cpp b/src/slic3r/GUI/OG_CustomCtrl.cpp index 6c088aa79..0c845fc68 100644 --- a/src/slic3r/GUI/OG_CustomCtrl.cpp +++ b/src/slic3r/GUI/OG_CustomCtrl.cpp @@ -386,6 +386,8 @@ void OG_CustomCtrl::correct_widgets_position(wxSizer* widget, const Line& line, void OG_CustomCtrl::init_max_win_width() { + m_max_win_width = 0; + if (opt_group->ctrl_horiz_alignment == wxALIGN_RIGHT && m_max_win_width == 0) for (CtrlLine& line : ctrl_lines) { if (int max_win_width = line.get_max_win_width(); @@ -419,7 +421,7 @@ void OG_CustomCtrl::msw_rescale() m_bmp_mode_sz = get_bitmap_size(get_bmp_bundle("mode_simple", wxOSX ? 10 : 12), this); m_bmp_blinking_sz = get_bitmap_size(get_bmp_bundle("search_blink"), this); - m_max_win_width = 0; + init_max_win_width(); wxCoord v_pos = 0; for (CtrlLine& line : ctrl_lines) { diff --git a/src/slic3r/GUI/Preferences.cpp b/src/slic3r/GUI/Preferences.cpp index 9e526cc3d..b04b0a3f1 100644 --- a/src/slic3r/GUI/Preferences.cpp +++ b/src/slic3r/GUI/Preferences.cpp @@ -756,12 +756,8 @@ void PreferencesDialog::msw_rescale() { for (ConfigOptionsGroup* og : this->optgroups()) og->msw_rescale(); -#ifdef _WIN32 - m_optgroup_dark_mode->msw_rescale(); -#endif //_WIN32 -#if ENABLE_ENVIRONMENT_MAP - m_optgroup_render->msw_rescale(); -#endif // ENABLE_ENVIRONMENT_MAP + + update_ctrls_alignment(); msw_buttons_rescale(this, em_unit(), { wxID_OK, wxID_CANCEL }); diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 47a06ab2a..d5b909f37 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -2156,6 +2156,16 @@ void TabFilament::clear_pages() m_cooling_description_line = nullptr; } +void TabFilament::msw_rescale() +{ + for (const auto& over_opt : m_overrides_options) { + wxWindow* win = over_opt.second; + win->SetInitialSize(win->GetBestSize()); + } + + Tab::msw_rescale(); +} + wxSizer* Tab::description_line_widget(wxWindow* parent, ogStaticText* *StaticText, wxString text /*= wxEmptyString*/) { *StaticText = new ogStaticText(parent, text); diff --git a/src/slic3r/GUI/Tab.hpp b/src/slic3r/GUI/Tab.hpp index 5adeb278a..83ece74e8 100644 --- a/src/slic3r/GUI/Tab.hpp +++ b/src/slic3r/GUI/Tab.hpp @@ -449,6 +449,7 @@ public: void toggle_options() override; void update() override; void clear_pages() override; + void msw_rescale() override; bool supports_printer_technology(const PrinterTechnology tech) const override { return tech == ptFFF; } };