From 28454b503c7e77a85855e1cc5911908d46d29366 Mon Sep 17 00:00:00 2001 From: Massimo Callegari Date: Fri, 28 Dec 2018 15:02:43 +0100 Subject: ComboBox: propagate palette colors to popup This allows a quick alternative to redefining the whole popup item by just acting on palette colors. Fixes: QTBUG-72786 Change-Id: I19e5158e2ad18fa9bf512f02d4bbe74cb06aba35 Reviewed-by: Massimo Callegari Reviewed-by: Mitch Curtis --- src/imports/controls/ComboBox.qml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/imports/controls') diff --git a/src/imports/controls/ComboBox.qml b/src/imports/controls/ComboBox.qml index 6b7fe008..69156114 100644 --- a/src/imports/controls/ComboBox.qml +++ b/src/imports/controls/ComboBox.qml @@ -55,6 +55,7 @@ T.ComboBox { delegate: ItemDelegate { width: parent.width text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData + palette.text: control.highlightedIndex === index ? control.palette.highlightedText : control.palette.text font.weight: control.currentIndex === index ? Font.DemiBold : Font.Normal highlighted: control.highlightedIndex === index hoverEnabled: control.hoverEnabled @@ -132,6 +133,8 @@ T.ComboBox { T.ScrollIndicator.vertical: ScrollIndicator { } } - background: Rectangle { } + background: Rectangle { + color: control.palette.window + } } } -- cgit v1.2.3 From 0fac346a891225415833a411974085133ae5f076 Mon Sep 17 00:00:00 2001 From: Nils Jeisecke Date: Mon, 28 Jan 2019 20:57:10 +0100 Subject: qquickfusionstyle: do not force a fixed white color for highlightedText just like the previous fix for for the highlight color: use the system palette. Task-number: QTBUG-70652 Change-Id: I5c31927c53ba386f54de7c46ec9fe66c26e7a31b Reviewed-by: Mitch Curtis --- src/imports/controls/fusion/qquickfusionstyle.cpp | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'src/imports/controls') 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); } -- cgit v1.2.3 From 0f5996a10a543bf43ee0fa60d0831b59a35df147 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 31 Jan 2019 09:29:33 +0100 Subject: Update Qt Creator-related files - Add Dial's new inputMode property to DialSpecifics.qml - Update plugins.qmltypes files Fixes: QTBUG-73412 Change-Id: Id9e3818db49d6d130da1256d3019a5074902c66d Reviewed-by: Thomas Hartmann --- src/imports/controls/designer/DialSpecifics.qml | 13 +++++ src/imports/controls/plugins.qmltypes | 73 +++++++++++++++++++------ 2 files changed, 69 insertions(+), 17 deletions(-) (limited to 'src/imports/controls') diff --git a/src/imports/controls/designer/DialSpecifics.qml b/src/imports/controls/designer/DialSpecifics.qml index c338fa94..fc5b5e83 100644 --- a/src/imports/controls/designer/DialSpecifics.qml +++ b/src/imports/controls/designer/DialSpecifics.qml @@ -130,6 +130,19 @@ Column { Layout.fillWidth: true } } + + Label { + text: qsTr("Input Mode") + tooltip: qsTr("How the dial tracks movement.") + } + SecondColumnLayout { + ComboBox { + backendValue: backendValues.inputMode + model: [ "Circular", "Horizontal", "Vertical" ] + scope: "Dial" + Layout.fillWidth: true + } + } } } diff --git a/src/imports/controls/plugins.qmltypes b/src/imports/controls/plugins.qmltypes index 949eea62..4585a9a6 100644 --- a/src/imports/controls/plugins.qmltypes +++ b/src/imports/controls/plugins.qmltypes @@ -1105,8 +1105,12 @@ Module { name: "QQuickDial" defaultProperty: "data" prototype: "QQuickControl" - exports: ["QtQuick.Templates/Dial 2.0", "QtQuick.Templates/Dial 2.2"] - exportMetaObjectRevisions: [0, 2] + exports: [ + "QtQuick.Templates/Dial 2.0", + "QtQuick.Templates/Dial 2.2", + "QtQuick.Templates/Dial 2.5" + ] + exportMetaObjectRevisions: [0, 2, 5] Enum { name: "SnapMode" values: { @@ -1115,6 +1119,14 @@ Module { "SnapOnRelease": 2 } } + Enum { + name: "InputMode" + values: { + "Circular": 0, + "Horizontal": 1, + "Vertical": 2 + } + } Property { name: "from"; type: "double" } Property { name: "to"; type: "double" } Property { name: "value"; type: "double" } @@ -1126,8 +1138,10 @@ Module { Property { name: "pressed"; type: "bool"; isReadonly: true } Property { name: "handle"; type: "QQuickItem"; isPointer: true } Property { name: "live"; revision: 2; type: "bool" } + Property { name: "inputMode"; revision: 5; type: "InputMode" } Signal { name: "moved"; revision: 2 } Signal { name: "liveChanged"; revision: 2 } + Signal { name: "inputModeChanged"; revision: 5 } Method { name: "increase" } Method { name: "decrease" } } @@ -1195,23 +1209,11 @@ Module { "Footer": 1 } } - Enum { - name: "ButtonLayout" - values: { - "UnknownLayout": -1, - "WinLayout": 0, - "MacLayout": 1, - "KdeLayout": 2, - "GnomeLayout": 3, - "MacModelessLayout": 4, - "AndroidLayout": 5 - } - } Property { name: "position"; type: "Position" } Property { name: "alignment"; type: "Qt::Alignment" } Property { name: "standardButtons"; type: "QPlatformDialogHelper::StandardButtons" } Property { name: "delegate"; type: "QQmlComponent"; isPointer: true } - Property { name: "buttonLayout"; revision: 5; type: "ButtonLayout" } + Property { name: "buttonLayout"; revision: 5; type: "QPlatformDialogHelper::ButtonLayout" } Signal { name: "accepted" } Signal { name: "rejected" } Signal { name: "helpRequested" } @@ -1295,13 +1297,26 @@ Module { prototype: "QQuickText" exports: [ "QtQuick.Templates/Label 2.0", - "QtQuick.Templates/Label 2.3" + "QtQuick.Templates/Label 2.3", + "QtQuick.Templates/Label 2.5" ] - exportMetaObjectRevisions: [0, 3] + exportMetaObjectRevisions: [0, 3, 5] Property { name: "font"; type: "QFont" } Property { name: "background"; type: "QQuickItem"; isPointer: true } Property { name: "palette"; revision: 3; type: "QPalette" } + Property { name: "implicitBackgroundWidth"; revision: 5; type: "double"; isReadonly: true } + Property { name: "implicitBackgroundHeight"; revision: 5; type: "double"; isReadonly: true } + Property { name: "topInset"; revision: 5; type: "double" } + Property { name: "leftInset"; revision: 5; type: "double" } + Property { name: "rightInset"; revision: 5; type: "double" } + Property { name: "bottomInset"; revision: 5; type: "double" } Signal { name: "paletteChanged"; revision: 3 } + Signal { name: "implicitBackgroundWidthChanged"; revision: 5 } + Signal { name: "implicitBackgroundHeightChanged"; revision: 5 } + Signal { name: "topInsetChanged"; revision: 5 } + Signal { name: "leftInsetChanged"; revision: 5 } + Signal { name: "rightInsetChanged"; revision: 5 } + Signal { name: "bottomInsetChanged"; revision: 5 } } Component { name: "QQuickMenu" @@ -2247,6 +2262,12 @@ Module { Property { name: "hoverEnabled"; revision: 1; type: "bool" } Property { name: "palette"; revision: 3; type: "QPalette" } Property { name: "placeholderTextColor"; revision: 5; type: "QColor" } + Property { name: "implicitBackgroundWidth"; revision: 5; type: "double"; isReadonly: true } + Property { name: "implicitBackgroundHeight"; revision: 5; type: "double"; isReadonly: true } + Property { name: "topInset"; revision: 5; type: "double" } + Property { name: "leftInset"; revision: 5; type: "double" } + Property { name: "rightInset"; revision: 5; type: "double" } + Property { name: "bottomInset"; revision: 5; type: "double" } Signal { name: "implicitWidthChanged3" } Signal { name: "implicitHeightChanged3" } Signal { @@ -2267,6 +2288,12 @@ Module { Signal { name: "hoverEnabledChanged"; revision: 1 } Signal { name: "paletteChanged"; revision: 3 } Signal { name: "placeholderTextColorChanged"; revision: 5 } + Signal { name: "implicitBackgroundWidthChanged"; revision: 5 } + Signal { name: "implicitBackgroundHeightChanged"; revision: 5 } + Signal { name: "topInsetChanged"; revision: 5 } + Signal { name: "leftInsetChanged"; revision: 5 } + Signal { name: "rightInsetChanged"; revision: 5 } + Signal { name: "bottomInsetChanged"; revision: 5 } } Component { name: "QQuickTextAreaAttached" @@ -2294,6 +2321,12 @@ Module { Property { name: "hoverEnabled"; revision: 1; type: "bool" } Property { name: "palette"; revision: 3; type: "QPalette" } Property { name: "placeholderTextColor"; revision: 5; type: "QColor" } + Property { name: "implicitBackgroundWidth"; revision: 5; type: "double"; isReadonly: true } + Property { name: "implicitBackgroundHeight"; revision: 5; type: "double"; isReadonly: true } + Property { name: "topInset"; revision: 5; type: "double" } + Property { name: "leftInset"; revision: 5; type: "double" } + Property { name: "rightInset"; revision: 5; type: "double" } + Property { name: "bottomInset"; revision: 5; type: "double" } Signal { name: "implicitWidthChanged3" } Signal { name: "implicitHeightChanged3" } Signal { @@ -2314,6 +2347,12 @@ Module { Signal { name: "hoverEnabledChanged"; revision: 1 } Signal { name: "paletteChanged"; revision: 3 } Signal { name: "placeholderTextColorChanged"; revision: 5 } + Signal { name: "implicitBackgroundWidthChanged"; revision: 5 } + Signal { name: "implicitBackgroundHeightChanged"; revision: 5 } + Signal { name: "topInsetChanged"; revision: 5 } + Signal { name: "leftInsetChanged"; revision: 5 } + Signal { name: "rightInsetChanged"; revision: 5 } + Signal { name: "bottomInsetChanged"; revision: 5 } } Component { name: "QQuickToolBar" -- cgit v1.2.3 From 90eb509a6655d25f52edf3ea0da27f83937e5727 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 31 Jan 2019 14:18:20 +0100 Subject: Fusion: use white ButtonText when a dark system theme is in use Button's text was previously black on a dark background with macOS' dark mode. This patch makes it more readable. Task-number: QTBUG-70819 Change-Id: Iaa9d31133434e67e04d5d831dcb8eeba191cbab4 Reviewed-by: Nils Jeisecke Reviewed-by: Frederik Gladhorn --- src/imports/controls/fusion/qquickfusiontheme.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/imports/controls') 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 +#include 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 -- cgit v1.2.3