Skip to content

Commit

Permalink
Qt: Fix a couple of theme switching glitches
Browse files Browse the repository at this point in the history
  • Loading branch information
kamfretoz authored and lightningterror committed Aug 19, 2024
1 parent b6eddad commit 92d8c74
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pcsx2-qt/Themes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ namespace QtHost
} // namespace QtHost

static QString s_unthemed_style_name;
static QPalette s_unthemed_palette;
static bool s_unthemed_style_name_set;

const char* QtHost::GetDefaultThemeName()
Expand All @@ -37,6 +38,7 @@ void QtHost::UpdateApplicationTheme()
{
s_unthemed_style_name_set = true;
s_unthemed_style_name = QApplication::style()->objectName();
s_unthemed_palette = QApplication::palette();
}

SetStyleFromSettings();
Expand All @@ -49,7 +51,7 @@ void QtHost::SetStyleFromSettings()

// setPalette() shouldn't be necessary, as the documentation claims that setStyle() resets the palette, but it
// is here, to work around a bug in 6.4.x and 6.5.x where the palette doesn't restore after changing themes.
qApp->setPalette(QPalette());
qApp->setPalette(QPalette(s_unthemed_palette));

if (theme == "fusion")
{
Expand Down

0 comments on commit 92d8c74

Please sign in to comment.