From 5eab933fc2d51c25480eeb2370f88307dd2c2dc9 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Fri, 24 May 2019 12:19:06 +0200 Subject: [PATCH] Workaround for #2331 --- src/slic3r/GUI/Tab.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 5777cbc0f..6cd270e5b 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -2234,6 +2234,18 @@ void TabPrinter::build_unregular_pages() * */ Freeze(); +#ifdef __WXMSW__ + /* Workaround for correct layout of controls inside the created page: + * In some _strange_ way we should we should imitate page resizing. + */ + auto layout_page = [this](PageShp page) + { + const wxSize& sz = page->GetSize(); + page->SetSize(sz.x + 1, sz.y + 1); + page->SetSize(sz); + }; +#endif //__WXMSW__ + // Add/delete Kinematics page according to is_marlin_flavor size_t existed_page = 0; for (int i = n_before_extruders; i < m_pages.size(); ++i) // first make sure it's not there already @@ -2247,6 +2259,9 @@ void TabPrinter::build_unregular_pages() if (existed_page < n_before_extruders && is_marlin_flavor) { auto page = build_kinematics_page(); +#ifdef __WXMSW__ + layout_page(page); +#endif m_pages.insert(m_pages.begin() + n_before_extruders, page); } @@ -2318,6 +2333,10 @@ void TabPrinter::build_unregular_pages() optgroup = page->new_optgroup(_(L("Preview"))); optgroup->append_single_option_line("extruder_colour", extruder_idx); + +#ifdef __WXMSW__ + layout_page(page); +#endif } // # remove extra pages