diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-02-02 03:03:32 +0100 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-02-02 03:03:32 +0100 |
commit | 3afec43b69991753416380d88e22b5382b8b0832 (patch) | |
tree | 15f14aa78ba2a9cc8c118665318e9e5b77282d8b /src/imports/controls/fusion | |
parent | 1a89fbc5a8e9fe6b2711c2e87e9909201c26d499 (diff) | |
parent | 09181d8b61cf3c84c88258586d68bd721d440620 (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13v5.13.0-alpha1
Change-Id: I13c6458d7a7f92daf58c12e4c120d99a1f56cbfa
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 |