From a92fd98d7f83d729293bd2e819172c47a92a9180 Mon Sep 17 00:00:00 2001 From: Albert Liu <45282415+ggrtk@users.noreply.github.com> Date: Fri, 17 Jul 2020 03:50:02 -0700 Subject: [PATCH] Qt/GameListSettings: Fix QToolButtons staying highlighted after use --- src/duckstation-qt/gamelistsettingswidget.cpp | 26 +++++++++---------- src/duckstation-qt/gamelistsettingswidget.h | 10 +++---- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/duckstation-qt/gamelistsettingswidget.cpp b/src/duckstation-qt/gamelistsettingswidget.cpp index 793ac5554..6eb3e5216 100644 --- a/src/duckstation-qt/gamelistsettingswidget.cpp +++ b/src/duckstation-qt/gamelistsettingswidget.cpp @@ -214,14 +214,14 @@ GameListSettingsWidget::GameListSettingsWidget(QtHostInterface* host_interface, m_ui.searchDirectoryList->setCurrentIndex({}); connect(m_ui.searchDirectoryList, &QTableView::clicked, this, &GameListSettingsWidget::onDirectoryListItemClicked); - connect(m_ui.addSearchDirectoryButton, &QToolButton::pressed, this, - &GameListSettingsWidget::onAddSearchDirectoryButtonPressed); - connect(m_ui.removeSearchDirectoryButton, &QToolButton::pressed, this, - &GameListSettingsWidget::onRemoveSearchDirectoryButtonPressed); - connect(m_ui.rescanAllGames, &QToolButton::pressed, this, &GameListSettingsWidget::onRescanAllGamesPressed); - connect(m_ui.scanForNewGames, &QToolButton::pressed, this, &GameListSettingsWidget::onScanForNewGamesPressed); - connect(m_ui.updateRedumpDatabase, &QToolButton::pressed, this, - &GameListSettingsWidget::onUpdateRedumpDatabaseButtonPressed); + connect(m_ui.addSearchDirectoryButton, &QToolButton::clicked, this, + &GameListSettingsWidget::onAddSearchDirectoryButtonClicked); + connect(m_ui.removeSearchDirectoryButton, &QToolButton::clicked, this, + &GameListSettingsWidget::onRemoveSearchDirectoryButtonClicked); + connect(m_ui.rescanAllGames, &QToolButton::clicked, this, &GameListSettingsWidget::onRescanAllGamesClicked); + connect(m_ui.scanForNewGames, &QToolButton::clicked, this, &GameListSettingsWidget::onScanForNewGamesClicked); + connect(m_ui.updateRedumpDatabase, &QToolButton::clicked, this, + &GameListSettingsWidget::onUpdateRedumpDatabaseButtonClicked); } GameListSettingsWidget::~GameListSettingsWidget() = default; @@ -265,12 +265,12 @@ void GameListSettingsWidget::addSearchDirectory(QWidget* parent_widget) m_search_directories_model->addEntry(dir, recursive); } -void GameListSettingsWidget::onAddSearchDirectoryButtonPressed() +void GameListSettingsWidget::onAddSearchDirectoryButtonClicked() { addSearchDirectory(this); } -void GameListSettingsWidget::onRemoveSearchDirectoryButtonPressed() +void GameListSettingsWidget::onRemoveSearchDirectoryButtonClicked() { QModelIndexList selection = m_ui.searchDirectoryList->selectionModel()->selectedIndexes(); if (selection.size() < 1) @@ -280,17 +280,17 @@ void GameListSettingsWidget::onRemoveSearchDirectoryButtonPressed() m_search_directories_model->removeEntry(row); } -void GameListSettingsWidget::onRescanAllGamesPressed() +void GameListSettingsWidget::onRescanAllGamesClicked() { m_host_interface->refreshGameList(true, false); } -void GameListSettingsWidget::onScanForNewGamesPressed() +void GameListSettingsWidget::onScanForNewGamesClicked() { m_host_interface->refreshGameList(false, false); } -void GameListSettingsWidget::onUpdateRedumpDatabaseButtonPressed() +void GameListSettingsWidget::onUpdateRedumpDatabaseButtonClicked() { if (QMessageBox::question(this, tr("Download database from redump.org?"), tr("Do you wish to download the disc database from redump.org?\n\nThis will download " diff --git a/src/duckstation-qt/gamelistsettingswidget.h b/src/duckstation-qt/gamelistsettingswidget.h index d8df48010..59880d0a3 100644 --- a/src/duckstation-qt/gamelistsettingswidget.h +++ b/src/duckstation-qt/gamelistsettingswidget.h @@ -21,11 +21,11 @@ public Q_SLOTS: private Q_SLOTS: void onDirectoryListItemClicked(const QModelIndex& index); - void onAddSearchDirectoryButtonPressed(); - void onRemoveSearchDirectoryButtonPressed(); - void onScanForNewGamesPressed(); - void onRescanAllGamesPressed(); - void onUpdateRedumpDatabaseButtonPressed(); + void onAddSearchDirectoryButtonClicked(); + void onRemoveSearchDirectoryButtonClicked(); + void onScanForNewGamesClicked(); + void onRescanAllGamesClicked(); + void onUpdateRedumpDatabaseButtonClicked(); protected: void resizeEvent(QResizeEvent* event);