fix: do not apply system theme on launch

Closes PrismLauncher/PrismLauncher#490

Regression introduced by PrismLauncher/PrismLauncher#249

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
Sefa Eyeoglu
2023-04-08 18:48:02 +02:00
parent ed085630db
commit a988111507
8 changed files with 19 additions and 17 deletions

View File

@ -116,22 +116,22 @@ void ThemeManager::setIconTheme(const QString& name)
QIcon::setThemeName(name);
}
void ThemeManager::applyCurrentlySelectedTheme()
void ThemeManager::applyCurrentlySelectedTheme(bool initial)
{
setIconTheme(APPLICATION->settings()->get("IconTheme").toString());
themeDebugLog() << "<> Icon theme set.";
setApplicationTheme(APPLICATION->settings()->get("ApplicationTheme").toString());
setApplicationTheme(APPLICATION->settings()->get("ApplicationTheme").toString(), initial);
themeDebugLog() << "<> Application theme set.";
}
void ThemeManager::setApplicationTheme(const QString& name)
void ThemeManager::setApplicationTheme(const QString& name, bool initial)
{
auto systemPalette = qApp->palette();
auto themeIter = m_themes.find(name);
if (themeIter != m_themes.end()) {
auto& theme = themeIter->second;
themeDebugLog() << "applying theme" << theme->name();
theme->apply();
theme->apply(initial);
} else {
themeWarningLog() << "Tried to set invalid theme:" << name;
}