diff options
Diffstat (limited to 'src/imports/controls/material')
30 files changed, 522 insertions, 93 deletions
diff --git a/src/imports/controls/material/ComboBox.qml b/src/imports/controls/material/ComboBox.qml index 7d635902..6aada8c5 100644 --- a/src/imports/controls/material/ComboBox.qml +++ b/src/imports/controls/material/ComboBox.qml @@ -34,13 +34,13 @@ ** ****************************************************************************/ -import QtQuick 2.14 -import QtQuick.Window 2.14 -import QtQuick.Controls 2.14 -import QtQuick.Controls.impl 2.14 -import QtQuick.Templates 2.14 as T -import QtQuick.Controls.Material 2.14 -import QtQuick.Controls.Material.impl 2.14 +import QtQuick 2.15 +import QtQuick.Window 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Controls.impl 2.15 +import QtQuick.Templates 2.15 as T +import QtQuick.Controls.Material 2.15 +import QtQuick.Controls.Material.impl 2.15 T.ComboBox { id: control @@ -63,9 +63,9 @@ T.ComboBox { Material.foreground: flat ? undefined : Material.primaryTextColor delegate: MenuItem { - width: parent.width + width: ListView.view.width text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData - Material.foreground: control.currentIndex === index ? parent.Material.accent : parent.Material.foreground + Material.foreground: control.currentIndex === index ? ListView.view.contentItem.Material.accent : ListView.view.contentItem.Material.foreground highlighted: control.highlightedIndex === index hoverEnabled: control.hoverEnabled } @@ -89,6 +89,7 @@ T.ComboBox { readOnly: control.down inputMethodHints: control.inputMethodHints validator: control.validator + selectByMouse: control.selectTextByMouse font: control.font color: control.enabled ? control.Material.foreground : control.Material.hintTextColor @@ -146,14 +147,14 @@ T.ComboBox { enter: Transition { // grow_fade_in - NumberAnimation { property: "scale"; from: 0.9; to: 1.0; easing.type: Easing.OutQuint; duration: 220 } - NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; easing.type: Easing.OutCubic; duration: 150 } + NumberAnimation { property: "scale"; from: 0.9; easing.type: Easing.OutQuint; duration: 220 } + NumberAnimation { property: "opacity"; from: 0.0; easing.type: Easing.OutCubic; duration: 150 } } exit: Transition { // shrink_fade_out - NumberAnimation { property: "scale"; from: 1.0; to: 0.9; easing.type: Easing.OutQuint; duration: 220 } - NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; easing.type: Easing.OutCubic; duration: 150 } + NumberAnimation { property: "scale"; to: 0.9; easing.type: Easing.OutQuint; duration: 220 } + NumberAnimation { property: "opacity"; to: 0.0; easing.type: Easing.OutCubic; duration: 150 } } contentItem: ListView { diff --git a/src/imports/controls/material/DialogButtonBox.qml b/src/imports/controls/material/DialogButtonBox.qml index c53b8210..d148fb24 100644 --- a/src/imports/controls/material/DialogButtonBox.qml +++ b/src/imports/controls/material/DialogButtonBox.qml @@ -60,6 +60,7 @@ T.DialogButtonBox { delegate: Button { flat: true } contentItem: ListView { + implicitWidth: contentWidth model: control.contentModel spacing: control.spacing orientation: ListView.Horizontal diff --git a/src/imports/controls/material/HorizontalHeaderView.qml b/src/imports/controls/material/HorizontalHeaderView.qml new file mode 100644 index 00000000..fd672f34 --- /dev/null +++ b/src/imports/controls/material/HorizontalHeaderView.qml @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Templates 2.15 as T +import QtQuick.Controls.Material 2.15 +import QtQuick.Controls.Material.impl 2.15 + +T.HorizontalHeaderView { + id: control + + implicitWidth: syncView ? syncView.width : 0 + implicitHeight: contentHeight + + delegate: Rectangle { + // Qt6: add cellPadding (and font etc) as public API in headerview + readonly property real cellPadding: 8 + + implicitWidth: text.implicitWidth + (cellPadding * 2) + implicitHeight: Math.max(control.height, text.implicitHeight + (cellPadding * 2)) + color: control.Material.backgroundColor + + Text { + id: text + text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] + : model[control.textRole]) + : modelData + width: parent.width + height: parent.height + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + color: enabled ? control.Material.foreground : control.Material.hintTextColor + } + } +} diff --git a/src/imports/controls/material/Menu.qml b/src/imports/controls/material/Menu.qml index d28713a7..94bcc15e 100644 --- a/src/imports/controls/material/Menu.qml +++ b/src/imports/controls/material/Menu.qml @@ -74,7 +74,9 @@ T.Menu { implicitHeight: contentHeight model: control.contentModel - interactive: Window.window ? contentHeight > Window.window.height : false + interactive: Window.window + ? contentHeight + control.topPadding + control.bottomPadding > Window.window.height + : false clip: true currentIndex: control.currentIndex diff --git a/src/imports/controls/material/RangeSlider.qml b/src/imports/controls/material/RangeSlider.qml index d735573a..f05601a7 100644 --- a/src/imports/controls/material/RangeSlider.qml +++ b/src/imports/controls/material/RangeSlider.qml @@ -36,6 +36,7 @@ import QtQuick 2.12 import QtQuick.Templates 2.12 as T +import QtQuick.Controls.impl 2.12 import QtQuick.Controls.Material 2.12 import QtQuick.Controls.Material.impl 2.12 @@ -74,18 +75,18 @@ T.RangeSlider { y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : 0) implicitWidth: control.horizontal ? 200 : 48 implicitHeight: control.horizontal ? 48 : 200 - width: control.horizontal ? control.availableWidth : 1 - height: control.horizontal ? 1 : control.availableHeight - color: control.Material.foreground - scale:control.horizontal && control.mirrored ? -1 : 1 + width: control.horizontal ? control.availableWidth : 4 + height: control.horizontal ? 4 : control.availableHeight + scale: control.horizontal && control.mirrored ? -1 : 1 + color: control.enabled ? Color.transparent(control.Material.accentColor, 0.33) : control.Material.sliderDisabledColor Rectangle { - x: control.horizontal ? control.first.position * parent.width : -1 - y: control.horizontal ? -1 : control.second.visualPosition * parent.height + 3 - width: control.horizontal ? control.second.position * parent.width - control.first.position * parent.width - 3 : 3 - height: control.horizontal ? 3 : control.second.position * parent.height - control.first.position * parent.height - 3 + x: control.horizontal ? control.first.position * parent.width : 0 + y: control.horizontal ? 0 : control.second.visualPosition * parent.height + width: control.horizontal ? control.second.position * parent.width - control.first.position * parent.width : 4 + height: control.horizontal ? 4 : control.second.position * parent.height - control.first.position * parent.height - color: control.Material.accentColor + color: control.enabled ? control.Material.accentColor : control.Material.sliderDisabledColor } } } diff --git a/src/imports/controls/material/Slider.qml b/src/imports/controls/material/Slider.qml index cc6a1413..ac7a0c42 100644 --- a/src/imports/controls/material/Slider.qml +++ b/src/imports/controls/material/Slider.qml @@ -36,6 +36,7 @@ import QtQuick 2.12 import QtQuick.Templates 2.12 as T +import QtQuick.Controls.impl 2.12 import QtQuick.Controls.Material 2.12 import QtQuick.Controls.Material.impl 2.12 @@ -63,18 +64,18 @@ T.Slider { y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : 0) implicitWidth: control.horizontal ? 200 : 48 implicitHeight: control.horizontal ? 48 : 200 - width: control.horizontal ? control.availableWidth : 1 - height: control.horizontal ? 1 : control.availableHeight - color: control.Material.foreground + width: control.horizontal ? control.availableWidth : 4 + height: control.horizontal ? 4 : control.availableHeight scale: control.horizontal && control.mirrored ? -1 : 1 + color: control.enabled ? Color.transparent(control.Material.accentColor, 0.33) : control.Material.sliderDisabledColor Rectangle { x: control.horizontal ? 0 : (parent.width - width) / 2 y: control.horizontal ? (parent.height - height) / 2 : control.visualPosition * parent.height - width: control.horizontal ? control.position * parent.width : 3 - height: control.horizontal ? 3 : control.position * parent.height + width: control.horizontal ? control.position * parent.width : 4 + height: control.horizontal ? 4 : control.position * parent.height - color: control.Material.accentColor + color: control.enabled ? control.Material.accentColor : control.Material.sliderDisabledColor } } } diff --git a/src/imports/controls/material/SliderHandle.qml b/src/imports/controls/material/SliderHandle.qml index 2e3120e4..c9078bc8 100644 --- a/src/imports/controls/material/SliderHandle.qml +++ b/src/imports/controls/material/SliderHandle.qml @@ -55,8 +55,8 @@ Item { width: parent.width height: parent.height radius: width / 2 - color: root.control.Material.accentColor scale: root.handlePressed ? 1.5 : 1 + color: control.enabled ? root.control.Material.accentColor : root.control.Material.sliderDisabledColor Behavior on scale { NumberAnimation { @@ -71,6 +71,6 @@ Item { width: 22; height: 22 pressed: root.handlePressed active: root.handlePressed || root.handleHasFocus || root.handleHovered - color: root.control.Material.rippleColor + color: root.control.Material.highlightedRippleColor } } diff --git a/src/imports/controls/material/SwipeView.qml b/src/imports/controls/material/SwipeView.qml index 12ea36ae..a84f16c5 100644 --- a/src/imports/controls/material/SwipeView.qml +++ b/src/imports/controls/material/SwipeView.qml @@ -50,6 +50,7 @@ T.SwipeView { model: control.contentModel interactive: control.interactive currentIndex: control.currentIndex + focus: control.focus spacing: control.spacing orientation: control.orientation diff --git a/src/imports/controls/material/ToolTip.qml b/src/imports/controls/material/ToolTip.qml index fb705367..83afe4b1 100644 --- a/src/imports/controls/material/ToolTip.qml +++ b/src/imports/controls/material/ToolTip.qml @@ -70,7 +70,7 @@ T.ToolTip { contentItem: Text { text: control.text font: control.font - // TODO: wrapMode: Label.Wrap + wrapMode: Text.Wrap color: control.Material.foreground } diff --git a/src/imports/controls/material/VerticalHeaderView.qml b/src/imports/controls/material/VerticalHeaderView.qml new file mode 100644 index 00000000..5fc5aebe --- /dev/null +++ b/src/imports/controls/material/VerticalHeaderView.qml @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Templates 2.15 as T +import QtQuick.Controls.Material 2.15 +import QtQuick.Controls.Material.impl 2.15 + +T.VerticalHeaderView { + id: control + + implicitWidth: contentWidth + implicitHeight: syncView ? syncView.height : 0 + + delegate: Rectangle { + // Qt6: add cellPadding (and font etc) as public API in headerview + readonly property real cellPadding: 8 + + implicitWidth: Math.max(control.width, text.implicitWidth + (cellPadding * 2)) + implicitHeight: text.implicitHeight + (cellPadding * 2) + color: control.Material.backgroundColor + + Text { + id: text + text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] + : model[control.textRole]) + : modelData + width: parent.width + height: parent.height + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + color: enabled ? control.Material.foreground : control.Material.hintTextColor + } + } +} diff --git a/src/imports/controls/material/images/arrow-indicator.png b/src/imports/controls/material/images/arrow-indicator.png Binary files differindex 4a942849..5a978001 100644 --- a/src/imports/controls/material/images/arrow-indicator.png +++ b/src/imports/controls/material/images/arrow-indicator.png diff --git a/src/imports/controls/material/images/arrow-indicator@2x.png b/src/imports/controls/material/images/arrow-indicator@2x.png Binary files differindex b31b56c1..37ce3a95 100644 --- a/src/imports/controls/material/images/arrow-indicator@2x.png +++ b/src/imports/controls/material/images/arrow-indicator@2x.png diff --git a/src/imports/controls/material/images/arrow-indicator@3x.png b/src/imports/controls/material/images/arrow-indicator@3x.png Binary files differindex 637e9674..57abd972 100644 --- a/src/imports/controls/material/images/arrow-indicator@3x.png +++ b/src/imports/controls/material/images/arrow-indicator@3x.png diff --git a/src/imports/controls/material/images/arrow-indicator@4x.png b/src/imports/controls/material/images/arrow-indicator@4x.png Binary files differindex 15b9a902..26d3d7c1 100644 --- a/src/imports/controls/material/images/arrow-indicator@4x.png +++ b/src/imports/controls/material/images/arrow-indicator@4x.png diff --git a/src/imports/controls/material/images/check.png b/src/imports/controls/material/images/check.png Binary files differindex 4e4e3be8..756a43a5 100644 --- a/src/imports/controls/material/images/check.png +++ b/src/imports/controls/material/images/check.png diff --git a/src/imports/controls/material/images/check@2x.png b/src/imports/controls/material/images/check@2x.png Binary files differindex deb0c7e9..9d1d6a32 100644 --- a/src/imports/controls/material/images/check@2x.png +++ b/src/imports/controls/material/images/check@2x.png diff --git a/src/imports/controls/material/images/check@3x.png b/src/imports/controls/material/images/check@3x.png Binary files differindex 72ffd4e6..32ed72f0 100644 --- a/src/imports/controls/material/images/check@3x.png +++ b/src/imports/controls/material/images/check@3x.png diff --git a/src/imports/controls/material/images/check@4x.png b/src/imports/controls/material/images/check@4x.png Binary files differindex 9dc1ab2c..1767cee6 100644 --- a/src/imports/controls/material/images/check@4x.png +++ b/src/imports/controls/material/images/check@4x.png diff --git a/src/imports/controls/material/images/drop-indicator.png b/src/imports/controls/material/images/drop-indicator.png Binary files differindex 0f61fbb7..93560f50 100644 --- a/src/imports/controls/material/images/drop-indicator.png +++ b/src/imports/controls/material/images/drop-indicator.png diff --git a/src/imports/controls/material/images/drop-indicator@2x.png b/src/imports/controls/material/images/drop-indicator@2x.png Binary files differindex 8f555eee..d32f8160 100644 --- a/src/imports/controls/material/images/drop-indicator@2x.png +++ b/src/imports/controls/material/images/drop-indicator@2x.png diff --git a/src/imports/controls/material/images/drop-indicator@3x.png b/src/imports/controls/material/images/drop-indicator@3x.png Binary files differindex 7fd2af1f..34c3e7d1 100644 --- a/src/imports/controls/material/images/drop-indicator@3x.png +++ b/src/imports/controls/material/images/drop-indicator@3x.png diff --git a/src/imports/controls/material/images/drop-indicator@4x.png b/src/imports/controls/material/images/drop-indicator@4x.png Binary files differindex 7e81fdd8..0613f6dd 100644 --- a/src/imports/controls/material/images/drop-indicator@4x.png +++ b/src/imports/controls/material/images/drop-indicator@4x.png diff --git a/src/imports/controls/material/material.pri b/src/imports/controls/material/material.pri index bda1fb21..457a8df1 100644 --- a/src/imports/controls/material/material.pri +++ b/src/imports/controls/material/material.pri @@ -30,6 +30,7 @@ QML_FILES += \ $$PWD/ElevationEffect.qml \ $$PWD/Frame.qml \ $$PWD/GroupBox.qml \ + $$PWD/HorizontalHeaderView.qml \ $$PWD/ItemDelegate.qml \ $$PWD/Label.qml \ $$PWD/Menu.qml \ @@ -68,4 +69,5 @@ QML_FILES += \ $$PWD/ToolButton.qml \ $$PWD/ToolSeparator.qml \ $$PWD/ToolTip.qml \ - $$PWD/Tumbler.qml + $$PWD/Tumbler.qml \ + $$PWD/VerticalHeaderView.qml diff --git a/src/imports/controls/material/material.pro b/src/imports/controls/material/material.pro index cf08b925..ea74d277 100644 --- a/src/imports/controls/material/material.pro +++ b/src/imports/controls/material/material.pro @@ -1,4 +1,4 @@ -TARGET = qtquickcontrols2materialstyleplugin +TARGET = qqc2materialstyleplugin TARGETPATH = QtQuick/Controls.2/Material IMPORT_NAME = QtQuick.Controls.Material diff --git a/src/imports/controls/material/plugins.qmltypes b/src/imports/controls/material/plugins.qmltypes index 3e95fa44..e290e0ea 100644 --- a/src/imports/controls/material/plugins.qmltypes +++ b/src/imports/controls/material/plugins.qmltypes @@ -4,12 +4,188 @@ import QtQuick.tooling 1.2 // It is used for QML tooling purposes only. // // This file was auto-generated by: -// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQuick.Controls.Material 2.13' +// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQuick.Controls.Material 2.15' Module { dependencies: ["QtQuick.Controls 2.0"] Component { name: "QQuickAttachedObject"; prototype: "QObject" } Component { + name: "QQuickItem" + defaultProperty: "data" + prototype: "QObject" + Enum { + name: "Flags" + values: { + "ItemClipsChildrenToShape": 1, + "ItemAcceptsInputMethod": 2, + "ItemIsFocusScope": 4, + "ItemHasContents": 8, + "ItemAcceptsDrops": 16 + } + } + Enum { + name: "TransformOrigin" + values: { + "TopLeft": 0, + "Top": 1, + "TopRight": 2, + "Left": 3, + "Center": 4, + "Right": 5, + "BottomLeft": 6, + "Bottom": 7, + "BottomRight": 8 + } + } + Property { name: "parent"; type: "QQuickItem"; isPointer: true } + Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } + Property { name: "resources"; type: "QObject"; isList: true; isReadonly: true } + Property { name: "children"; type: "QQuickItem"; isList: true; isReadonly: true } + Property { name: "x"; type: "double" } + Property { name: "y"; type: "double" } + Property { name: "z"; type: "double" } + Property { name: "width"; type: "double" } + Property { name: "height"; type: "double" } + Property { name: "opacity"; type: "double" } + Property { name: "enabled"; type: "bool" } + Property { name: "visible"; type: "bool" } + Property { name: "visibleChildren"; type: "QQuickItem"; isList: true; isReadonly: true } + Property { name: "states"; type: "QQuickState"; isList: true; isReadonly: true } + Property { name: "transitions"; type: "QQuickTransition"; isList: true; isReadonly: true } + Property { name: "state"; type: "string" } + Property { name: "childrenRect"; type: "QRectF"; isReadonly: true } + Property { name: "anchors"; type: "QQuickAnchors"; isReadonly: true; isPointer: true } + Property { name: "left"; type: "QQuickAnchorLine"; isReadonly: true } + Property { name: "right"; type: "QQuickAnchorLine"; isReadonly: true } + Property { name: "horizontalCenter"; type: "QQuickAnchorLine"; isReadonly: true } + Property { name: "top"; type: "QQuickAnchorLine"; isReadonly: true } + Property { name: "bottom"; type: "QQuickAnchorLine"; isReadonly: true } + Property { name: "verticalCenter"; type: "QQuickAnchorLine"; isReadonly: true } + Property { name: "baseline"; type: "QQuickAnchorLine"; isReadonly: true } + Property { name: "baselineOffset"; type: "double" } + Property { name: "clip"; type: "bool" } + Property { name: "focus"; type: "bool" } + Property { name: "activeFocus"; type: "bool"; isReadonly: true } + Property { name: "activeFocusOnTab"; revision: 1; type: "bool" } + Property { name: "rotation"; type: "double" } + Property { name: "scale"; type: "double" } + Property { name: "transformOrigin"; type: "TransformOrigin" } + Property { name: "transformOriginPoint"; type: "QPointF"; isReadonly: true } + Property { name: "transform"; type: "QQuickTransform"; isList: true; isReadonly: true } + Property { name: "smooth"; type: "bool" } + Property { name: "antialiasing"; type: "bool" } + Property { name: "implicitWidth"; type: "double" } + Property { name: "implicitHeight"; type: "double" } + Property { name: "containmentMask"; revision: 11; type: "QObject"; isPointer: true } + Property { name: "layer"; type: "QQuickItemLayer"; isReadonly: true; isPointer: true } + Signal { + name: "childrenRectChanged" + Parameter { type: "QRectF" } + } + Signal { + name: "baselineOffsetChanged" + Parameter { type: "double" } + } + Signal { + name: "stateChanged" + Parameter { type: "string" } + } + Signal { + name: "focusChanged" + Parameter { type: "bool" } + } + Signal { + name: "activeFocusChanged" + Parameter { type: "bool" } + } + Signal { + name: "activeFocusOnTabChanged" + revision: 1 + Parameter { type: "bool" } + } + Signal { + name: "parentChanged" + Parameter { type: "QQuickItem"; isPointer: true } + } + Signal { + name: "transformOriginChanged" + Parameter { type: "TransformOrigin" } + } + Signal { + name: "smoothChanged" + Parameter { type: "bool" } + } + Signal { + name: "antialiasingChanged" + Parameter { type: "bool" } + } + Signal { + name: "clipChanged" + Parameter { type: "bool" } + } + Signal { + name: "windowChanged" + revision: 1 + Parameter { name: "window"; type: "QQuickWindow"; isPointer: true } + } + Signal { name: "containmentMaskChanged"; revision: 11 } + Method { name: "update" } + Method { + name: "grabToImage" + revision: 4 + type: "bool" + Parameter { name: "callback"; type: "QJSValue" } + Parameter { name: "targetSize"; type: "QSize" } + } + Method { + name: "grabToImage" + revision: 4 + type: "bool" + Parameter { name: "callback"; type: "QJSValue" } + } + Method { + name: "contains" + type: "bool" + Parameter { name: "point"; type: "QPointF" } + } + Method { + name: "mapFromItem" + Parameter { type: "QQmlV4Function"; isPointer: true } + } + Method { + name: "mapToItem" + Parameter { type: "QQmlV4Function"; isPointer: true } + } + Method { + name: "mapFromGlobal" + revision: 7 + Parameter { type: "QQmlV4Function"; isPointer: true } + } + Method { + name: "mapToGlobal" + revision: 7 + Parameter { type: "QQmlV4Function"; isPointer: true } + } + Method { name: "forceActiveFocus" } + Method { + name: "forceActiveFocus" + Parameter { name: "reason"; type: "Qt::FocusReason" } + } + Method { + name: "nextItemInFocusChain" + revision: 1 + type: "QQuickItem*" + Parameter { name: "forward"; type: "bool" } + } + Method { name: "nextItemInFocusChain"; revision: 1; type: "QQuickItem*" } + Method { + name: "childAt" + type: "QQuickItem*" + Parameter { name: "x"; type: "double" } + Parameter { name: "y"; type: "double" } + } + } + Component { name: "QQuickMaterialBusyIndicator" defaultProperty: "data" prototype: "QQuickItem" @@ -152,6 +328,7 @@ Module { Property { name: "toolBarColor"; type: "QColor"; isReadonly: true } Property { name: "toolTextColor"; type: "QColor"; isReadonly: true } Property { name: "spinBoxDisabledIconColor"; type: "QColor"; isReadonly: true } + Property { name: "sliderDisabledColor"; revision: 15; type: "QColor"; isReadonly: true } Property { name: "touchTarget"; type: "int"; isReadonly: true } Property { name: "buttonHeight"; type: "int"; isReadonly: true } Property { name: "delegateHeight"; type: "int"; isReadonly: true } diff --git a/src/imports/controls/material/qmldir b/src/imports/controls/material/qmldir index 870a0382..d48b7b12 100644 --- a/src/imports/controls/material/qmldir +++ b/src/imports/controls/material/qmldir @@ -1,4 +1,4 @@ module QtQuick.Controls.Material -plugin qtquickcontrols2materialstyleplugin +plugin qqc2materialstyleplugin classname QtQuickControls2MaterialStylePlugin depends QtQuick.Controls 2.5 diff --git a/src/imports/controls/material/qquickmaterialstyle.cpp b/src/imports/controls/material/qquickmaterialstyle.cpp index 77a65927..d343f2f5 100644 --- a/src/imports/controls/material/qquickmaterialstyle.cpp +++ b/src/imports/controls/material/qquickmaterialstyle.cpp @@ -422,6 +422,8 @@ static const QRgb rippleColorLight = 0x10000000; static const QRgb rippleColorDark = 0x20FFFFFF; static const QRgb spinBoxDisabledIconColorLight = 0xFFCCCCCC; static const QRgb spinBoxDisabledIconColorDark = 0xFF666666; +static const QRgb sliderDisabledColorLight = 0xFF9E9E9E; +static const QRgb sliderDisabledColorDark = 0xFF616161; static QQuickMaterialStyle::Theme effectiveTheme(QQuickMaterialStyle::Theme theme) { @@ -467,14 +469,13 @@ void QQuickMaterialStyle::setTheme(Theme theme) m_theme = theme; propagateTheme(); - emit themeChanged(); - emit paletteChanged(); + themeChange(); if (!m_customAccent) - emit accentChanged(); + accentChange(); if (!m_hasBackground) - emit backgroundChanged(); + backgroundChange(); if (!m_hasForeground) - emit foregroundChanged(); + foregroundChange(); } void QQuickMaterialStyle::inheritTheme(Theme theme) @@ -484,14 +485,13 @@ void QQuickMaterialStyle::inheritTheme(Theme theme) m_theme = theme; propagateTheme(); - emit themeChanged(); - emit paletteChanged(); + themeChange(); if (!m_customAccent) - emit accentChanged(); + accentChange(); if (!m_hasBackground) - emit backgroundChanged(); + backgroundChange(); if (!m_hasForeground) - emit foregroundChanged(); + foregroundChange(); } void QQuickMaterialStyle::propagateTheme() @@ -514,6 +514,19 @@ void QQuickMaterialStyle::resetTheme() inheritTheme(material ? material->theme() : globalTheme); } +void QQuickMaterialStyle::themeChange() +{ + emit themeChanged(); + emit themeOrAccentChanged(); + emit primaryHighlightedTextColor(); + emit buttonColorChanged(); + emit buttonDisabledColorChanged(); + emit dialogColorChanged(); + emit tooltipColorChanged(); + emit toolBarColorChanged(); + emit toolTextColorChanged(); +} + QVariant QQuickMaterialStyle::primary() const { return primaryColor(); @@ -533,8 +546,7 @@ void QQuickMaterialStyle::setPrimary(const QVariant &var) m_customPrimary = custom; m_primary = primary; propagatePrimary(); - emit primaryChanged(); - emit paletteChanged(); + primaryChange(); } void QQuickMaterialStyle::inheritPrimary(uint primary, bool custom) @@ -545,8 +557,7 @@ void QQuickMaterialStyle::inheritPrimary(uint primary, bool custom) m_customPrimary = custom; m_primary = primary; propagatePrimary(); - emit primaryChanged(); - emit paletteChanged(); + primaryChange(); } void QQuickMaterialStyle::propagatePrimary() @@ -573,6 +584,13 @@ void QQuickMaterialStyle::resetPrimary() inheritPrimary(globalPrimary, false); } +void QQuickMaterialStyle::primaryChange() +{ + emit primaryChanged(); + emit toolBarColorChanged(); + emit toolTextColorChanged(); +} + QVariant QQuickMaterialStyle::accent() const { return accentColor(); @@ -592,8 +610,7 @@ void QQuickMaterialStyle::setAccent(const QVariant &var) m_customAccent = custom; m_accent = accent; propagateAccent(); - emit accentChanged(); - emit paletteChanged(); + accentChange(); } void QQuickMaterialStyle::inheritAccent(uint accent, bool custom) @@ -604,8 +621,7 @@ void QQuickMaterialStyle::inheritAccent(uint accent, bool custom) m_customAccent = custom; m_accent = accent; propagateAccent(); - emit accentChanged(); - emit paletteChanged(); + accentChange(); } void QQuickMaterialStyle::propagateAccent() @@ -632,6 +648,13 @@ void QQuickMaterialStyle::resetAccent() inheritAccent(globalAccent, false); } +void QQuickMaterialStyle::accentChange() +{ + emit accentChanged(); + emit themeOrAccentChanged(); + emit buttonColorChanged(); +} + QVariant QQuickMaterialStyle::foreground() const { if (!m_hasForeground) @@ -658,7 +681,7 @@ void QQuickMaterialStyle::setForeground(const QVariant &var) m_customForeground = custom; m_foreground = foreground; propagateForeground(); - emit foregroundChanged(); + foregroundChange(); } void QQuickMaterialStyle::inheritForeground(uint foreground, bool custom, bool has) @@ -670,7 +693,7 @@ void QQuickMaterialStyle::inheritForeground(uint foreground, bool custom, bool h m_customForeground = custom; m_foreground = foreground; propagateForeground(); - emit foregroundChanged(); + foregroundChange(); } void QQuickMaterialStyle::propagateForeground() @@ -695,6 +718,14 @@ void QQuickMaterialStyle::resetForeground() inheritForeground(material ? material->m_foreground : globalForeground, true, material ? material->m_hasForeground : false); } +void QQuickMaterialStyle::foregroundChange() +{ + emit foregroundChanged(); + emit primaryHighlightedTextColorChanged(); + // TODO: This causes a binding loop: see QTBUG-85699 and the comments on its fix +// emit toolTextColorChanged(); +} + QVariant QQuickMaterialStyle::background() const { return backgroundColor(); @@ -715,8 +746,7 @@ void QQuickMaterialStyle::setBackground(const QVariant &var) m_customBackground = custom; m_background = background; propagateBackground(); - emit backgroundChanged(); - emit paletteChanged(); + backgroundChange(); } void QQuickMaterialStyle::inheritBackground(uint background, bool custom, bool has) @@ -728,8 +758,7 @@ void QQuickMaterialStyle::inheritBackground(uint background, bool custom, bool h m_customBackground = custom; m_background = background; propagateBackground(); - emit backgroundChanged(); - emit paletteChanged(); + backgroundChange(); } void QQuickMaterialStyle::propagateBackground() @@ -754,6 +783,15 @@ void QQuickMaterialStyle::resetBackground() inheritBackground(material ? material->m_background : globalBackground, true, material ? material->m_hasBackground : false); } +void QQuickMaterialStyle::backgroundChange() +{ + emit backgroundChanged(); + emit buttonColorChanged(); + emit dialogColorChanged(); + emit tooltipColorChanged(); + emit toolBarColorChanged(); +} + int QQuickMaterialStyle::elevation() const { return m_elevation; @@ -765,7 +803,7 @@ void QQuickMaterialStyle::setElevation(int elevation) return; m_elevation = elevation; - emit elevationChanged(); + elevationChange(); } void QQuickMaterialStyle::resetElevation() @@ -773,6 +811,12 @@ void QQuickMaterialStyle::resetElevation() setElevation(0); } +void QQuickMaterialStyle::elevationChange() +{ + emit elevationChanged(); + emit buttonDisabledColorChanged(); +} + QColor QQuickMaterialStyle::primaryColor() const { if (m_customPrimary) @@ -1037,6 +1081,11 @@ QColor QQuickMaterialStyle::spinBoxDisabledIconColor() const return QColor::fromRgba(m_theme == Light ? spinBoxDisabledIconColorLight : spinBoxDisabledIconColorDark); } +QColor QQuickMaterialStyle::sliderDisabledColor() const +{ + return QColor::fromRgba(m_theme == Light ? sliderDisabledColorLight : sliderDisabledColorDark); +} + QColor QQuickMaterialStyle::color(QQuickMaterialStyle::Color color, QQuickMaterialStyle::Shade shade) const { int count = sizeof(colors) / sizeof(colors[0]); diff --git a/src/imports/controls/material/qquickmaterialstyle_p.h b/src/imports/controls/material/qquickmaterialstyle_p.h index 4b0f7b31..1207e9cc 100644 --- a/src/imports/controls/material/qquickmaterialstyle_p.h +++ b/src/imports/controls/material/qquickmaterialstyle_p.h @@ -66,37 +66,38 @@ class QQuickMaterialStyle : public QQuickAttachedObject Q_PROPERTY(QColor primaryColor READ primaryColor NOTIFY primaryChanged FINAL) // TODO: remove? Q_PROPERTY(QColor accentColor READ accentColor NOTIFY accentChanged FINAL) // TODO: remove? Q_PROPERTY(QColor backgroundColor READ backgroundColor NOTIFY backgroundChanged FINAL) - Q_PROPERTY(QColor primaryTextColor READ primaryTextColor NOTIFY paletteChanged FINAL) - Q_PROPERTY(QColor primaryHighlightedTextColor READ primaryHighlightedTextColor NOTIFY paletteChanged FINAL) - Q_PROPERTY(QColor secondaryTextColor READ secondaryTextColor NOTIFY paletteChanged FINAL) - Q_PROPERTY(QColor hintTextColor READ hintTextColor NOTIFY paletteChanged FINAL) - Q_PROPERTY(QColor textSelectionColor READ textSelectionColor NOTIFY paletteChanged FINAL) - Q_PROPERTY(QColor dropShadowColor READ dropShadowColor NOTIFY paletteChanged FINAL) - Q_PROPERTY(QColor dividerColor READ dividerColor NOTIFY paletteChanged FINAL) - Q_PROPERTY(QColor iconColor READ iconColor NOTIFY paletteChanged FINAL) - Q_PROPERTY(QColor iconDisabledColor READ iconDisabledColor NOTIFY paletteChanged FINAL) - Q_PROPERTY(QColor buttonColor READ buttonColor NOTIFY paletteChanged FINAL) - Q_PROPERTY(QColor buttonDisabledColor READ buttonDisabledColor NOTIFY paletteChanged FINAL) - Q_PROPERTY(QColor highlightedButtonColor READ highlightedButtonColor NOTIFY paletteChanged FINAL) - Q_PROPERTY(QColor frameColor READ frameColor NOTIFY paletteChanged FINAL) - Q_PROPERTY(QColor rippleColor READ rippleColor NOTIFY paletteChanged FINAL) - Q_PROPERTY(QColor highlightedRippleColor READ highlightedRippleColor NOTIFY paletteChanged FINAL) - Q_PROPERTY(QColor switchUncheckedTrackColor READ switchUncheckedTrackColor NOTIFY paletteChanged FINAL) - Q_PROPERTY(QColor switchCheckedTrackColor READ switchCheckedTrackColor NOTIFY paletteChanged FINAL) - Q_PROPERTY(QColor switchUncheckedHandleColor READ switchUncheckedHandleColor NOTIFY paletteChanged FINAL) - Q_PROPERTY(QColor switchCheckedHandleColor READ switchCheckedHandleColor NOTIFY paletteChanged FINAL) - Q_PROPERTY(QColor switchDisabledTrackColor READ switchDisabledTrackColor NOTIFY paletteChanged FINAL) - Q_PROPERTY(QColor switchDisabledHandleColor READ switchDisabledHandleColor NOTIFY paletteChanged FINAL) - Q_PROPERTY(QColor scrollBarColor READ scrollBarColor NOTIFY paletteChanged FINAL) - Q_PROPERTY(QColor scrollBarHoveredColor READ scrollBarHoveredColor NOTIFY paletteChanged FINAL) - Q_PROPERTY(QColor scrollBarPressedColor READ scrollBarPressedColor NOTIFY paletteChanged FINAL) - Q_PROPERTY(QColor dialogColor READ dialogColor NOTIFY paletteChanged FINAL) - Q_PROPERTY(QColor backgroundDimColor READ backgroundDimColor NOTIFY paletteChanged FINAL) - Q_PROPERTY(QColor listHighlightColor READ listHighlightColor NOTIFY paletteChanged FINAL) - Q_PROPERTY(QColor tooltipColor READ tooltipColor NOTIFY paletteChanged FINAL) - Q_PROPERTY(QColor toolBarColor READ toolBarColor NOTIFY paletteChanged FINAL) - Q_PROPERTY(QColor toolTextColor READ toolTextColor NOTIFY paletteChanged FINAL) - Q_PROPERTY(QColor spinBoxDisabledIconColor READ spinBoxDisabledIconColor NOTIFY paletteChanged FINAL) + Q_PROPERTY(QColor primaryTextColor READ primaryTextColor NOTIFY themeChanged FINAL) + Q_PROPERTY(QColor primaryHighlightedTextColor READ primaryHighlightedTextColor NOTIFY primaryHighlightedTextColorChanged FINAL) + Q_PROPERTY(QColor secondaryTextColor READ secondaryTextColor NOTIFY themeChanged FINAL) + Q_PROPERTY(QColor hintTextColor READ hintTextColor NOTIFY themeChanged FINAL) + Q_PROPERTY(QColor textSelectionColor READ textSelectionColor NOTIFY themeOrAccentChanged FINAL) + Q_PROPERTY(QColor dropShadowColor READ dropShadowColor CONSTANT FINAL) + Q_PROPERTY(QColor dividerColor READ dividerColor NOTIFY themeChanged FINAL) + Q_PROPERTY(QColor iconColor READ iconColor NOTIFY themeChanged FINAL) + Q_PROPERTY(QColor iconDisabledColor READ iconDisabledColor NOTIFY themeChanged FINAL) + Q_PROPERTY(QColor buttonColor READ buttonColor NOTIFY buttonColorChanged FINAL) + Q_PROPERTY(QColor buttonDisabledColor READ buttonDisabledColor NOTIFY buttonDisabledColorChanged FINAL) + Q_PROPERTY(QColor highlightedButtonColor READ highlightedButtonColor NOTIFY buttonColorChanged FINAL) + Q_PROPERTY(QColor frameColor READ frameColor NOTIFY themeChanged FINAL) + Q_PROPERTY(QColor rippleColor READ rippleColor NOTIFY themeChanged FINAL) + Q_PROPERTY(QColor highlightedRippleColor READ highlightedRippleColor NOTIFY themeOrAccentChanged FINAL) + Q_PROPERTY(QColor switchUncheckedTrackColor READ switchUncheckedTrackColor NOTIFY themeChanged FINAL) + Q_PROPERTY(QColor switchCheckedTrackColor READ switchCheckedTrackColor NOTIFY themeOrAccentChanged FINAL) + Q_PROPERTY(QColor switchUncheckedHandleColor READ switchUncheckedHandleColor NOTIFY themeChanged FINAL) + Q_PROPERTY(QColor switchCheckedHandleColor READ switchCheckedHandleColor NOTIFY themeOrAccentChanged FINAL) + Q_PROPERTY(QColor switchDisabledTrackColor READ switchDisabledTrackColor NOTIFY themeChanged FINAL) + Q_PROPERTY(QColor switchDisabledHandleColor READ switchDisabledHandleColor NOTIFY themeChanged FINAL) + Q_PROPERTY(QColor scrollBarColor READ scrollBarColor NOTIFY themeChanged FINAL) + Q_PROPERTY(QColor scrollBarHoveredColor READ scrollBarHoveredColor NOTIFY themeChanged FINAL) + Q_PROPERTY(QColor scrollBarPressedColor READ scrollBarPressedColor NOTIFY themeChanged FINAL) + Q_PROPERTY(QColor dialogColor READ dialogColor NOTIFY dialogColorChanged FINAL) + Q_PROPERTY(QColor backgroundDimColor READ backgroundDimColor NOTIFY themeChanged FINAL) + Q_PROPERTY(QColor listHighlightColor READ listHighlightColor NOTIFY themeChanged FINAL) + Q_PROPERTY(QColor tooltipColor READ tooltipColor NOTIFY tooltipColorChanged FINAL) + Q_PROPERTY(QColor toolBarColor READ toolBarColor NOTIFY toolBarColorChanged FINAL) + Q_PROPERTY(QColor toolTextColor READ toolTextColor NOTIFY toolTextColorChanged FINAL) + Q_PROPERTY(QColor spinBoxDisabledIconColor READ spinBoxDisabledIconColor NOTIFY themeChanged FINAL) + Q_PROPERTY(QColor sliderDisabledColor READ sliderDisabledColor NOTIFY themeChanged FINAL REVISION 15) Q_PROPERTY(int touchTarget READ touchTarget CONSTANT FINAL) Q_PROPERTY(int buttonHeight READ buttonHeight CONSTANT FINAL) @@ -173,34 +174,40 @@ public: void inheritTheme(Theme theme); void propagateTheme(); void resetTheme(); + void themeChange(); QVariant primary() const; void setPrimary(const QVariant &accent); void inheritPrimary(uint primary, bool custom); void propagatePrimary(); void resetPrimary(); + void primaryChange(); QVariant accent() const; void setAccent(const QVariant &accent); void inheritAccent(uint accent, bool custom); void propagateAccent(); void resetAccent(); + void accentChange(); QVariant foreground() const; void setForeground(const QVariant &foreground); void inheritForeground(uint foreground, bool custom, bool has); void propagateForeground(); void resetForeground(); + void foregroundChange(); QVariant background() const; void setBackground(const QVariant &background); void inheritBackground(uint background, bool custom, bool has); void propagateBackground(); void resetBackground(); + void backgroundChange(); int elevation() const; void setElevation(int elevation); void resetElevation(); + void elevationChange(); QColor primaryColor() const; QColor accentColor() const; @@ -237,6 +244,7 @@ public: QColor toolBarColor() const; QColor toolTextColor() const; QColor spinBoxDisabledIconColor() const; + QColor sliderDisabledColor() const; Q_INVOKABLE QColor color(Color color, Shade shade = Shade500) const; Q_INVOKABLE QColor shade(const QColor &color, Shade shade) const; @@ -263,7 +271,15 @@ Q_SIGNALS: void backgroundChanged(); void elevationChanged(); - void paletteChanged(); + void themeOrAccentChanged(); + + void primaryHighlightedTextColorChanged(); + void buttonColorChanged(); + void buttonDisabledColorChanged(); + void dialogColorChanged(); + void tooltipColorChanged(); + void toolBarColorChanged(); + void toolTextColorChanged(); protected: void attachedParentChange(QQuickAttachedObject *newParent, QQuickAttachedObject *oldParent) override; diff --git a/src/imports/controls/material/shaders/+qsb/RectangularGlow.frag b/src/imports/controls/material/shaders/+qsb/RectangularGlow.frag Binary files differindex a805b134..5cfa2db6 100644 --- a/src/imports/controls/material/shaders/+qsb/RectangularGlow.frag +++ b/src/imports/controls/material/shaders/+qsb/RectangularGlow.frag diff --git a/src/imports/controls/material/shaders/compile.bat b/src/imports/controls/material/shaders/compile.bat new file mode 100644 index 00000000..e87efa7a --- /dev/null +++ b/src/imports/controls/material/shaders/compile.bat @@ -0,0 +1,40 @@ +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: +:: Copyright (C) 2019 The Qt Company Ltd. +:: Contact: https://www.qt.io/licensing/ +:: +:: This file is part of the QtQuick module of the Qt Toolkit. +:: +:: $QT_BEGIN_LICENSE:LGPL$ +:: Commercial License Usage +:: Licensees holding valid commercial Qt licenses may use this file in +:: accordance with the commercial license agreement provided with the +:: Software or, alternatively, in accordance with the terms contained in +:: a written agreement between you and The Qt Company. For licensing terms +:: and conditions see https://www.qt.io/terms-conditions. For further +:: information use the contact form at https://www.qt.io/contact-us. +:: +:: GNU Lesser General Public License Usage +:: Alternatively, this file may be used under the terms of the GNU Lesser +:: General Public License version 3 as published by the Free Software +:: Foundation and appearing in the file LICENSE.LGPL3 included in the +:: packaging of this file. Please review the following information to +:: ensure the GNU Lesser General Public License version 3 requirements +:: will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +:: +:: GNU General Public License Usage +:: Alternatively, this file may be used under the terms of the GNU +:: General Public License version 2.0 or (at your option) the GNU General +:: Public license version 3 or any later version approved by the KDE Free +:: Qt Foundation. The licenses are as published by the Free Software +:: Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +:: included in the packaging of this file. Please review the following +:: information to ensure the GNU General Public License requirements will +:: be met: https://www.gnu.org/licenses/gpl-2.0.html and +:: https://www.gnu.org/licenses/gpl-3.0.html. +:: +:: $QT_END_LICENSE$ +:: +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o +qsb/RectangularGlow.frag RectangularGlow_rhi.frag |