diff --git a/Source/Core/DolphinQt2/Config/Graphics/GraphicsWindow.cpp b/Source/Core/DolphinQt2/Config/Graphics/GraphicsWindow.cpp index 4b3d920378..3d9b4ac539 100644 --- a/Source/Core/DolphinQt2/Config/Graphics/GraphicsWindow.cpp +++ b/Source/Core/DolphinQt2/Config/Graphics/GraphicsWindow.cpp @@ -43,7 +43,7 @@ void GraphicsWindow::CreateMainLayout() m_button_box = new QDialogButtonBox(QDialogButtonBox::Ok); description_box->setLayout(description_layout); - description_box->setMinimumHeight(230); + description_box->setFixedHeight(230); m_description->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); m_description->setWordWrap(true); @@ -68,14 +68,15 @@ void GraphicsWindow::CreateMainLayout() if (SConfig::GetInstance().m_strVideoBackend != "Software Renderer") { - m_tab_widget->addTab(GetWrappedWidget(m_general_widget, this, 250), tr("General")); - m_tab_widget->addTab(GetWrappedWidget(m_enhancements_widget, this, 250), tr("Enhancements")); - m_tab_widget->addTab(GetWrappedWidget(m_hacks_widget, this, 250), tr("Hacks")); - m_tab_widget->addTab(GetWrappedWidget(m_advanced_widget, this, 250), tr("Advanced")); + m_tab_widget->addTab(GetWrappedWidget(m_general_widget, this, 50, 325), tr("General")); + m_tab_widget->addTab(GetWrappedWidget(m_enhancements_widget, this, 50, 325), + tr("Enhancements")); + m_tab_widget->addTab(GetWrappedWidget(m_hacks_widget, this, 50, 325), tr("Hacks")); + m_tab_widget->addTab(GetWrappedWidget(m_advanced_widget, this, 50, 325), tr("Advanced")); } else { - m_tab_widget->addTab(GetWrappedWidget(m_software_renderer, this, 250), tr("Software Renderer")); + m_tab_widget->addTab(GetWrappedWidget(m_software_renderer, this, 325), tr("Software Renderer")); } setLayout(main_layout); diff --git a/Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp b/Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp index a5c7900d81..660c1b5145 100644 --- a/Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp +++ b/Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp @@ -313,7 +313,7 @@ void MappingWindow::SetMappingType(MappingWindow::Type type) void MappingWindow::AddWidget(const QString& name, QWidget* widget) { - m_tab_widget->addTab(GetWrappedWidget(widget, this, 150), name); + m_tab_widget->addTab(GetWrappedWidget(widget, this, 150, 150), name); } int MappingWindow::GetPort() const diff --git a/Source/Core/DolphinQt2/Config/PropertiesDialog.cpp b/Source/Core/DolphinQt2/Config/PropertiesDialog.cpp index 9303dcdca0..62da1a4e13 100644 --- a/Source/Core/DolphinQt2/Config/PropertiesDialog.cpp +++ b/Source/Core/DolphinQt2/Config/PropertiesDialog.cpp @@ -38,16 +38,16 @@ PropertiesDialog::PropertiesDialog(QWidget* parent, const UICommon::GameFile& ga connect(ar, &ARCodeWidget::OpenGeneralSettings, this, &PropertiesDialog::OpenGeneralSettings); - tab_widget->addTab(GetWrappedWidget(game_config, this), tr("Game Config")); - tab_widget->addTab(GetWrappedWidget(patches, this), tr("Patches")); - tab_widget->addTab(GetWrappedWidget(ar, this), tr("AR Codes")); - tab_widget->addTab(GetWrappedWidget(gecko, this), tr("Gecko Codes")); - tab_widget->addTab(GetWrappedWidget(info, this), tr("Info")); + tab_widget->addTab(GetWrappedWidget(game_config, this, 50, 80), tr("Game Config")); + tab_widget->addTab(GetWrappedWidget(patches, this, 50, 80), tr("Patches")); + tab_widget->addTab(GetWrappedWidget(ar, this, 50, 80), tr("AR Codes")); + tab_widget->addTab(GetWrappedWidget(gecko, this, 50, 80), tr("Gecko Codes")); + tab_widget->addTab(GetWrappedWidget(info, this, 50, 80), tr("Info")); if (DiscIO::IsDisc(game.GetPlatform())) { FilesystemWidget* filesystem = new FilesystemWidget(game); - tab_widget->addTab(filesystem, tr("Filesystem")); + tab_widget->addTab(GetWrappedWidget(filesystem, this, 50, 80), tr("Filesystem")); } layout->addWidget(tab_widget); diff --git a/Source/Core/DolphinQt2/QtUtils/WrapInScrollArea.cpp b/Source/Core/DolphinQt2/QtUtils/WrapInScrollArea.cpp index ed838a982a..4dc524cd8e 100644 --- a/Source/Core/DolphinQt2/QtUtils/WrapInScrollArea.cpp +++ b/Source/Core/DolphinQt2/QtUtils/WrapInScrollArea.cpp @@ -10,7 +10,8 @@ #include #include -QWidget* GetWrappedWidget(QWidget* wrapped_widget, QWidget* to_resize, int margin) +QWidget* GetWrappedWidget(QWidget* wrapped_widget, QWidget* to_resize, int margin_width, + int margin_height) { auto* scroll = new QScrollArea; scroll->setWidget(wrapped_widget); @@ -20,8 +21,9 @@ QWidget* GetWrappedWidget(QWidget* wrapped_widget, QWidget* to_resize, int margi if (to_resize != nullptr) { // For some reason width() is bigger than it needs to be. - int recommended_width = wrapped_widget->width() * 0.9; - int recommended_height = wrapped_widget->height() + margin; + auto min_size = wrapped_widget->minimumSizeHint(); + int recommended_width = min_size.width() + margin_width; + int recommended_height = min_size.height() + margin_height; to_resize->resize(std::max(recommended_width, to_resize->width()), std::max(recommended_height, to_resize->height())); diff --git a/Source/Core/DolphinQt2/QtUtils/WrapInScrollArea.h b/Source/Core/DolphinQt2/QtUtils/WrapInScrollArea.h index 02206e052b..c37a83bfaa 100644 --- a/Source/Core/DolphinQt2/QtUtils/WrapInScrollArea.h +++ b/Source/Core/DolphinQt2/QtUtils/WrapInScrollArea.h @@ -7,7 +7,8 @@ class QLayout; class QWidget; -QWidget* GetWrappedWidget(QWidget* wrapped_widget, QWidget* to_resize = nullptr, int margin = 50); +QWidget* GetWrappedWidget(QWidget* wrapped_widget, QWidget* to_resize = nullptr, + int margin_width = 50, int margin_height = 50); // Wrap wrapped_layout in a QScrollArea and fill the parent widget with it void WrapInScrollArea(QWidget* parent, QLayout* wrapped_layout, QWidget* to_resize = nullptr);