diff options
Diffstat (limited to 'src/imports/controls/fusion')
-rw-r--r-- | src/imports/controls/fusion/qquickfusionstyle.cpp | 17 | ||||
-rw-r--r-- | src/imports/controls/fusion/qquickfusiontheme.cpp | 6 |
2 files changed, 5 insertions, 18 deletions
diff --git a/src/imports/controls/fusion/qquickfusionstyle.cpp b/src/imports/controls/fusion/qquickfusionstyle.cpp index cb3889c8..98c1894f 100644 --- a/src/imports/controls/fusion/qquickfusionstyle.cpp +++ b/src/imports/controls/fusion/qquickfusionstyle.cpp @@ -43,21 +43,6 @@ QT_BEGIN_NAMESPACE -// On mac we want a standard blue color used when the system palette is used -static bool isMacSystemPalette(const QPalette &palette) -{ - Q_UNUSED(palette); -#if defined(Q_OS_MACOS) - const QPalette *themePalette = QGuiApplicationPrivate::platformTheme()->palette(); - if (themePalette && themePalette->color(QPalette::Normal, QPalette::Highlight) == - palette.color(QPalette::Normal, QPalette::Highlight) && - themePalette->color(QPalette::Normal, QPalette::HighlightedText) == - palette.color(QPalette::Normal, QPalette::HighlightedText)) - return true; -#endif - return false; -} - QQuickFusionStyle::QQuickFusionStyle(QObject *parent) : QObject(parent) { @@ -90,8 +75,6 @@ QColor QQuickFusionStyle::highlight(const QPalette &palette) QColor QQuickFusionStyle::highlightedText(const QPalette &palette) { - if (isMacSystemPalette(palette)) - return Qt::white; return palette.color(QPalette::HighlightedText); } diff --git a/src/imports/controls/fusion/qquickfusiontheme.cpp b/src/imports/controls/fusion/qquickfusiontheme.cpp index ac88563a..107619bf 100644 --- a/src/imports/controls/fusion/qquickfusiontheme.cpp +++ b/src/imports/controls/fusion/qquickfusiontheme.cpp @@ -37,12 +37,16 @@ #include "qquickfusiontheme_p.h" #include <QtQuickTemplates2/private/qquicktheme_p.h> +#include <QtQuickControls2/private/qquickstyle_p.h> QT_BEGIN_NAMESPACE void QQuickFusionTheme::initialize(QQuickTheme *theme) { - Q_UNUSED(theme); + const bool isDarkSystemTheme = QQuickStylePrivate::isDarkSystemTheme(); + QPalette systemPalette; + systemPalette.setColor(QPalette::ButtonText, isDarkSystemTheme ? Qt::white : Qt::black); + theme->setPalette(QQuickTheme::System, systemPalette); } QT_END_NAMESPACE |