summaryrefslogtreecommitdiffstats
path: root/application/themes/SystemTheme.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2016-10-22 01:43:36 +0200
committerPetr Mrázek <peterix@gmail.com>2016-10-22 01:43:36 +0200
commitbbe139dce51a7965394c800cac974946820d3869 (patch)
treeaa271175a3df6ada20932e4cf898c723b1238775 /application/themes/SystemTheme.cpp
parent872cfe036d9472739939ad401dbe9511193d62ca (diff)
downloadMultiMC-bbe139dce51a7965394c800cac974946820d3869.tar
MultiMC-bbe139dce51a7965394c800cac974946820d3869.tar.gz
MultiMC-bbe139dce51a7965394c800cac974946820d3869.tar.lz
MultiMC-bbe139dce51a7965394c800cac974946820d3869.tar.xz
MultiMC-bbe139dce51a7965394c800cac974946820d3869.zip
GH-903 force Dark theme to use Fusion Qt style
Themes now include Qt styles.
Diffstat (limited to 'application/themes/SystemTheme.cpp')
-rw-r--r--application/themes/SystemTheme.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/application/themes/SystemTheme.cpp b/application/themes/SystemTheme.cpp
index 6ced6843..6d8a0ee8 100644
--- a/application/themes/SystemTheme.cpp
+++ b/application/themes/SystemTheme.cpp
@@ -1,10 +1,26 @@
#include "SystemTheme.h"
#include <QApplication>
#include <QStyle>
+#include <QStyleFactory>
+#include <QDebug>
SystemTheme::SystemTheme()
{
- systemPalette = QApplication::style()->standardPalette();
+ const auto & style = QApplication::style();
+ systemPalette = style->standardPalette();
+ QString lowerThemeName = style->objectName();
+ qWarning() << systemTheme;
+ QStringList styles = QStyleFactory::keys();
+ for(auto &st: styles)
+ {
+ if(st.toLower() == lowerThemeName)
+ {
+ systemTheme = st;
+ return;
+ }
+ }
+ // fall back to fusion if we can't find the current theme.
+ systemTheme = "Fusion";
}
QString SystemTheme::id()
@@ -17,6 +33,11 @@ QString SystemTheme::name()
return QObject::tr("System");
}
+QString SystemTheme::qtTheme()
+{
+ return systemTheme;
+}
+
QPalette SystemTheme::colorScheme()
{
return systemPalette;