mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-07 06:57:36 -06:00
Fix new project crash on Windows if multi-extruder printer profile is edited (#9600)
Fix new project crash on Windows if profile is edited
This commit is contained in:
parent
1a5b238ba4
commit
3b658cba3b
2 changed files with 8 additions and 4 deletions
|
@ -590,7 +590,7 @@ Slic3r::GUI::PageShp Tab::add_options_page(const wxString& title, const std::str
|
||||||
}
|
}
|
||||||
// Initialize the page.
|
// Initialize the page.
|
||||||
//BBS: GUI refactor
|
//BBS: GUI refactor
|
||||||
PageShp page(new Page(m_page_view, title, icon_idx, this));
|
PageShp page = std::make_shared<Page>(m_page_view, title, icon_idx, this);
|
||||||
// page->SetBackgroundStyle(wxBG_STYLE_SYSTEM);
|
// page->SetBackgroundStyle(wxBG_STYLE_SYSTEM);
|
||||||
#ifdef __WINDOWS__
|
#ifdef __WINDOWS__
|
||||||
// page->SetDoubleBuffered(true);
|
// page->SetDoubleBuffered(true);
|
||||||
|
@ -6263,8 +6263,12 @@ void Page::update_visibility(ConfigOptionMode mode, bool update_contolls_visibil
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
if (!m_show) return;
|
if (!m_show) return;
|
||||||
// BBS: fix field control position
|
// BBS: fix field control position
|
||||||
wxTheApp->CallAfter([this]() {
|
wxTheApp->CallAfter([wp=std::weak_ptr<Page>(shared_from_this())]() {
|
||||||
for (auto group : m_optgroups) {
|
auto page = wp.lock();
|
||||||
|
if (!page)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (auto group : page->m_optgroups) {
|
||||||
if (group->custom_ctrl) group->custom_ctrl->fixup_items_positions();
|
if (group->custom_ctrl) group->custom_ctrl->fixup_items_positions();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -57,7 +57,7 @@ class OG_CustomCtrl;
|
||||||
// Single Tab page containing a{ vsizer } of{ optgroups }
|
// Single Tab page containing a{ vsizer } of{ optgroups }
|
||||||
// package Slic3r::GUI::Tab::Page;
|
// package Slic3r::GUI::Tab::Page;
|
||||||
using ConfigOptionsGroupShp = std::shared_ptr<ConfigOptionsGroup>;
|
using ConfigOptionsGroupShp = std::shared_ptr<ConfigOptionsGroup>;
|
||||||
class Page// : public wxScrolledWindow
|
class Page: public std::enable_shared_from_this<Page>// : public wxScrolledWindow
|
||||||
{
|
{
|
||||||
//BBS: GUI refactor
|
//BBS: GUI refactor
|
||||||
wxPanel* m_tab_owner;
|
wxPanel* m_tab_owner;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue