diff --git a/rpcs3/rpcs3qt/settings_dialog.cpp b/rpcs3/rpcs3qt/settings_dialog.cpp index a31527ac2c..1fa7a1e46a 100644 --- a/rpcs3/rpcs3qt/settings_dialog.cpp +++ b/rpcs3/rpcs3qt/settings_dialog.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -37,7 +38,7 @@ settings_dialog::settings_dialog(std::shared_ptr guiSettings, std: : QDialog(parent), xgui_settings(guiSettings), xemu_settings(emuSettings), ui(new Ui::settings_dialog), m_tab_Index(tabIndex) { ui->setupUi(this); - ui->cancelButton->setFocus(); + ui->buttonBox->button(QDialogButtonBox::StandardButton::Close)->setFocus(); ui->tab_widget_settings->setUsesScrollButtons(false); ui->tab_widget_settings->tabBar()->setObjectName("tab_bar_settings"); @@ -117,7 +118,7 @@ settings_dialog::settings_dialog(std::shared_ptr guiSettings, std: m_discord_state = xgui_settings->GetValue(gui::m_discordState).toString(); // Various connects - connect(ui->okButton, &QAbstractButton::clicked, [=, use_discord_old = m_use_discord, discord_state_old = m_discord_state] + connect(ui->buttonBox, &QDialogButtonBox::accepted, [=, use_discord_old = m_use_discord, discord_state_old = m_discord_state] { std::set selectedlle; for (int i = 0; illeList->count(); ++i) @@ -157,11 +158,11 @@ settings_dialog::settings_dialog(std::shared_ptr guiSettings, std: #endif }); - connect(ui->cancelButton, &QAbstractButton::clicked, this, &QWidget::close); + connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &QWidget::close); connect(ui->tab_widget_settings, &QTabWidget::currentChanged, [=]() { - ui->cancelButton->setFocus(); + ui->buttonBox->button(QDialogButtonBox::StandardButton::Close)->setFocus(); }); // _____ _____ _ _ _______ _ @@ -1392,7 +1393,7 @@ settings_dialog::settings_dialog(std::shared_ptr guiSettings, std: } }; - connect(ui->okButton, &QAbstractButton::clicked, [=]() + connect(ui->buttonBox, &QDialogButtonBox::accepted, [=]() { ApplyGuiOptions(); }); diff --git a/rpcs3/rpcs3qt/settings_dialog.ui b/rpcs3/rpcs3qt/settings_dialog.ui index 2a4fc52f74..fd31461cf3 100644 --- a/rpcs3/rpcs3qt/settings_dialog.ui +++ b/rpcs3/rpcs3qt/settings_dialog.ui @@ -2829,41 +2829,11 @@ - - - - - Save - - - false - - - - - - - Close - - - false - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - + + + QDialogButtonBox::Close|QDialogButtonBox::Save + +