]> sigrok.org Git - pulseview.git/commitdiff
GlobalSettings: Always use Fusion style on Windows for dark themes
authorSoeren Apel <redacted>
Mon, 22 Oct 2018 21:20:11 +0000 (23:20 +0200)
committerUwe Hermann <redacted>
Wed, 24 Oct 2018 22:08:42 +0000 (00:08 +0200)
pv/globalsettings.cpp

index 3f3711b8ec63a8397892f26eafc1db845e8dfab1..af89671cbadeb6b52b77fe707aaf86a265703f12 100644 (file)
@@ -26,6 +26,8 @@
 #include <QFontMetrics>
 #include <QPixmapCache>
 #include <QString>
+#include <QStyleFactory>
+#include <QtGlobal>
 
 using std::map;
 using std::pair;
@@ -142,6 +144,9 @@ void GlobalSettings::apply_theme()
        qApp->setPalette(default_palette_);
 
        if (theme_name.compare("QDarkStyleSheet") == 0) {
+#ifdef Q_OS_WIN
+               qApp->setStyle(QStyleFactory::create("Fusion"));
+#endif
                QPalette dark_palette;
                dark_palette.setColor(QPalette::Window, QColor(53, 53, 53));
                dark_palette.setColor(QPalette::WindowText, Qt::white);
@@ -150,6 +155,9 @@ void GlobalSettings::apply_theme()
                dark_palette.setColor(QPalette::Highlight, QColor(42, 130, 218));
                qApp->setPalette(dark_palette);
        } else if (theme_name.compare("DarkStyle") == 0) {
+#ifdef Q_OS_WIN
+               qApp->setStyle(QStyleFactory::create("Fusion"));
+#endif
                QPalette dark_palette;
                dark_palette.setColor(QPalette::Window, QColor(53, 53, 53));
                dark_palette.setColor(QPalette::WindowText, Qt::white);