Skip to content

Commit 33ab6fd

Browse files
HazNutF0bes
authored andcommitted
Qt: Grey out game grid related actions under 'View' menu if showing game list
1 parent 1391e13 commit 33ab6fd

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

pcsx2-qt/MainWindow.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ void MainWindow::setupAdditionalUi()
219219
m_ui.actionViewStatusBar->setChecked(status_bar_visible);
220220
m_ui.statusBar->setVisible(status_bar_visible);
221221

222+
const bool show_game_grid = Host::GetBaseBoolSettingValue("UI", "GameListGridView", false);
223+
updateGameGridActions(show_game_grid);
224+
222225
m_game_list_widget = new GameListWidget(getContentParent());
223226
m_game_list_widget->initialize();
224227
m_ui.actionGridViewShowTitles->setChecked(m_game_list_widget->getShowGridCoverTitles());
@@ -390,6 +393,7 @@ void MainWindow::connectSignals()
390393
connect(m_game_list_widget, &GameListWidget::layoutChange, this, [this]() {
391394
QSignalBlocker sb(m_ui.actionGridViewShowTitles);
392395
m_ui.actionGridViewShowTitles->setChecked(m_game_list_widget->getShowGridCoverTitles());
396+
updateGameGridActions(m_game_list_widget->isShowingGameGrid());
393397
});
394398

395399
SettingWidgetBinder::BindWidgetToBoolSetting(nullptr, m_ui.actionViewStatusBarVerbose, "UI", "VerboseStatusBar", false);
@@ -3145,6 +3149,14 @@ void MainWindow::updateGameDependentActions()
31453149
m_ui.actionReloadPatches->setEnabled(s_vm_valid);
31463150
}
31473151

3152+
void MainWindow::updateGameGridActions(const bool show_game_grid)
3153+
{
3154+
m_ui.actionGridViewShowTitles->setEnabled(show_game_grid);
3155+
m_ui.actionGridViewZoomIn->setEnabled(show_game_grid);
3156+
m_ui.actionGridViewZoomOut->setEnabled(show_game_grid);
3157+
m_ui.actionGridViewRefreshCovers->setEnabled(show_game_grid);
3158+
}
3159+
31483160
void MainWindow::doStartFile(std::optional<CDVD_SourceType> source, const QString& path)
31493161
{
31503162
if (s_vm_valid)

pcsx2-qt/MainWindow.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ private Q_SLOTS:
234234
void updateEmulationActions(bool starting, bool running, bool stopping);
235235
void updateDisplayRelatedActions(bool has_surface, bool render_to_main, bool fullscreen);
236236
void updateGameDependentActions();
237+
void updateGameGridActions(const bool show_game_grid);
237238
void updateStatusBarWidgetVisibility();
238239
void updateAdvancedSettingsVisibility();
239240
void updateWindowTitle();

0 commit comments

Comments
 (0)