diff --git a/Source/Core/DolphinWX/InputConfigDiag.cpp b/Source/Core/DolphinWX/InputConfigDiag.cpp index 62efa38430..14a0068cc9 100644 --- a/Source/Core/DolphinWX/InputConfigDiag.cpp +++ b/Source/Core/DolphinWX/InputConfigDiag.cpp @@ -202,10 +202,15 @@ void InputConfigDialog::UpdateControlReferences() } } -void InputConfigDialog::ClickSave(wxCommandEvent& event) +void InputConfigDialog::OnClose(wxCloseEvent& event) { m_config.SaveConfig(); - event.Skip(); + EndModal(wxID_OK); +} + +void InputConfigDialog::OnCloseButton(wxCommandEvent& event) +{ + Close(); } int ControlDialog::GetRangeSliderValue() const @@ -1097,11 +1102,12 @@ InputConfigDialog::InputConfigDialog(wxWindow* const parent, InputConfig& config UpdateDeviceComboBox(); UpdateProfileComboBox(); - Bind(wxEVT_BUTTON, &InputConfigDialog::ClickSave, this, wxID_OK); + Bind(wxEVT_CLOSE_WINDOW, &InputConfigDialog::OnClose, this); + Bind(wxEVT_BUTTON, &InputConfigDialog::OnCloseButton, this, wxID_CLOSE); wxBoxSizer* const szr = new wxBoxSizer(wxVERTICAL); szr->Add(m_pad_notebook, 0, wxEXPAND | wxTOP | wxLEFT | wxRIGHT, 5); - szr->Add(CreateButtonSizer(wxOK | wxCANCEL | wxNO_DEFAULT), 0, wxEXPAND | wxALL, 5); + szr->Add(CreateButtonSizer(wxCLOSE), 0, wxEXPAND | wxALL, 5); SetLayoutAdaptationMode(wxDIALOG_ADAPTATION_MODE_ENABLED); SetSizerAndFit(szr); diff --git a/Source/Core/DolphinWX/InputConfigDiag.h b/Source/Core/DolphinWX/InputConfigDiag.h index 4489099eee..1db88b284c 100644 --- a/Source/Core/DolphinWX/InputConfigDiag.h +++ b/Source/Core/DolphinWX/InputConfigDiag.h @@ -252,7 +252,8 @@ public: InputConfigDialog(wxWindow* const parent, InputConfig& config, const wxString& name, const int tab_num = 0); - void ClickSave(wxCommandEvent& event); + void OnClose(wxCloseEvent& event); + void OnCloseButton(wxCommandEvent& event); void UpdateDeviceComboBox(); void UpdateProfileComboBox();