mirror of
https://github.com/stenzek/duckstation.git
synced 2026-02-15 19:04:37 +00:00
Qt: Remove MainWindow::updateTheme()
Instead pipe it through themeChanged().
This commit is contained in:
@@ -1466,7 +1466,7 @@ void GameListWidget::cancelRefresh()
|
||||
AssertMsg(!m_refresh_thread, "Game list thread should be unreferenced by now");
|
||||
}
|
||||
|
||||
void GameListWidget::reloadThemeSpecificImages()
|
||||
void GameListWidget::onThemeChanged()
|
||||
{
|
||||
m_model->reloadThemeSpecificImages();
|
||||
}
|
||||
|
||||
@@ -238,7 +238,6 @@ public:
|
||||
|
||||
void refresh(bool invalidate_cache);
|
||||
void cancelRefresh();
|
||||
void reloadThemeSpecificImages();
|
||||
void setBackgroundPath(const std::string_view path);
|
||||
bool hasBackground() const;
|
||||
|
||||
@@ -279,6 +278,8 @@ private:
|
||||
void onRefreshProgress(const QString& status, int current, int total, int entry_count, float time);
|
||||
void onRefreshComplete();
|
||||
|
||||
void onThemeChanged();
|
||||
|
||||
void showScaleToolTip();
|
||||
void onScaleSliderChanged(int value);
|
||||
void onScaleChanged();
|
||||
|
||||
@@ -2507,6 +2507,7 @@ void MainWindow::connectSignals()
|
||||
Qt::BlockingQueuedConnection);
|
||||
connect(g_emu_thread, &EmuThread::onDestroyAuxiliaryRenderWindow, this, &MainWindow::onDestroyAuxiliaryRenderWindow,
|
||||
Qt::BlockingQueuedConnection);
|
||||
connect(this, &MainWindow::themeChanged, g_emu_thread, &EmuThread::updateFullscreenUITheme);
|
||||
|
||||
// These need to be queued connections to stop crashing due to menus opening/closing and switching focus.
|
||||
connect(m_game_list_widget, &GameListWidget::refreshProgress, this, &MainWindow::onGameListRefreshProgress);
|
||||
@@ -2595,25 +2596,13 @@ void MainWindow::connectSignals()
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::updateTheme()
|
||||
{
|
||||
QtHost::UpdateApplicationTheme();
|
||||
g_emu_thread->updateFullscreenUITheme();
|
||||
reloadThemeSpecificImages();
|
||||
}
|
||||
|
||||
void MainWindow::reloadThemeSpecificImages()
|
||||
{
|
||||
m_game_list_widget->reloadThemeSpecificImages();
|
||||
}
|
||||
|
||||
void MainWindow::onSettingsThemeChanged()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
const QString old_style_name = qApp->style()->name();
|
||||
#endif
|
||||
|
||||
updateTheme();
|
||||
QtHost::UpdateApplicationTheme();
|
||||
|
||||
#ifdef _WIN32
|
||||
// Work around a bug where the background colour of menus is broken when changing to/from the windowsvista theme.
|
||||
@@ -2827,7 +2816,6 @@ void MainWindow::changeEvent(QEvent* event)
|
||||
if (event->type() == QEvent::StyleChange)
|
||||
{
|
||||
QtHost::SetIconThemeFromStyle();
|
||||
reloadThemeSpecificImages();
|
||||
emit themeChanged(QtHost::IsDarkApplicationTheme());
|
||||
}
|
||||
|
||||
|
||||
@@ -202,8 +202,6 @@ private:
|
||||
std::string getDeviceDiscPath(const QString& title);
|
||||
void setGameListEntryCoverImage(const GameList::Entry* entry);
|
||||
void clearGameListEntryPlayTime(const GameList::Entry* entry);
|
||||
void updateTheme();
|
||||
void reloadThemeSpecificImages();
|
||||
void onSettingsThemeChanged();
|
||||
void destroySubWindows();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user