FIX: button handle key event

Change-Id: If3ecd2356e516105c2054c9b85a122f3ccc72d91
This commit is contained in:
chunmao.guo 2022-07-29 11:18:33 +08:00 committed by Lane.Wei
parent 6c4b1f79da
commit a74fb14613
6 changed files with 59 additions and 9 deletions

View file

@ -955,7 +955,7 @@ void UnsavedChangesDialog::build(Preset::Type type, PresetCollection *dependent_
(*btn)->SetMinSize(UNSAVE_CHANGE_DIALOG_BUTTON_SIZE);
(*btn)->SetCornerRadius(12);
(*btn)->Bind(wxEVT_LEFT_DOWN, [this, close_act, dependent_presets](wxEvent &) {
(*btn)->Bind(wxEVT_BUTTON, [this, close_act, dependent_presets](wxEvent &) {
bool save_names_and_types = close_act == Action::Save || (close_act == Action::Transfer && ActionButtons::KEEP & m_buttons);
if (save_names_and_types && !save(dependent_presets, close_act == Action::Save)) return;
close(close_act);