diff options
Diffstat (limited to 'src/imports')
-rw-r--r-- | src/imports/controls/ComboBox.qml | 5 | ||||
-rw-r--r-- | src/imports/controls/designer/DialSpecifics.qml | 13 | ||||
-rw-r--r-- | src/imports/controls/fusion/qquickfusionstyle.cpp | 17 | ||||
-rw-r--r-- | src/imports/controls/fusion/qquickfusiontheme.cpp | 6 | ||||
-rw-r--r-- | src/imports/controls/plugins.qmltypes | 73 | ||||
-rw-r--r-- | src/imports/platform/qquickplatformfiledialog.cpp | 6 | ||||
-rw-r--r-- | src/imports/platform/qquickplatformfiledialog_p.h | 1 | ||||
-rw-r--r-- | src/imports/templates/plugins.qmltypes | 73 |
8 files changed, 140 insertions, 54 deletions
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 + } } } 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/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 diff --git a/src/imports/controls/plugins.qmltypes b/src/imports/controls/plugins.qmltypes index f4d2a30a..6d414405 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" } @@ -1296,13 +1298,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" @@ -2248,6 +2263,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 { @@ -2268,6 +2289,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" @@ -2295,6 +2322,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 { @@ -2315,6 +2348,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" diff --git a/src/imports/platform/qquickplatformfiledialog.cpp b/src/imports/platform/qquickplatformfiledialog.cpp index 36eaedf9..9c1eb684 100644 --- a/src/imports/platform/qquickplatformfiledialog.cpp +++ b/src/imports/platform/qquickplatformfiledialog.cpp @@ -518,7 +518,9 @@ void QQuickPlatformFileDialog::onShow(QPlatformDialogHelper *dialog) { m_options->setWindowTitle(title()); if (QPlatformFileDialogHelper *fileDialog = qobject_cast<QPlatformFileDialogHelper *>(dialog)) { - fileDialog->setOptions(m_options); + fileDialog->setOptions(m_options); // setOptions only assigns a member and isn't virtual + if (m_firstShow && m_options->initialDirectory().isValid()) + fileDialog->setDirectory(m_options->initialDirectory()); if (m_selectedNameFilter) { const int index = m_selectedNameFilter->index(); const QString filter = m_options->nameFilters().value(index); @@ -527,6 +529,8 @@ void QQuickPlatformFileDialog::onShow(QPlatformDialogHelper *dialog) connect(fileDialog, &QPlatformFileDialogHelper::filterSelected, m_selectedNameFilter, &QQuickPlatformFileNameFilter::update); } } + if (m_firstShow) + m_firstShow = false; } void QQuickPlatformFileDialog::onHide(QPlatformDialogHelper *dialog) diff --git a/src/imports/platform/qquickplatformfiledialog_p.h b/src/imports/platform/qquickplatformfiledialog_p.h index d16cc2b4..b867f3c8 100644 --- a/src/imports/platform/qquickplatformfiledialog_p.h +++ b/src/imports/platform/qquickplatformfiledialog_p.h @@ -149,6 +149,7 @@ private: FileMode m_fileMode; QList<QUrl> m_files; + bool m_firstShow = true; QSharedPointer<QFileDialogOptions> m_options; mutable QQuickPlatformFileNameFilter *m_selectedNameFilter; }; diff --git a/src/imports/templates/plugins.qmltypes b/src/imports/templates/plugins.qmltypes index 96c1b5c0..e9404fea 100644 --- a/src/imports/templates/plugins.qmltypes +++ b/src/imports/templates/plugins.qmltypes @@ -463,8 +463,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: { @@ -473,6 +477,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" } @@ -484,8 +496,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" } } @@ -553,23 +567,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" } @@ -653,13 +655,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" @@ -1605,6 +1620,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 { @@ -1625,6 +1646,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" @@ -1652,6 +1679,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 { @@ -1672,6 +1705,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" |