From 37c26b77ee63a784e4a881991f33cddf02e0922b Mon Sep 17 00:00:00 2001 From: Megamouse Date: Tue, 25 Jul 2017 23:29:40 +0200 Subject: [PATCH] settings_dialog: make size consistent --- rpcs3/rpcs3qt/settings_dialog.cpp | 14 ++++++++++++-- rpcs3/rpcs3qt/settings_dialog.h | 2 ++ rpcs3/rpcs3qt/settings_dialog.ui | 32 +++++++++++++++---------------- 3 files changed, 30 insertions(+), 18 deletions(-) diff --git a/rpcs3/rpcs3qt/settings_dialog.cpp b/rpcs3/rpcs3qt/settings_dialog.cpp index 40048bf74b..8f68c41d47 100644 --- a/rpcs3/rpcs3qt/settings_dialog.cpp +++ b/rpcs3/rpcs3qt/settings_dialog.cpp @@ -26,12 +26,11 @@ inline std::string sstr(const QString& _in) { return _in.toUtf8().toStdString(); inline std::string sstr(const QVariant& _in) { return sstr(_in.toString()); } settings_dialog::settings_dialog(std::shared_ptr xSettings, const Render_Creator& r_Creator, const int& tabIndex, QWidget *parent, const GameInfo* game) - : QDialog(parent), xgui_settings(xSettings), ui(new Ui::settings_dialog) + : QDialog(parent), xgui_settings(xSettings), ui(new Ui::settings_dialog), m_tab_Index(tabIndex) { ui->setupUi(this); ui->cancelButton->setDefault(true); ui->tabWidget->setUsesScrollButtons(false); - ui->tabWidget->setCurrentIndex(tabIndex); bool showDebugTab = xgui_settings->GetValue(GUI::m_showDebugTab).toBool(); xgui_settings->SetValue(GUI::m_showDebugTab, showDebugTab); @@ -945,3 +944,14 @@ void settings_dialog::OnApplyStylesheet() xgui_settings->SetValue(GUI::m_currentStylesheet, ui->combo_stylesheets->currentText()); Q_EMIT GuiStylesheetRequest(xgui_settings->GetCurrentStylesheetPath()); } + +int settings_dialog::exec() +{ + show(); + for (int i = 0; i < ui->tabWidget->count(); i++) + { + ui->tabWidget->setCurrentIndex(i); + } + ui->tabWidget->setCurrentIndex(m_tab_Index); + return QDialog::exec(); +} diff --git a/rpcs3/rpcs3qt/settings_dialog.h b/rpcs3/rpcs3qt/settings_dialog.h index 86a4a67e8e..4d4a71a1c9 100644 --- a/rpcs3/rpcs3qt/settings_dialog.h +++ b/rpcs3/rpcs3qt/settings_dialog.h @@ -20,6 +20,7 @@ class settings_dialog : public QDialog public: explicit settings_dialog(std::shared_ptr xSettings, const Render_Creator& r_Creator, const int& tabIndex = 0, QWidget *parent = 0, const GameInfo *game = nullptr); + int exec(); Q_SIGNALS: void GuiSettingsSyncRequest(); void GuiStylesheetRequest(const QString& path); @@ -40,6 +41,7 @@ private: bool m_isD3D12 = false; bool m_isVulkan = false; + int m_tab_Index; Ui::settings_dialog *ui; std::shared_ptr xgui_settings; }; diff --git a/rpcs3/rpcs3qt/settings_dialog.ui b/rpcs3/rpcs3qt/settings_dialog.ui index 4c2a39cbc9..9b2d0dcf46 100644 --- a/rpcs3/rpcs3qt/settings_dialog.ui +++ b/rpcs3/rpcs3qt/settings_dialog.ui @@ -7,7 +7,7 @@ 0 0 550 - 646 + 604 @@ -163,19 +163,6 @@ - - - - Qt::Vertical - - - - 20 - 40 - - - - @@ -253,7 +240,7 @@ - + 0 0 @@ -264,6 +251,12 @@ + + + 0 + 0 + + QAbstractItemView::ExtendedSelection @@ -282,7 +275,14 @@ - + + + + 0 + 0 + + +