Skip to content

Commit

Permalink
Qt: Add option to toggle cover titles to game list settings
Browse files Browse the repository at this point in the history
  • Loading branch information
TellowKrinkle committed Sep 26, 2023
1 parent b2fda81 commit 1948df2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pcsx2-qt/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2275,6 +2275,9 @@ SettingsDialog* MainWindow::getSettingsDialog()
connect(m_settings_dialog->getGameListSettingsWidget(), &GameListSettingsWidget::preferEnglishGameListChanged, this, []{
g_main_window->m_game_list_widget->refreshGridCovers();
});
connect(m_settings_dialog->getGameListSettingsWidget(), &GameListSettingsWidget::showCoverTitlesChanged, this, []{
g_main_window->m_game_list_widget->setShowCoverTitles(Host::GetBaseBoolSettingValue("UI", "GameListShowCoverTitles"));
});
}

return m_settings_dialog;
Expand Down
4 changes: 4 additions & 0 deletions pcsx2-qt/Settings/GameListSettingsWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,13 @@ GameListSettingsWidget::GameListSettingsWidget(SettingsDialog* dialog, QWidget*

SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.preferEnglishGameList, "UI", "PreferEnglishGameList", false);
connect(m_ui.preferEnglishGameList, &QCheckBox::stateChanged, [this]{ emit preferEnglishGameListChanged(); });
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.showCoverTitles, "UI", "GameListShowCoverTitles", true);
connect(m_ui.showCoverTitles, &QCheckBox::stateChanged, [this]{ emit showCoverTitlesChanged(); });

dialog->registerWidgetHelp(m_ui.preferEnglishGameList, tr("Prefer English Titles"), tr("Unchecked"),
tr("For games with both a title in the game's native language and one in English, prefer the English title."));
dialog->registerWidgetHelp(m_ui.showCoverTitles, tr("Show Titles in Cover View"), tr("Checked"),
tr("Shows game titles under cover images when in the game list's cover view."));

m_ui.searchDirectoryList->setSelectionMode(QAbstractItemView::SingleSelection);
m_ui.searchDirectoryList->setSelectionBehavior(QAbstractItemView::SelectRows);
Expand Down
1 change: 1 addition & 0 deletions pcsx2-qt/Settings/GameListSettingsWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class GameListSettingsWidget : public QWidget

Q_SIGNALS:
void preferEnglishGameListChanged();
void showCoverTitlesChanged();

public Q_SLOTS:
void addSearchDirectory(QWidget* parent_widget);
Expand Down
7 changes: 7 additions & 0 deletions pcsx2-qt/Settings/GameListSettingsWidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="showCoverTitles">
<property name="text">
<string>Show Titles in Cover View</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
Expand Down

0 comments on commit 1948df2

Please sign in to comment.