mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2026-03-04 17:44:46 -07:00
Fix filament override checkbox not update after click (#11517)
* Fix filament override checkbox not update after click * Event args should be references otherwise `e.skip()` won't work * Fix bool option override
This commit is contained in:
parent
8e9daad2e8
commit
e69daea3c3
2 changed files with 19 additions and 12 deletions
|
|
@ -108,7 +108,12 @@ void change_opt_value(DynamicPrintConfig& config, const t_config_option_key& opt
|
|||
try{
|
||||
|
||||
if (config.def()->get(opt_key)->type == coBools && config.def()->get(opt_key)->nullable) {
|
||||
auto vec_new = std::make_unique<ConfigOptionBoolsNullable>(1, boost::any_cast<unsigned char>(value) );
|
||||
const auto v = boost::any_cast<unsigned char>(value);
|
||||
auto vec_new = std::make_unique<ConfigOptionBoolsNullable>(1, v);
|
||||
if (v == ConfigOptionBoolsNullable::nil_value()) {
|
||||
vec_new->set_at_to_nil(0);
|
||||
}
|
||||
|
||||
config.option<ConfigOptionBoolsNullable>(opt_key)->set_at(vec_new.get(), opt_index, 0);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -353,9 +353,9 @@ void Tab::create_preset_tab()
|
|||
|
||||
});
|
||||
|
||||
m_undo_btn->Bind(wxEVT_BUTTON, ([this](wxCommandEvent) { on_roll_back_value(); }));
|
||||
//m_undo_to_sys_btn->Bind(wxEVT_BUTTON, ([this](wxCommandEvent) { on_roll_back_value(true); }));
|
||||
/* m_search_btn->Bind(wxEVT_BUTTON, [](wxCommandEvent) { wxGetApp().plater()->search(false); });*/
|
||||
m_undo_btn->Bind(wxEVT_BUTTON, ([this](wxCommandEvent&) { on_roll_back_value(); }));
|
||||
//m_undo_to_sys_btn->Bind(wxEVT_BUTTON, ([this](wxCommandEvent&) { on_roll_back_value(true); }));
|
||||
/* m_search_btn->Bind(wxEVT_BUTTON, [](wxCommandEvent&) { wxGetApp().plater()->search(false); });*/
|
||||
|
||||
// Colors for ui "decoration"
|
||||
m_sys_label_clr = wxGetApp().get_label_clr_sys();
|
||||
|
|
@ -540,14 +540,14 @@ void Tab::create_preset_tab()
|
|||
m_hsizer->Add(m_page_view, 1, wxEXPAND | wxLEFT, 5);*/
|
||||
|
||||
//m_btn_compare_preset->Bind(wxEVT_BUTTON, ([this](wxCommandEvent e) { compare_preset(); }));
|
||||
m_btn_save_preset->Bind(wxEVT_BUTTON, ([this](wxCommandEvent e) { save_preset(); }));
|
||||
m_btn_delete_preset->Bind(wxEVT_BUTTON, ([this](wxCommandEvent e) { delete_preset(); }));
|
||||
m_btn_save_preset->Bind(wxEVT_BUTTON, ([this](wxCommandEvent& e) { save_preset(); }));
|
||||
m_btn_delete_preset->Bind(wxEVT_BUTTON, ([this](wxCommandEvent& e) { delete_preset(); }));
|
||||
/*m_btn_hide_incompatible_presets->Bind(wxEVT_BUTTON, ([this](wxCommandEvent e) {
|
||||
toggle_show_hide_incompatible();
|
||||
}));
|
||||
|
||||
if (m_btn_edit_ph_printer)
|
||||
m_btn_edit_ph_printer->Bind(wxEVT_BUTTON, [this](wxCommandEvent e) {
|
||||
m_btn_edit_ph_printer->Bind(wxEVT_BUTTON, [this](wxCommandEvent& e) {
|
||||
if (m_preset_bundle->physical_printers.has_selection())
|
||||
m_presets_choice->edit_physical_printer();
|
||||
else
|
||||
|
|
@ -3581,6 +3581,7 @@ void TabFilament::add_filament_overrides_page()
|
|||
}
|
||||
}
|
||||
}
|
||||
evt.Skip();
|
||||
}, check_box->GetId());
|
||||
|
||||
m_overrides_options[opt_key] = check_box;
|
||||
|
|
@ -3682,6 +3683,7 @@ void TabFilament::add_filament_overrides_page()
|
|||
}
|
||||
}
|
||||
}
|
||||
evt.Skip();
|
||||
}, check_box->GetId());
|
||||
|
||||
m_overrides_options[opt_key] = check_box;
|
||||
|
|
@ -6698,18 +6700,18 @@ wxSizer* Tab::compatible_widget_create(wxWindow* parent, PresetDependencies &dep
|
|||
this->update_changed_ui();
|
||||
};
|
||||
|
||||
deps.checkbox_title->Bind(wxEVT_LEFT_DOWN,([this, &deps, on_toggle](wxMouseEvent e) {
|
||||
deps.checkbox_title->Bind(wxEVT_LEFT_DOWN,([this, &deps, on_toggle](wxMouseEvent& e) {
|
||||
if (e.GetEventType() == wxEVT_LEFT_DCLICK) return;
|
||||
on_toggle(!deps.checkbox->GetValue());
|
||||
e.Skip();
|
||||
}));
|
||||
|
||||
deps.checkbox_title->Bind(wxEVT_LEFT_DCLICK,([this, &deps, on_toggle](wxMouseEvent e) {
|
||||
deps.checkbox_title->Bind(wxEVT_LEFT_DCLICK,([this, &deps, on_toggle](wxMouseEvent& e) {
|
||||
on_toggle(!deps.checkbox->GetValue());
|
||||
e.Skip();
|
||||
}));
|
||||
|
||||
deps.checkbox->Bind(wxEVT_TOGGLEBUTTON, ([this, on_toggle](wxCommandEvent e) {
|
||||
deps.checkbox->Bind(wxEVT_TOGGLEBUTTON, ([this, on_toggle](wxCommandEvent& e) {
|
||||
on_toggle(e.IsChecked());
|
||||
e.Skip();
|
||||
}), deps.checkbox->GetId());
|
||||
|
|
@ -6734,7 +6736,7 @@ wxSizer* Tab::compatible_widget_create(wxWindow* parent, PresetDependencies &dep
|
|||
}
|
||||
*/
|
||||
|
||||
deps.btn->Bind(wxEVT_BUTTON, ([this, parent, &deps](wxCommandEvent e)
|
||||
deps.btn->Bind(wxEVT_BUTTON, ([this, parent, &deps](wxCommandEvent& e)
|
||||
{
|
||||
// Collect names of non-default non-external profiles.
|
||||
PrinterTechnology printer_technology = m_preset_bundle->printers.get_edited_preset().printer_technology();
|
||||
|
|
@ -6816,7 +6818,7 @@ wxSizer* TabPrinter::create_bed_shape_widget(wxWindow* parent)
|
|||
auto sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
sizer->Add(btn, 0, wxALIGN_CENTER_VERTICAL);
|
||||
|
||||
btn->Bind(wxEVT_BUTTON, ([this](wxCommandEvent e) {
|
||||
btn->Bind(wxEVT_BUTTON, ([this](wxCommandEvent& e) {
|
||||
bool is_configed_by_BBL = PresetUtils::system_printer_bed_model(m_preset_bundle->printers.get_edited_preset()).size() > 0;
|
||||
BedShapeDialog dlg(this);
|
||||
dlg.build_dialog(m_config->option<ConfigOptionPoints>("printable_area")->values,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue