mirror of https://github.com/PCSX2/pcsx2.git
Qt: Update icons on dark/light mode switch
This commit is contained in:
parent
126c6e1b6c
commit
3e79a86008
|
@ -1504,6 +1504,11 @@ void MainWindow::onToolsEditCheatsPatchesTriggered(bool cheats)
|
|||
void MainWindow::updateTheme()
|
||||
{
|
||||
QtHost::UpdateApplicationTheme();
|
||||
reloadThemeSpecificImages();
|
||||
}
|
||||
|
||||
void MainWindow::reloadThemeSpecificImages()
|
||||
{
|
||||
m_game_list_widget->reloadThemeSpecificImages();
|
||||
}
|
||||
|
||||
|
@ -1789,6 +1794,17 @@ void MainWindow::closeEvent(QCloseEvent* event)
|
|||
m_is_closing = true;
|
||||
}
|
||||
|
||||
void MainWindow::changeEvent(QEvent* event)
|
||||
{
|
||||
QMainWindow::changeEvent(event);
|
||||
|
||||
if (event->type() == QEvent::StyleChange)
|
||||
{
|
||||
QtHost::SetIconThemeFromStyle();
|
||||
reloadThemeSpecificImages();
|
||||
}
|
||||
}
|
||||
|
||||
static QString getFilenameFromMimeData(const QMimeData* md)
|
||||
{
|
||||
QString filename;
|
||||
|
|
|
@ -167,6 +167,7 @@ private Q_SLOTS:
|
|||
void onToolsCoverDownloaderTriggered();
|
||||
void onToolsEditCheatsPatchesTriggered(bool cheats);
|
||||
void updateTheme();
|
||||
void reloadThemeSpecificImages();
|
||||
void updateLanguage();
|
||||
void onScreenshotActionTriggered();
|
||||
void onSaveGSDumpActionTriggered();
|
||||
|
@ -199,6 +200,7 @@ private Q_SLOTS:
|
|||
protected:
|
||||
void showEvent(QShowEvent* event) override;
|
||||
void closeEvent(QCloseEvent* event) override;
|
||||
void changeEvent(QEvent* event) override;
|
||||
void dragEnterEvent(QDragEnterEvent* event) override;
|
||||
void dropEvent(QDropEvent* event) override;
|
||||
|
||||
|
|
|
@ -238,6 +238,9 @@ namespace QtHost
|
|||
/// Sets application theme according to settings.
|
||||
void UpdateApplicationTheme();
|
||||
|
||||
/// Sets the icon theme, based on the current style (light/dark).
|
||||
void SetIconThemeFromStyle();
|
||||
|
||||
/// Sets batch mode (exit after game shutdown).
|
||||
bool InBatchMode();
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
namespace QtHost
|
||||
{
|
||||
static void SetStyleFromSettings();
|
||||
static void SetIconThemeFromStyle();
|
||||
} // namespace QtHost
|
||||
|
||||
static QString s_unthemed_style_name;
|
||||
|
|
Loading…
Reference in New Issue