From e6f1f6eeb1e09850c4dd79729b36f3998ef98cee Mon Sep 17 00:00:00 2001 From: TellowKrinkle Date: Sat, 16 Sep 2023 15:44:35 -0500 Subject: [PATCH] Qt: Put game scanning config in groupbox --- pcsx2-qt/Settings/GameListSettingsWidget.cpp | 14 +- pcsx2-qt/Settings/GameListSettingsWidget.h | 2 +- pcsx2-qt/Settings/GameListSettingsWidget.ui | 435 ++++++++++--------- 3 files changed, 234 insertions(+), 217 deletions(-) diff --git a/pcsx2-qt/Settings/GameListSettingsWidget.cpp b/pcsx2-qt/Settings/GameListSettingsWidget.cpp index 7525aa2cc2244..7057f36edb2e2 100644 --- a/pcsx2-qt/Settings/GameListSettingsWidget.cpp +++ b/pcsx2-qt/Settings/GameListSettingsWidget.cpp @@ -93,11 +93,19 @@ void GameListSettingsWidget::refreshExclusionList() m_ui.excludedPaths->addItem(QString::fromStdString(path)); } -void GameListSettingsWidget::resizeEvent(QResizeEvent* event) +bool GameListSettingsWidget::event(QEvent* event) { - QWidget::resizeEvent(event); + bool res = QWidget::event(event); - QtUtils::ResizeColumnsForTableView(m_ui.searchDirectoryList, {-1, 100}); + switch (event->type()) + { + case QEvent::LayoutRequest: + case QEvent::Resize: + QtUtils::ResizeColumnsForTableView(m_ui.searchDirectoryList, {-1, 100}); + break; + } + + return res; } void GameListSettingsWidget::addPathToTable(const std::string& path, bool recursive) diff --git a/pcsx2-qt/Settings/GameListSettingsWidget.h b/pcsx2-qt/Settings/GameListSettingsWidget.h index fd51a1ae3a3e2..61ae2e7977caa 100644 --- a/pcsx2-qt/Settings/GameListSettingsWidget.h +++ b/pcsx2-qt/Settings/GameListSettingsWidget.h @@ -49,7 +49,7 @@ private Q_SLOTS: void onRescanAllGamesClicked(); protected: - void resizeEvent(QResizeEvent* event); + bool event(QEvent* event); private: void addPathToTable(const std::string& path, bool recursive); diff --git a/pcsx2-qt/Settings/GameListSettingsWidget.ui b/pcsx2-qt/Settings/GameListSettingsWidget.ui index f9d54e5320dfc..9875771c78703 100644 --- a/pcsx2-qt/Settings/GameListSettingsWidget.ui +++ b/pcsx2-qt/Settings/GameListSettingsWidget.ui @@ -40,221 +40,230 @@ - - - - - Search Directories (will be scanned for games) - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - Add... - - - - .. - - - Qt::ToolButtonTextBesideIcon - - - - - - - - 0 - 0 - - - - Remove - - - - .. - - - Qt::ToolButtonTextBesideIcon - - - - - - - - - - Search Directory - - - - - Scan Recursively - - + + + Game Scanning + + + + + + + + Search Directories (will be scanned for games) + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Add... + + + + .. + + + Qt::ToolButtonTextBesideIcon + + + + + + + + 0 + 0 + + + + Remove + + + + .. + + + Qt::ToolButtonTextBesideIcon + + + + + + + + + + Search Directory + + + + + Scan Recursively + + + + + + + + + + Excluded Paths (will not be scanned) + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Directory... + + + + .. + + + Qt::ToolButtonTextBesideIcon + + + + + + + + 0 + 0 + + + + File... + + + + .. + + + Qt::ToolButtonTextBesideIcon + + + + + + + + 0 + 0 + + + + Remove + + + + .. + + + Qt::ToolButtonTextBesideIcon + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Scan For New Games + + + + .. + + + + + + + + 0 + 0 + + + + Rescan All Games + + + + .. + + + + + + - - - - - - Excluded Paths (will not be scanned) - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - Directory... - - - - .. - - - Qt::ToolButtonTextBesideIcon - - - - - - - - 0 - 0 - - - - File... - - - - .. - - - Qt::ToolButtonTextBesideIcon - - - - - - - - 0 - 0 - - - - Remove - - - - .. - - - Qt::ToolButtonTextBesideIcon - - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - Scan For New Games - - - - .. - - - - - - - - 0 - 0 - - - - Rescan All Games - - - - .. - - - - -