summaryrefslogtreecommitdiffstats
path: root/application/MultiMC.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2017-01-18 02:45:04 +0100
committerPetr Mrázek <peterix@gmail.com>2017-01-18 02:48:29 +0100
commitceb5fc6d755cdcb263edc27386db38de9499048f (patch)
treefb1180717d1b10991e806acfd05c86a5080c1ec5 /application/MultiMC.cpp
parent201d4ac317cba2a7034cd08945b488bd46eb8ed3 (diff)
downloadMultiMC-ceb5fc6d755cdcb263edc27386db38de9499048f.tar
MultiMC-ceb5fc6d755cdcb263edc27386db38de9499048f.tar.gz
MultiMC-ceb5fc6d755cdcb263edc27386db38de9499048f.tar.lz
MultiMC-ceb5fc6d755cdcb263edc27386db38de9499048f.tar.xz
MultiMC-ceb5fc6d755cdcb263edc27386db38de9499048f.zip
GH-1790 do not apply system theme on launch if it is selected
This prevents some ugly colors to show up on macOS in most cases. It still looks ugly right after you switch to the it though.
Diffstat (limited to 'application/MultiMC.cpp')
-rw-r--r--application/MultiMC.cpp19
1 files changed, 3 insertions, 16 deletions
diff --git a/application/MultiMC.cpp b/application/MultiMC.cpp
index 6c0c4e5e..2f752904 100644
--- a/application/MultiMC.cpp
+++ b/application/MultiMC.cpp
@@ -355,7 +355,7 @@ MultiMC::MultiMC(int &argc, char **argv) : QApplication(argc, argv)
connect(this, SIGNAL(aboutToQuit()), SLOT(onExit()));
setIconTheme(settings()->get("IconTheme").toString());
- setApplicationTheme(settings()->get("ApplicationTheme").toString());
+ setApplicationTheme(settings()->get("ApplicationTheme").toString(), true);
initAnalytics();
@@ -868,27 +868,14 @@ void MultiMC::initThemes()
insertTheme(new CustomTheme(darkTheme, "custom"));
}
-void MultiMC::setApplicationTheme(const QString& name)
+void MultiMC::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;
- setStyle(QStyleFactory::create(theme->qtTheme()));
- if(theme->hasColorScheme())
- {
- setPalette(theme->colorScheme());
- }
- if(theme->hasStyleSheet())
- {
- setStyleSheet(theme->appStyleSheet());
- }
- else
- {
- setStyleSheet(QString());
- }
- QDir::setSearchPaths("theme", theme->searchPaths());
+ theme->apply(initial);
}
else
{