From bf6584995a80375b5065bc4519b95d108f65cef7 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Wed, 11 Jan 2023 16:03:16 +0100 Subject: [PATCH] MSW specific: Fixed disabling of filament comboboxes after load from 3mf --- src/slic3r/GUI/Plater.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index b55f6299a3..6e65371ed1 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -983,20 +983,24 @@ Sidebar::Sidebar(Plater *parent) Sidebar::~Sidebar() {} -void Sidebar::init_filament_combo(PlaterPresetComboBox **combo, const int extr_idx) { +void Sidebar::init_filament_combo(PlaterPresetComboBox** combo, const int extr_idx) +{ *combo = new PlaterPresetComboBox(p->presets_panel, Slic3r::Preset::TYPE_FILAMENT); -// # copy icons from first choice -// $choice->SetItemBitmap($_, $choices->[0]->GetItemBitmap($_)) for 0..$#presets; - (*combo)->set_extruder_idx(extr_idx); +#ifdef __WXMSW__ + // When project is loading and progress dialog is processing + // In this case mainframe is marked as a disabled, that is why new created filament preset comboboxes are disabled + if (wxWindow* mf = wxGetApp().mainframe; mf && !mf->IsThisEnabled()) + mf->Enable(); +#endif //__WXMSW__ + auto combo_and_btn_sizer = new wxBoxSizer(wxHORIZONTAL); combo_and_btn_sizer->Add(*combo, 1, wxEXPAND); combo_and_btn_sizer->Add((*combo)->edit_btn, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, int(0.3*wxGetApp().em_unit())); - auto /***/sizer_filaments = this->p->sizer_filaments; - sizer_filaments->Add(combo_and_btn_sizer, 1, wxEXPAND | + this->p->sizer_filaments->Add(combo_and_btn_sizer, 1, wxEXPAND | #ifdef __WXGTK3__ wxRIGHT, int(0.5 * wxGetApp().em_unit())); #else