aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/ui')
-rw-r--r--launcher/ui/themes/ITheme.cpp2
-rw-r--r--launcher/ui/themes/ITheme.h2
-rw-r--r--launcher/ui/themes/SystemTheme.cpp8
-rw-r--r--launcher/ui/themes/SystemTheme.h2
-rw-r--r--launcher/ui/themes/ThemeManager.cpp8
-rw-r--r--launcher/ui/themes/ThemeManager.h4
6 files changed, 15 insertions, 11 deletions
diff --git a/launcher/ui/themes/ITheme.cpp b/launcher/ui/themes/ITheme.cpp
index 22043e44..8f0757e1 100644
--- a/launcher/ui/themes/ITheme.cpp
+++ b/launcher/ui/themes/ITheme.cpp
@@ -38,7 +38,7 @@
#include <QDir>
#include "Application.h"
-void ITheme::apply()
+void ITheme::apply(bool)
{
APPLICATION->setStyleSheet(QString());
QApplication::setStyle(QStyleFactory::create(qtTheme()));
diff --git a/launcher/ui/themes/ITheme.h b/launcher/ui/themes/ITheme.h
index 2e5b7f25..a0a638bd 100644
--- a/launcher/ui/themes/ITheme.h
+++ b/launcher/ui/themes/ITheme.h
@@ -41,7 +41,7 @@ class QStyle;
class ITheme {
public:
virtual ~ITheme() {}
- virtual void apply();
+ virtual void apply(bool initial);
virtual QString id() = 0;
virtual QString name() = 0;
virtual bool hasStyleSheet() = 0;
diff --git a/launcher/ui/themes/SystemTheme.cpp b/launcher/ui/themes/SystemTheme.cpp
index 24875e33..a95bc875 100644
--- a/launcher/ui/themes/SystemTheme.cpp
+++ b/launcher/ui/themes/SystemTheme.cpp
@@ -60,9 +60,13 @@ SystemTheme::SystemTheme()
themeDebugLog() << "System theme not found, defaulted to Fusion";
}
-void SystemTheme::apply()
+void SystemTheme::apply(bool initial)
{
- ITheme::apply();
+ // See https://github.com/MultiMC/Launcher/issues/1790
+ // or https://github.com/PrismLauncher/PrismLauncher/issues/490
+ if (initial)
+ return;
+ ITheme::apply(initial);
}
QString SystemTheme::id()
diff --git a/launcher/ui/themes/SystemTheme.h b/launcher/ui/themes/SystemTheme.h
index b5c03def..05f31233 100644
--- a/launcher/ui/themes/SystemTheme.h
+++ b/launcher/ui/themes/SystemTheme.h
@@ -40,7 +40,7 @@ class SystemTheme : public ITheme {
public:
SystemTheme();
virtual ~SystemTheme() {}
- void apply() override;
+ void apply(bool initial) override;
QString id() override;
QString name() override;
diff --git a/launcher/ui/themes/ThemeManager.cpp b/launcher/ui/themes/ThemeManager.cpp
index 13406485..94ac8a24 100644
--- a/launcher/ui/themes/ThemeManager.cpp
+++ b/launcher/ui/themes/ThemeManager.cpp
@@ -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;
}
diff --git a/launcher/ui/themes/ThemeManager.h b/launcher/ui/themes/ThemeManager.h
index 9af44b5a..87f36d9c 100644
--- a/launcher/ui/themes/ThemeManager.h
+++ b/launcher/ui/themes/ThemeManager.h
@@ -37,8 +37,8 @@ class ThemeManager {
QList<ITheme*> getValidApplicationThemes();
void setIconTheme(const QString& name);
- void applyCurrentlySelectedTheme();
- void setApplicationTheme(const QString& name);
+ void applyCurrentlySelectedTheme(bool initial = false);
+ void setApplicationTheme(const QString& name, bool initial = false);
/// <summary>
/// Returns the cat based on selected cat and with events (Birthday, XMas, etc.)