Fix Detach from parent checkbox not updating visually (#15520)

Refresh detach-from-parent checkbox state

Allow the detach checkbox toggle event to propagate to the custom CheckBox control so it refreshes its bitmap after the value changes.
This commit is contained in:
Kiss Lorand
2026-09-04 00:25:21 +03:00
committed by GitHub
parent f92bd81190
commit 6a13cc2ab6

View File

@@ -149,7 +149,10 @@ SavePresetDialog::Item::Item(Preset::Type type, const std::string &suffix, wxBox
// Set initial state (unchecked by default)
detach_checkbox->SetValue(m_detach);
// Bind the checkbox event to update the detach state for this item
detach_checkbox->Bind(wxEVT_TOGGLEBUTTON, [this, detach_checkbox](wxCommandEvent&) { m_detach = detach_checkbox->GetValue(); });
detach_checkbox->Bind(wxEVT_TOGGLEBUTTON, [this, detach_checkbox](wxCommandEvent& event) {
m_detach = detach_checkbox->GetValue();
event.Skip(); // Let CheckBox update its bitmap for the new state.
});
detach_label->SetForegroundColour(wxColour("#363636"));