diff options
Diffstat (limited to 'src/imports/controls')
75 files changed, 1374 insertions, 212 deletions
diff --git a/src/imports/controls/CheckBox.qml b/src/imports/controls/CheckBox.qml index c58399f7..b1f50ed1 100644 --- a/src/imports/controls/CheckBox.qml +++ b/src/imports/controls/CheckBox.qml @@ -56,7 +56,7 @@ T.CheckBox { implicitWidth: 28 implicitHeight: 28 - x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 + x: control.text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 y: control.topPadding + (control.availableHeight - height) / 2 color: control.down ? control.palette.light : control.palette.base diff --git a/src/imports/controls/ComboBox.qml b/src/imports/controls/ComboBox.qml index 3bca9c02..8eefc686 100644 --- a/src/imports/controls/ComboBox.qml +++ b/src/imports/controls/ComboBox.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T +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 T.ComboBox { id: control diff --git a/src/imports/controls/Dial.qml b/src/imports/controls/Dial.qml index b6324db5..cc4618a5 100644 --- a/src/imports/controls/Dial.qml +++ b/src/imports/controls/Dial.qml @@ -56,8 +56,8 @@ T.Dial { } handle: ColorImage { - x: background.x + background.width / 2 - handle.width / 2 - y: background.y + background.height / 2 - handle.height / 2 + x: control.background.x + control.background.width / 2 - control.handle.width / 2 + y: control.background.y + control.background.height / 2 - control.handle.height / 2 width: 14 height: 10 defaultColor: "#353637" @@ -67,12 +67,12 @@ T.Dial { opacity: control.enabled ? 1 : 0.3 transform: [ Translate { - y: -Math.min(background.width, background.height) * 0.4 + handle.height / 2 + y: -Math.min(control.background.width, control.background.height) * 0.4 + control.handle.height / 2 }, Rotation { angle: control.angle - origin.x: handle.width / 2 - origin.y: handle.height / 2 + origin.x: control.handle.width / 2 + origin.y: control.handle.height / 2 } ] } diff --git a/src/imports/controls/RadioButton.qml b/src/imports/controls/RadioButton.qml index 726e8862..cdf0c30e 100644 --- a/src/imports/controls/RadioButton.qml +++ b/src/imports/controls/RadioButton.qml @@ -56,7 +56,7 @@ T.RadioButton { implicitWidth: 28 implicitHeight: 28 - x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 + x: control.text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 y: control.topPadding + (control.availableHeight - height) / 2 radius: width / 2 diff --git a/src/imports/controls/ScrollBar.qml b/src/imports/controls/ScrollBar.qml index 1cff0afc..0948fb1d 100644 --- a/src/imports/controls/ScrollBar.qml +++ b/src/imports/controls/ScrollBar.qml @@ -49,6 +49,7 @@ T.ScrollBar { padding: 2 visible: control.policy !== T.ScrollBar.AlwaysOff + minimumSize: orientation == Qt.Horizontal ? height / width : width / height contentItem: Rectangle { implicitWidth: control.interactive ? 6 : 2 diff --git a/src/imports/controls/SpinBox.qml b/src/imports/controls/SpinBox.qml index 824ce061..d1c2ea5b 100644 --- a/src/imports/controls/SpinBox.qml +++ b/src/imports/controls/SpinBox.qml @@ -77,9 +77,9 @@ T.SpinBox { inputMethodHints: control.inputMethodHints Rectangle { - x: -6 - (down.indicator ? 1 : 0) + x: -6 - (control.down.indicator ? 1 : 0) y: -6 - width: control.width - (up.indicator ? up.indicator.width - 1 : 0) - (down.indicator ? down.indicator.width - 1 : 0) + width: control.width - (control.up.indicator ? control.up.indicator.width - 1 : 0) - (control.down.indicator ? control.down.indicator.width - 1 : 0) height: control.height visible: control.activeFocus color: "transparent" @@ -93,7 +93,7 @@ T.SpinBox { height: parent.height implicitWidth: 40 implicitHeight: 40 - color: up.pressed ? control.palette.mid : control.palette.button + color: control.up.pressed ? control.palette.mid : control.palette.button Rectangle { x: (parent.width - width) / 2 @@ -116,7 +116,7 @@ T.SpinBox { height: parent.height implicitWidth: 40 implicitHeight: 40 - color: down.pressed ? control.palette.mid : control.palette.button + color: control.down.pressed ? control.palette.mid : control.palette.button Rectangle { x: (parent.width - width) / 2 diff --git a/src/imports/controls/Switch.qml b/src/imports/controls/Switch.qml index 522d9980..f62e2502 100644 --- a/src/imports/controls/Switch.qml +++ b/src/imports/controls/Switch.qml @@ -55,7 +55,7 @@ T.Switch { implicitWidth: 56 implicitHeight: 28 - x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 + x: control.text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 y: control.topPadding + (control.availableHeight - height) / 2 radius: 8 diff --git a/src/imports/controls/SwitchDelegate.qml b/src/imports/controls/SwitchDelegate.qml index 0abf7641..d6447e77 100644 --- a/src/imports/controls/SwitchDelegate.qml +++ b/src/imports/controls/SwitchDelegate.qml @@ -59,7 +59,7 @@ T.SwitchDelegate { implicitWidth: 56 implicitHeight: 28 - x: text ? (control.mirrored ? control.leftPadding : control.width - width - control.rightPadding) : control.leftPadding + (control.availableWidth - width) / 2 + x: control.text ? (control.mirrored ? control.leftPadding : control.width - width - control.rightPadding) : control.leftPadding + (control.availableWidth - width) / 2 y: control.topPadding + (control.availableHeight - height) / 2 radius: 8 diff --git a/src/imports/controls/TabButton.qml b/src/imports/controls/TabButton.qml index 34a5a115..f8b303ea 100644 --- a/src/imports/controls/TabButton.qml +++ b/src/imports/controls/TabButton.qml @@ -62,7 +62,7 @@ T.TabButton { icon: control.icon text: control.text font: control.font - color: checked ? control.palette.windowText : control.palette.brightText + color: control.checked ? control.palette.windowText : control.palette.brightText } background: Rectangle { diff --git a/src/imports/controls/Tumbler.qml b/src/imports/controls/Tumbler.qml index 621f4113..cd10263b 100644 --- a/src/imports/controls/Tumbler.qml +++ b/src/imports/controls/Tumbler.qml @@ -62,11 +62,11 @@ T.Tumbler { model: control.model delegate: control.delegate path: Path { - startX: contentItem.width / 2 - startY: -contentItem.delegateHeight / 2 + startX: control.contentItem.width / 2 + startY: -control.contentItem.delegateHeight / 2 PathLine { - x: contentItem.width / 2 - y: (control.visibleItemCount + 1) * contentItem.delegateHeight - contentItem.delegateHeight / 2 + x: control.contentItem.width / 2 + y: (control.visibleItemCount + 1) * control.contentItem.delegateHeight - control.contentItem.delegateHeight / 2 } } diff --git a/src/imports/controls/designer/designer.pri b/src/imports/controls/designer/designer.pri index 6ae9d5bb..3ad99df7 100644 --- a/src/imports/controls/designer/designer.pri +++ b/src/imports/controls/designer/designer.pri @@ -48,4 +48,4 @@ AUX_QML_FILES += \ $$PWD/TumblerSpecifics.qml AUX_QML_FILES += \ - $$PWD/images/*.png + $$files($$PWD/images/*.png) diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-combobox-valuerole.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-combobox-valuerole.qml new file mode 100644 index 00000000..4d7ae3d3 --- /dev/null +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-combobox-valuerole.qml @@ -0,0 +1,58 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** 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 Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.14 +import QtQuick.Controls 2.14 + +//! [file] +ApplicationWindow { + width: 640 + height: 480 + visible: true + + // Used as an example of a backend - this would usually be + // e.g. a C++ type exposed to QML. + QtObject { + id: backend + property int modifier + } + + ComboBox { + textRole: "text" + valueRole: "value" + // When an item is selected, update the backend. + onActivated: backend.modifier = currentValue + // Set the initial currentIndex to the value stored in the backend. + Component.onCompleted: currentIndex = indexOfValue(backend.modifier) + model: [ + { value: Qt.NoModifier, text: qsTr("No modifier") }, + { value: Qt.ShiftModifier, text: qsTr("Shift") }, + { value: Qt.ControlModifier, text: qsTr("Control") } + ] + } +} +//! [file] diff --git a/src/imports/controls/fusion/ButtonPanel.qml b/src/imports/controls/fusion/ButtonPanel.qml index 3250044b..125aa2f3 100644 --- a/src/imports/controls/fusion/ButtonPanel.qml +++ b/src/imports/controls/fusion/ButtonPanel.qml @@ -55,11 +55,11 @@ Rectangle { id: buttonGradient GradientStop { position: 0 - color: Fusion.gradientStart(Fusion.buttonColor(control.palette, panel.highlighted, control.down, control.hovered)) + color: Fusion.gradientStart(Fusion.buttonColor(panel.control.palette, panel.highlighted, panel.control.down, panel.control.hovered)) } GradientStop { position: 1 - color: Fusion.gradientStop(Fusion.buttonColor(control.palette, panel.highlighted, control.down, control.hovered)) + color: Fusion.gradientStop(Fusion.buttonColor(panel.control.palette, panel.highlighted, panel.control.down, panel.control.hovered)) } } diff --git a/src/imports/controls/fusion/CheckBox.qml b/src/imports/controls/fusion/CheckBox.qml index f90c80fb..edb4c77f 100644 --- a/src/imports/controls/fusion/CheckBox.qml +++ b/src/imports/controls/fusion/CheckBox.qml @@ -54,7 +54,7 @@ T.CheckBox { spacing: 6 indicator: CheckIndicator { - x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 + x: control.text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 y: control.topPadding + (control.availableHeight - height) / 2 control: control } diff --git a/src/imports/controls/fusion/CheckIndicator.qml b/src/imports/controls/fusion/CheckIndicator.qml index 314a6798..7dcfee30 100644 --- a/src/imports/controls/fusion/CheckIndicator.qml +++ b/src/imports/controls/fusion/CheckIndicator.qml @@ -59,7 +59,7 @@ Rectangle { width: parent.width - 2 height: 1 color: Fusion.topShadow - visible: control.enabled && !control.down + visible: indicator.control.enabled && !indicator.control.down } ColorImage { @@ -67,7 +67,7 @@ Rectangle { y: (parent.height - height) / 2 color: Color.transparent(indicator.checkMarkColor, 210 / 255) source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Fusion/images/checkmark.png" - visible: control.checkState === Qt.Checked || (control.checked && control.checkState === undefined) + visible: indicator.control.checkState === Qt.Checked || (indicator.control.checked && indicator.control.checkState === undefined) } Rectangle { @@ -75,7 +75,7 @@ Rectangle { width: parent.width - 6 height: parent.width - 6 - visible: control.checkState === Qt.PartiallyChecked + visible: indicator.control.checkState === Qt.PartiallyChecked gradient: Gradient { GradientStop { diff --git a/src/imports/controls/fusion/ComboBox.qml b/src/imports/controls/fusion/ComboBox.qml index 3ecb0cf2..e9b836ef 100644 --- a/src/imports/controls/fusion/ComboBox.qml +++ b/src/imports/controls/fusion/ComboBox.qml @@ -34,13 +34,13 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Controls.Fusion 2.12 -import QtQuick.Controls.Fusion.impl 2.12 +import QtQuick 2.14 +import QtQuick.Window 2.14 +import QtQuick.Templates 2.14 as T +import QtQuick.Controls 2.14 +import QtQuick.Controls.impl 2.14 +import QtQuick.Controls.Fusion 2.14 +import QtQuick.Controls.Fusion.impl 2.14 T.ComboBox { id: control @@ -159,7 +159,7 @@ T.ComboBox { } background: Rectangle { - color: popup.palette.window + color: control.popup.palette.window border.color: Fusion.outline(control.palette) Rectangle { diff --git a/src/imports/controls/fusion/Dial.qml b/src/imports/controls/fusion/Dial.qml index 423087c9..a1337242 100644 --- a/src/imports/controls/fusion/Dial.qml +++ b/src/imports/controls/fusion/Dial.qml @@ -57,19 +57,19 @@ T.Dial { } handle: KnobImpl { - x: background.x + background.width / 2 - handle.width / 2 - y: background.y + background.height / 2 - handle.height / 2 + x: control.background.x + control.background.width / 2 - control.handle.width / 2 + y: control.background.y + control.background.height / 2 - control.handle.height / 2 width: control.width / 7 height: control.height / 7 palette: control.palette transform: [ Translate { - y: -Math.min(background.width, background.height) * 0.42 + handle.height + y: -Math.min(control.background.width, control.background.height) * 0.42 + control.handle.height }, Rotation { angle: control.angle - origin.x: handle.width / 2 - origin.y: handle.height / 2 + origin.x: control.handle.width / 2 + origin.y: control.handle.height / 2 } ] } diff --git a/src/imports/controls/fusion/Page.qml b/src/imports/controls/fusion/Page.qml index 796dff1c..ce4b1d54 100644 --- a/src/imports/controls/fusion/Page.qml +++ b/src/imports/controls/fusion/Page.qml @@ -54,6 +54,6 @@ T.Page { + (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0)) background: Rectangle { - color: palette.window + color: control.palette.window } } diff --git a/src/imports/controls/fusion/Pane.qml b/src/imports/controls/fusion/Pane.qml index 69fbdca0..28be3b47 100644 --- a/src/imports/controls/fusion/Pane.qml +++ b/src/imports/controls/fusion/Pane.qml @@ -52,6 +52,6 @@ T.Pane { padding: 9 background: Rectangle { - color: palette.window + color: control.palette.window } } diff --git a/src/imports/controls/fusion/RadioButton.qml b/src/imports/controls/fusion/RadioButton.qml index fed6fa7c..a940aff3 100644 --- a/src/imports/controls/fusion/RadioButton.qml +++ b/src/imports/controls/fusion/RadioButton.qml @@ -54,7 +54,7 @@ T.RadioButton { spacing: 6 indicator: RadioIndicator { - x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 + x: control.text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 y: control.topPadding + (control.availableHeight - height) / 2 control: control } diff --git a/src/imports/controls/fusion/RadioIndicator.qml b/src/imports/controls/fusion/RadioIndicator.qml index 4b67d24e..c73cd49f 100644 --- a/src/imports/controls/fusion/RadioIndicator.qml +++ b/src/imports/controls/fusion/RadioIndicator.qml @@ -62,7 +62,7 @@ Rectangle { radius: width / 2 color: "transparent" border.color: Fusion.topShadow - visible: control.enabled && !control.down + visible: indicator.control.enabled && !indicator.control.down } Rectangle { @@ -73,6 +73,6 @@ Rectangle { radius: width / 2 color: Color.transparent(indicator.checkMarkColor, 180 / 255) border.color: Color.transparent(indicator.checkMarkColor, 200 / 255) - visible: control.checked + visible: indicator.control.checked } } diff --git a/src/imports/controls/fusion/ScrollBar.qml b/src/imports/controls/fusion/ScrollBar.qml index e4fb7949..93b58f0e 100644 --- a/src/imports/controls/fusion/ScrollBar.qml +++ b/src/imports/controls/fusion/ScrollBar.qml @@ -51,6 +51,7 @@ T.ScrollBar { padding: 2 visible: control.policy !== T.ScrollBar.AlwaysOff + minimumSize: orientation == Qt.Horizontal ? height / width : width / height contentItem: Rectangle { implicitWidth: control.interactive ? 6 : 2 diff --git a/src/imports/controls/fusion/SliderGroove.qml b/src/imports/controls/fusion/SliderGroove.qml index c34217a8..381a02b5 100644 --- a/src/imports/controls/fusion/SliderGroove.qml +++ b/src/imports/controls/fusion/SliderGroove.qml @@ -63,31 +63,31 @@ Rectangle { gradient: Gradient { GradientStop { position: 0 - color: Qt.darker(Fusion.grooveColor(control.palette), 1.1) + color: Qt.darker(Fusion.grooveColor(groove.control.palette), 1.1) } GradientStop { position: 1 - color: Qt.lighter(Fusion.grooveColor(control.palette), 1.1) + color: Qt.lighter(Fusion.grooveColor(groove.control.palette), 1.1) } } Rectangle { - x: control.horizontal ? groove.offset * parent.width : 0 - y: control.horizontal ? 0 : groove.visualProgress * parent.height - width: control.horizontal ? groove.progress * parent.width - groove.offset * parent.width : 5 - height: control.horizontal ? 5 : groove.progress * parent.height - groove.offset * parent.height + x: groove.control.horizontal ? groove.offset * parent.width : 0 + y: groove.control.horizontal ? 0 : groove.visualProgress * parent.height + width: groove.control.horizontal ? groove.progress * parent.width - groove.offset * parent.width : 5 + height: groove.control.horizontal ? 5 : groove.progress * parent.height - groove.offset * parent.height radius: 2 - border.color: Qt.darker(Fusion.highlightedOutline(control.palette), 1.1) + border.color: Qt.darker(Fusion.highlightedOutline(groove.control.palette), 1.1) gradient: Gradient { GradientStop { position: 0 - color: Fusion.highlight(control.palette) + color: Fusion.highlight(groove.control.palette) } GradientStop { position: 1 - color: Qt.lighter(Fusion.highlight(control.palette), 1.2) + color: Qt.lighter(Fusion.highlight(groove.control.palette), 1.2) } } } diff --git a/src/imports/controls/fusion/SpinBox.qml b/src/imports/controls/fusion/SpinBox.qml index fd77f9f3..41754f63 100644 --- a/src/imports/controls/fusion/SpinBox.qml +++ b/src/imports/controls/fusion/SpinBox.qml @@ -145,8 +145,8 @@ T.SpinBox { Rectangle { x: control.mirrored ? 1 : parent.width - width - 1 y: 1 - width: Math.max(up.indicator ? up.indicator.width : 0, - down.indicator ? down.indicator.width : 0) + 1 + width: Math.max(control.up.indicator ? control.up.indicator.width : 0, + control.down.indicator ? control.down.indicator.width : 0) + 1 height: parent.height - 2 radius: 2 diff --git a/src/imports/controls/fusion/Switch.qml b/src/imports/controls/fusion/Switch.qml index edcb3650..bf18003a 100644 --- a/src/imports/controls/fusion/Switch.qml +++ b/src/imports/controls/fusion/Switch.qml @@ -54,7 +54,7 @@ T.Switch { spacing: 6 indicator: SwitchIndicator { - x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 + x: control.text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 y: control.topPadding + (control.availableHeight - height) / 2 control: control } diff --git a/src/imports/controls/fusion/SwitchDelegate.qml b/src/imports/controls/fusion/SwitchDelegate.qml index 0db13b41..67c41924 100644 --- a/src/imports/controls/fusion/SwitchDelegate.qml +++ b/src/imports/controls/fusion/SwitchDelegate.qml @@ -57,7 +57,7 @@ T.SwitchDelegate { icon.height: 16 indicator: SwitchIndicator { - x: text ? (control.mirrored ? control.leftPadding : control.width - width - control.rightPadding) : control.leftPadding + (control.availableWidth - width) / 2 + x: control.text ? (control.mirrored ? control.leftPadding : control.width - width - control.rightPadding) : control.leftPadding + (control.availableWidth - width) / 2 y: control.topPadding + (control.availableHeight - height) / 2 control: control } diff --git a/src/imports/controls/fusion/SwitchIndicator.qml b/src/imports/controls/fusion/SwitchIndicator.qml index f89388c7..ae7c89a0 100644 --- a/src/imports/controls/fusion/SwitchIndicator.qml +++ b/src/imports/controls/fusion/SwitchIndicator.qml @@ -56,44 +56,44 @@ Rectangle { gradient: Gradient { GradientStop { position: 0 - color: Qt.darker(Fusion.grooveColor(control.palette), 1.1) + color: Qt.darker(Fusion.grooveColor(indicator.control.palette), 1.1) } GradientStop { position: 1 - color: Qt.lighter(Fusion.grooveColor(control.palette), 1.1) + color: Qt.lighter(Fusion.grooveColor(indicator.control.palette), 1.1) } } Rectangle { - x: control.mirrored ? handle.x : 0 - width: control.mirrored ? parent.width - handle.x : handle.x + handle.width + x: indicator.control.mirrored ? handle.x : 0 + width: indicator.control.mirrored ? parent.width - handle.x : handle.x + handle.width height: parent.height - opacity: control.checked ? 1 : 0 + opacity: indicator.control.checked ? 1 : 0 Behavior on opacity { - enabled: !control.down + enabled: !indicator.control.down NumberAnimation { duration: 80 } } radius: 2 - border.color: Qt.darker(Fusion.highlightedOutline(control.palette), 1.1) - border.width: control.enabled ? 1 : 0 + border.color: Qt.darker(Fusion.highlightedOutline(indicator.control.palette), 1.1) + border.width: indicator.control.enabled ? 1 : 0 gradient: Gradient { GradientStop { position: 0 - color: Fusion.highlight(control.palette) + color: Fusion.highlight(indicator.control.palette) } GradientStop { position: 1 - color: Qt.lighter(Fusion.highlight(control.palette), 1.2) + color: Qt.lighter(Fusion.highlight(indicator.control.palette), 1.2) } } } Rectangle { id: handle - x: Math.max(0, Math.min(parent.width - width, control.visualPosition * parent.width - (width / 2))) + x: Math.max(0, Math.min(parent.width - width, indicator.control.visualPosition * parent.width - (width / 2))) y: (parent.height - height) / 2 width: 20 height: 16 @@ -102,11 +102,11 @@ Rectangle { gradient: Gradient { GradientStop { position: 0 - color: Fusion.gradientStart(Fusion.buttonColor(control.palette, control.visualFocus, control.pressed, control.hovered)) + color: Fusion.gradientStart(Fusion.buttonColor(indicator.control.palette, indicator.control.visualFocus, indicator.control.pressed, indicator.control.hovered)) } GradientStop { position: 1 - color: Fusion.gradientStop(Fusion.buttonColor(control.palette, control.visualFocus, control.pressed, control.hovered)) + color: Fusion.gradientStop(Fusion.buttonColor(indicator.control.palette, indicator.control.visualFocus, indicator.control.pressed, indicator.control.hovered)) } } border.width: 1 @@ -115,7 +115,7 @@ Rectangle { Rectangle { width: parent.width height: parent.height - border.color: control.visualFocus ? Fusion.highlightedOutline(control.palette) : Fusion.outline(control.palette) + border.color: indicator.control.visualFocus ? Fusion.highlightedOutline(indicator.control.palette) : Fusion.outline(indicator.control.palette) color: "transparent" radius: 2 @@ -130,7 +130,7 @@ Rectangle { } Behavior on x { - enabled: !control.down + enabled: !indicator.control.down SmoothedAnimation { velocity: 200 } } } diff --git a/src/imports/controls/fusion/Tumbler.qml b/src/imports/controls/fusion/Tumbler.qml index 6abf7b5a..0129f06c 100644 --- a/src/imports/controls/fusion/Tumbler.qml +++ b/src/imports/controls/fusion/Tumbler.qml @@ -64,11 +64,11 @@ T.Tumbler { model: control.model delegate: control.delegate path: Path { - startX: contentItem.width / 2 - startY: -contentItem.delegateHeight / 2 + startX: control.contentItem.width / 2 + startY: -control.contentItem.delegateHeight / 2 PathLine { - x: contentItem.width / 2 - y: (control.visibleItemCount + 1) * contentItem.delegateHeight - contentItem.delegateHeight / 2 + x: control.contentItem.width / 2 + y: (control.visibleItemCount + 1) * control.contentItem.delegateHeight - control.contentItem.delegateHeight / 2 } } diff --git a/src/imports/controls/fusion/plugins.qmltypes b/src/imports/controls/fusion/plugins.qmltypes index a70b4901..5140d1e8 100644 --- a/src/imports/controls/fusion/plugins.qmltypes +++ b/src/imports/controls/fusion/plugins.qmltypes @@ -4,7 +4,7 @@ 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.Fusion 2.13' +// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQuick.Controls.Fusion 2.14' Module { dependencies: ["QtQuick.Controls 2.0"] @@ -144,6 +144,206 @@ Module { } } 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: "QQuickPaintedItem" + defaultProperty: "data" + prototype: "QQuickItem" + Enum { + name: "RenderTarget" + values: { + "Image": 0, + "FramebufferObject": 1, + "InvertedYFramebufferObject": 2 + } + } + Enum { + name: "PerformanceHints" + values: { + "FastFBOResizing": 1 + } + } + Property { name: "contentsSize"; type: "QSize" } + Property { name: "fillColor"; type: "QColor" } + Property { name: "contentsScale"; type: "double" } + Property { name: "renderTarget"; type: "RenderTarget" } + Property { name: "textureSize"; type: "QSize" } + } + Component { prototype: "QQuickRectangle" name: "QtQuick.Controls.Fusion.impl/ButtonPanel 2.3" exports: ["QtQuick.Controls.Fusion.impl/ButtonPanel 2.3"] diff --git a/src/imports/controls/fusion/qquickfusionstyle.cpp b/src/imports/controls/fusion/qquickfusionstyle.cpp index 7797463a..364f8a75 100644 --- a/src/imports/controls/fusion/qquickfusionstyle.cpp +++ b/src/imports/controls/fusion/qquickfusionstyle.cpp @@ -80,8 +80,6 @@ QColor QQuickFusionStyle::highlightedText(const QPalette &palette) QColor QQuickFusionStyle::outline(const QPalette &palette) { - if (palette.window().style() == Qt::TexturePattern) - return QColor(0, 0, 0, 160); return palette.window().color().darker(140); } @@ -95,8 +93,6 @@ QColor QQuickFusionStyle::highlightedOutline(const QPalette &palette) QColor QQuickFusionStyle::tabFrameColor(const QPalette &palette) { - if (palette.window().style() == Qt::TexturePattern) - return QColor(255, 255, 255, 8); return buttonColor(palette).lighter(104); } diff --git a/src/imports/controls/imagine/ComboBox.qml b/src/imports/controls/imagine/ComboBox.qml index 3a3ae682..2d582e98 100644 --- a/src/imports/controls/imagine/ComboBox.qml +++ b/src/imports/controls/imagine/ComboBox.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls 2.12 -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Controls.Imagine.impl 2.12 +import QtQuick 2.14 +import QtQuick.Window 2.14 +import QtQuick.Templates 2.14 as T +import QtQuick.Controls 2.14 +import QtQuick.Controls.Imagine 2.14 +import QtQuick.Controls.Imagine.impl 2.14 T.ComboBox { id: control diff --git a/src/imports/controls/imagine/RadioButton.qml b/src/imports/controls/imagine/RadioButton.qml index d431695f..a50bc127 100644 --- a/src/imports/controls/imagine/RadioButton.qml +++ b/src/imports/controls/imagine/RadioButton.qml @@ -61,7 +61,7 @@ T.RadioButton { bottomInset: background ? -background.bottomInset || 0 : 0 indicator: Image { - x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 + x: control.text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 y: control.topPadding + (control.availableHeight - height) / 2 source: Imagine.url + "radiobutton-indicator" diff --git a/src/imports/controls/imagine/ScrollBar.qml b/src/imports/controls/imagine/ScrollBar.qml index 787ea663..68772e12 100644 --- a/src/imports/controls/imagine/ScrollBar.qml +++ b/src/imports/controls/imagine/ScrollBar.qml @@ -48,6 +48,7 @@ T.ScrollBar { implicitContentHeight + topPadding + bottomPadding) visible: control.policy !== T.ScrollBar.AlwaysOff + minimumSize: orientation == Qt.Horizontal ? height / width : width / height topPadding: background ? background.topPadding : 0 leftPadding: background ? background.leftPadding : 0 @@ -104,14 +105,14 @@ T.ScrollBar { transitions: [ Transition { to: "active" - NumberAnimation { targets: [contentItem, background]; property: "opacity"; to: 1.0 } + NumberAnimation { targets: [control.contentItem, control.background]; property: "opacity"; to: 1.0 } }, Transition { from: "active" SequentialAnimation { - PropertyAction{ targets: [contentItem, background]; property: "opacity"; value: 1.0 } + PropertyAction{ targets: [control.contentItem, control.background]; property: "opacity"; value: 1.0 } PauseAnimation { duration: 3000 } - NumberAnimation { targets: [contentItem, background]; property: "opacity"; to: 0.0 } + NumberAnimation { targets: [control.contentItem, control.background]; property: "opacity"; to: 0.0 } } } ] diff --git a/src/imports/controls/imagine/ScrollIndicator.qml b/src/imports/controls/imagine/ScrollIndicator.qml index 2fd578ef..896cd876 100644 --- a/src/imports/controls/imagine/ScrollIndicator.qml +++ b/src/imports/controls/imagine/ScrollIndicator.qml @@ -98,13 +98,13 @@ T.ScrollIndicator { transitions: [ Transition { to: "active" - NumberAnimation { targets: [contentItem, background]; property: "opacity"; to: 1.0 } + NumberAnimation { targets: [contentItem, control.background]; property: "opacity"; to: 1.0 } }, Transition { from: "active" SequentialAnimation { PauseAnimation { duration: 5000 } - NumberAnimation { targets: [contentItem, background]; property: "opacity"; to: 0.0 } + NumberAnimation { targets: [contentItem, control.background]; property: "opacity"; to: 0.0 } } } ] diff --git a/src/imports/controls/imagine/Switch.qml b/src/imports/controls/imagine/Switch.qml index 7d1f3a2a..50b407ac 100644 --- a/src/imports/controls/imagine/Switch.qml +++ b/src/imports/controls/imagine/Switch.qml @@ -61,7 +61,7 @@ T.Switch { bottomInset: background ? -background.bottomInset || 0 : 0 indicator: NinePatchImage { - x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 + x: control.text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 y: control.topPadding + (control.availableHeight - height) / 2 width: Math.max(implicitWidth, handle.leftPadding && handle.rightPadding ? handle.implicitWidth : 2 * handle.implicitWidth) height: Math.max(implicitHeight, handle.implicitHeight) diff --git a/src/imports/controls/imagine/SwitchDelegate.qml b/src/imports/controls/imagine/SwitchDelegate.qml index e95023fb..73e5aac0 100644 --- a/src/imports/controls/imagine/SwitchDelegate.qml +++ b/src/imports/controls/imagine/SwitchDelegate.qml @@ -67,7 +67,7 @@ T.SwitchDelegate { icon.color: control.palette.text indicator: NinePatchImage { - x: text ? (control.mirrored ? control.leftPadding : control.width - width - control.rightPadding) : control.leftPadding + (control.availableWidth - width) / 2 + x: control.text ? (control.mirrored ? control.leftPadding : control.width - width - control.rightPadding) : control.leftPadding + (control.availableWidth - width) / 2 y: control.topPadding + (control.availableHeight - height) / 2 width: Math.max(implicitWidth, handle.leftPadding && handle.rightPadding ? handle.implicitWidth : 2 * handle.implicitWidth) height: Math.max(implicitHeight, handle.implicitHeight) diff --git a/src/imports/controls/imagine/Tumbler.qml b/src/imports/controls/imagine/Tumbler.qml index d49966b0..12025cc5 100644 --- a/src/imports/controls/imagine/Tumbler.qml +++ b/src/imports/controls/imagine/Tumbler.qml @@ -69,11 +69,11 @@ T.Tumbler { model: control.model delegate: control.delegate path: Path { - startX: contentItem.width / 2 - startY: -contentItem.delegateHeight / 2 + startX: control.contentItem.width / 2 + startY: -control.contentItem.delegateHeight / 2 PathLine { - x: contentItem.width / 2 - y: (control.visibleItemCount + 1) * contentItem.delegateHeight - contentItem.delegateHeight / 2 + x: control.contentItem.width / 2 + y: (control.visibleItemCount + 1) * control.contentItem.delegateHeight - control.contentItem.delegateHeight / 2 } } diff --git a/src/imports/controls/imagine/plugins.qmltypes b/src/imports/controls/imagine/plugins.qmltypes index 014714f3..191807ae 100644 --- a/src/imports/controls/imagine/plugins.qmltypes +++ b/src/imports/controls/imagine/plugins.qmltypes @@ -4,7 +4,7 @@ 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.Imagine 2.13' +// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQuick.Controls.Imagine 2.14' Module { dependencies: ["QtQuick.Controls 2.0"] @@ -16,6 +16,98 @@ Module { } Component { name: "QQuickAttachedObject"; prototype: "QObject" } Component { + name: "QQuickImage" + defaultProperty: "data" + prototype: "QQuickImageBase" + Enum { + name: "HAlignment" + values: { + "AlignLeft": 1, + "AlignRight": 2, + "AlignHCenter": 4 + } + } + Enum { + name: "VAlignment" + values: { + "AlignTop": 32, + "AlignBottom": 64, + "AlignVCenter": 128 + } + } + Enum { + name: "FillMode" + values: { + "Stretch": 0, + "PreserveAspectFit": 1, + "PreserveAspectCrop": 2, + "Tile": 3, + "TileVertically": 4, + "TileHorizontally": 5, + "Pad": 6 + } + } + Property { name: "fillMode"; type: "FillMode" } + Property { name: "paintedWidth"; type: "double"; isReadonly: true } + Property { name: "paintedHeight"; type: "double"; isReadonly: true } + Property { name: "horizontalAlignment"; type: "HAlignment" } + Property { name: "verticalAlignment"; type: "VAlignment" } + Property { name: "mipmap"; revision: 3; type: "bool" } + Property { name: "autoTransform"; revision: 5; type: "bool" } + Signal { name: "paintedGeometryChanged" } + Signal { + name: "horizontalAlignmentChanged" + Parameter { name: "alignment"; type: "HAlignment" } + } + Signal { + name: "verticalAlignmentChanged" + Parameter { name: "alignment"; type: "VAlignment" } + } + Signal { + name: "mipmapChanged" + revision: 3 + Parameter { type: "bool" } + } + Signal { name: "autoTransformChanged"; revision: 5 } + } + Component { + name: "QQuickImageBase" + defaultProperty: "data" + prototype: "QQuickImplicitSizeItem" + Enum { + name: "Status" + values: { + "Null": 0, + "Ready": 1, + "Loading": 2, + "Error": 3 + } + } + Property { name: "status"; type: "Status"; isReadonly: true } + Property { name: "source"; type: "QUrl" } + Property { name: "progress"; type: "double"; isReadonly: true } + Property { name: "asynchronous"; type: "bool" } + Property { name: "cache"; type: "bool" } + Property { name: "sourceSize"; type: "QSize" } + Property { name: "mirror"; type: "bool" } + Property { name: "currentFrame"; revision: 14; type: "int" } + Property { name: "frameCount"; revision: 14; type: "int"; isReadonly: true } + Signal { + name: "sourceChanged" + Parameter { type: "QUrl" } + } + Signal { + name: "statusChanged" + Parameter { type: "QQuickImageBase::Status" } + } + Signal { + name: "progressChanged" + Parameter { name: "progress"; type: "double" } + } + Signal { name: "currentFrameChanged"; revision: 14 } + Signal { name: "frameCountChanged"; revision: 14 } + } + Component { name: "QQuickImageSelector" prototype: "QObject" exports: ["QtQuick.Controls.Imagine.impl/ImageSelector 2.3"] @@ -37,6 +129,189 @@ Module { Property { name: "url"; type: "QUrl"; isReadonly: true } } Component { + name: "QQuickImplicitSizeItem" + defaultProperty: "data" + prototype: "QQuickItem" + Property { name: "implicitWidth"; type: "double"; isReadonly: true } + Property { name: "implicitHeight"; type: "double"; isReadonly: true } + } + 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: "QQuickNinePatchImage" defaultProperty: "data" prototype: "QQuickImage" diff --git a/src/imports/controls/material/CheckBox.qml b/src/imports/controls/material/CheckBox.qml index cad5ae97..159e2f12 100644 --- a/src/imports/controls/material/CheckBox.qml +++ b/src/imports/controls/material/CheckBox.qml @@ -53,7 +53,7 @@ T.CheckBox { verticalPadding: padding + 7 indicator: CheckIndicator { - x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 + x: control.text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 y: control.topPadding + (control.availableHeight - height) / 2 control: control diff --git a/src/imports/controls/material/CheckDelegate.qml b/src/imports/controls/material/CheckDelegate.qml index 34495e2d..c7d7575e 100644 --- a/src/imports/controls/material/CheckDelegate.qml +++ b/src/imports/controls/material/CheckDelegate.qml @@ -59,7 +59,7 @@ T.CheckDelegate { icon.color: enabled ? Material.foreground : Material.hintTextColor indicator: CheckIndicator { - x: text ? (control.mirrored ? control.leftPadding : control.width - width - control.rightPadding) : control.leftPadding + (control.availableWidth - width) / 2 + x: control.text ? (control.mirrored ? control.leftPadding : control.width - width - control.rightPadding) : control.leftPadding + (control.availableWidth - width) / 2 y: control.topPadding + (control.availableHeight - height) / 2 control: control } diff --git a/src/imports/controls/material/CheckIndicator.qml b/src/imports/controls/material/CheckIndicator.qml index 673d6f48..7caf8553 100644 --- a/src/imports/controls/material/CheckIndicator.qml +++ b/src/imports/controls/material/CheckIndicator.qml @@ -75,7 +75,7 @@ Rectangle { source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Material/images/check.png" fillMode: Image.PreserveAspectFit - scale: checkState === Qt.Checked ? 1 : 0 + scale: indicatorItem.checkState === Qt.Checked ? 1 : 0 Behavior on scale { NumberAnimation { duration: 100 } } } @@ -85,18 +85,18 @@ Rectangle { width: 12 height: 3 - scale: checkState === Qt.PartiallyChecked ? 1 : 0 + scale: indicatorItem.checkState === Qt.PartiallyChecked ? 1 : 0 Behavior on scale { NumberAnimation { duration: 100 } } } states: [ State { name: "checked" - when: checkState === Qt.Checked + when: indicatorItem.checkState === Qt.Checked }, State { name: "partiallychecked" - when: checkState === Qt.PartiallyChecked + when: indicatorItem.checkState === Qt.PartiallyChecked } ] diff --git a/src/imports/controls/material/ComboBox.qml b/src/imports/controls/material/ComboBox.qml index 223f8fca..7d635902 100644 --- a/src/imports/controls/material/ComboBox.qml +++ b/src/imports/controls/material/ComboBox.qml @@ -34,13 +34,13 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Material.impl 2.12 +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 T.ComboBox { id: control diff --git a/src/imports/controls/material/Dial.qml b/src/imports/controls/material/Dial.qml index 1148dd25..1f80a7fe 100644 --- a/src/imports/controls/material/Dial.qml +++ b/src/imports/controls/material/Dial.qml @@ -62,16 +62,16 @@ T.Dial { } handle: SliderHandle { - x: background.x + background.width / 2 - handle.width / 2 - y: background.y + background.height / 2 - handle.height / 2 + x: control.background.x + control.background.width / 2 - control.handle.width / 2 + y: control.background.y + control.background.height / 2 - control.handle.height / 2 transform: [ Translate { - y: -background.height * 0.4 + handle.height / 2 + y: -control.background.height * 0.4 + control.handle.height / 2 }, Rotation { angle: control.angle - origin.x: handle.width / 2 - origin.y: handle.height / 2 + origin.x: control.handle.width / 2 + origin.y: control.handle.height / 2 } ] implicitWidth: 10 diff --git a/src/imports/controls/material/ElevationEffect.qml b/src/imports/controls/material/ElevationEffect.qml index 06b654a8..73a2a238 100644 --- a/src/imports/controls/material/ElevationEffect.qml +++ b/src/imports/controls/material/ElevationEffect.qml @@ -235,9 +235,9 @@ Item { // the size of the parent, so we don't need to worry about the extra padding // in the parent Item BoxShadow { - offsetY: _shadow[0].offset - blurRadius: _shadow[0].blur - spreadRadius: _shadow[0].spread + offsetY: effect._shadow[0].offset + blurRadius: effect._shadow[0].blur + spreadRadius: effect._shadow[0].spread color: Qt.rgba(0,0,0, 0.2) fullWidth: effect.fullWidth @@ -246,9 +246,9 @@ Item { } BoxShadow { - offsetY: _shadow[1].offset - blurRadius: _shadow[1].blur - spreadRadius: _shadow[1].spread + offsetY: effect._shadow[1].offset + blurRadius: effect._shadow[1].blur + spreadRadius: effect._shadow[1].spread color: Qt.rgba(0,0,0, 0.14) fullWidth: effect.fullWidth @@ -257,9 +257,9 @@ Item { } BoxShadow { - offsetY: _shadow[2].offset - blurRadius: _shadow[2].blur - spreadRadius: _shadow[2].spread + offsetY: effect._shadow[2].offset + blurRadius: effect._shadow[2].blur + spreadRadius: effect._shadow[2].spread color: Qt.rgba(0,0,0, 0.12) fullWidth: effect.fullWidth @@ -272,8 +272,8 @@ Item { x: (parent.width - width)/2 y: (parent.height - height)/2 - width: sourceItem.width - height: sourceItem.height + width: effect.sourceItem.width + height: effect.sourceItem.height } } } diff --git a/src/imports/controls/material/MenuItem.qml b/src/imports/controls/material/MenuItem.qml index 069ad216..a5d2f8a1 100644 --- a/src/imports/controls/material/MenuItem.qml +++ b/src/imports/controls/material/MenuItem.qml @@ -59,7 +59,7 @@ T.MenuItem { icon.color: enabled ? Material.foreground : Material.hintTextColor indicator: CheckIndicator { - x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 + x: control.text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 y: control.topPadding + (control.availableHeight - height) / 2 visible: control.checkable control: control diff --git a/src/imports/controls/material/RadioButton.qml b/src/imports/controls/material/RadioButton.qml index 47bbbd80..dadcc84f 100644 --- a/src/imports/controls/material/RadioButton.qml +++ b/src/imports/controls/material/RadioButton.qml @@ -53,7 +53,7 @@ T.RadioButton { verticalPadding: padding + 6 indicator: RadioIndicator { - x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 + x: control.text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 y: control.topPadding + (control.availableHeight - height) / 2 control: control diff --git a/src/imports/controls/material/RadioDelegate.qml b/src/imports/controls/material/RadioDelegate.qml index edc93c2c..c977d332 100644 --- a/src/imports/controls/material/RadioDelegate.qml +++ b/src/imports/controls/material/RadioDelegate.qml @@ -59,7 +59,7 @@ T.RadioDelegate { icon.color: enabled ? Material.foreground : Material.hintTextColor indicator: RadioIndicator { - x: text ? (control.mirrored ? control.leftPadding : control.width - width - control.rightPadding) : control.leftPadding + (control.availableWidth - width) / 2 + x: control.text ? (control.mirrored ? control.leftPadding : control.width - width - control.rightPadding) : control.leftPadding + (control.availableWidth - width) / 2 y: control.topPadding + (control.availableHeight - height) / 2 control: control } diff --git a/src/imports/controls/material/RadioIndicator.qml b/src/imports/controls/material/RadioIndicator.qml index 4be816ad..e2c55184 100644 --- a/src/imports/controls/material/RadioIndicator.qml +++ b/src/imports/controls/material/RadioIndicator.qml @@ -39,6 +39,7 @@ import QtQuick.Controls.Material 2.12 import QtQuick.Controls.Material.impl 2.12 Rectangle { + id: indicator implicitWidth: 20 implicitHeight: 20 radius: width / 2 @@ -56,6 +57,6 @@ Rectangle { height: 10 radius: width / 2 color: parent.border.color - visible: control.checked || control.down + visible: indicator.control.checked || indicator.control.down } } diff --git a/src/imports/controls/material/RectangularGlow.qml b/src/imports/controls/material/RectangularGlow.qml index 58e11b9f..c01e536d 100644 --- a/src/imports/controls/material/RectangularGlow.qml +++ b/src/imports/controls/material/RectangularGlow.qml @@ -224,7 +224,7 @@ Item { height: parent.height + rootItem.glowRadius * 2 + cornerRadius * 2 function clampedCornerRadius() { - var maxCornerRadius = Math.min(rootItem.width, rootItem.height) / 2 + glowRadius; + var maxCornerRadius = Math.min(rootItem.width, rootItem.height) / 2 + rootItem.glowRadius; return Math.max(0, Math.min(rootItem.cornerRadius, maxCornerRadius)) } diff --git a/src/imports/controls/material/ScrollBar.qml b/src/imports/controls/material/ScrollBar.qml index a376742d..fda64346 100644 --- a/src/imports/controls/material/ScrollBar.qml +++ b/src/imports/controls/material/ScrollBar.qml @@ -48,6 +48,7 @@ T.ScrollBar { padding: control.interactive ? 1 : 2 visible: control.policy !== T.ScrollBar.AlwaysOff + minimumSize: orientation == Qt.Horizontal ? height / width : width / height contentItem: Rectangle { implicitWidth: control.interactive ? 13 : 4 @@ -74,14 +75,14 @@ T.ScrollBar { transitions: [ Transition { to: "active" - NumberAnimation { targets: [contentItem, background]; property: "opacity"; to: 1.0 } + NumberAnimation { targets: [control.contentItem, control.background]; property: "opacity"; to: 1.0 } }, Transition { from: "active" SequentialAnimation { - PropertyAction{ targets: [contentItem, background]; property: "opacity"; value: 1.0 } + PropertyAction{ targets: [control.contentItem, control.background]; property: "opacity"; value: 1.0 } PauseAnimation { duration: 2450 } - NumberAnimation { targets: [contentItem, background]; property: "opacity"; to: 0.0 } + NumberAnimation { targets: [control.contentItem, control.background]; property: "opacity"; to: 0.0 } } } ] diff --git a/src/imports/controls/material/SliderHandle.qml b/src/imports/controls/material/SliderHandle.qml index b3bdb802..2e3120e4 100644 --- a/src/imports/controls/material/SliderHandle.qml +++ b/src/imports/controls/material/SliderHandle.qml @@ -71,6 +71,6 @@ Item { width: 22; height: 22 pressed: root.handlePressed active: root.handlePressed || root.handleHasFocus || root.handleHovered - color: control.Material.rippleColor + color: root.control.Material.rippleColor } } diff --git a/src/imports/controls/material/SwitchDelegate.qml b/src/imports/controls/material/SwitchDelegate.qml index bae5171b..834a3dfa 100644 --- a/src/imports/controls/material/SwitchDelegate.qml +++ b/src/imports/controls/material/SwitchDelegate.qml @@ -59,7 +59,7 @@ T.SwitchDelegate { icon.color: enabled ? Material.foreground : Material.hintTextColor indicator: SwitchIndicator { - x: text ? (control.mirrored ? control.leftPadding : control.width - width - control.rightPadding) : control.leftPadding + (control.availableWidth - width) / 2 + x: control.text ? (control.mirrored ? control.leftPadding : control.width - width - control.rightPadding) : control.leftPadding + (control.availableWidth - width) / 2 y: control.topPadding + (control.availableHeight - height) / 2 control: control } diff --git a/src/imports/controls/material/SwitchIndicator.qml b/src/imports/controls/material/SwitchIndicator.qml index 7fef407c..3034e771 100644 --- a/src/imports/controls/material/SwitchIndicator.qml +++ b/src/imports/controls/material/SwitchIndicator.qml @@ -53,22 +53,22 @@ Item { height: 14 radius: height / 2 y: parent.height / 2 - height / 2 - color: control.enabled ? (control.checked ? control.Material.switchCheckedTrackColor : control.Material.switchUncheckedTrackColor) - : control.Material.switchDisabledTrackColor + color: indicator.control.enabled ? (indicator.control.checked ? indicator.control.Material.switchCheckedTrackColor : indicator.control.Material.switchUncheckedTrackColor) + : indicator.control.Material.switchDisabledTrackColor } Rectangle { id: handle - x: Math.max(0, Math.min(parent.width - width, control.visualPosition * parent.width - (width / 2))) + x: Math.max(0, Math.min(parent.width - width, indicator.control.visualPosition * parent.width - (width / 2))) y: (parent.height - height) / 2 width: 20 height: 20 radius: width / 2 - color: control.enabled ? (control.checked ? control.Material.switchCheckedHandleColor : control.Material.switchUncheckedHandleColor) - : control.Material.switchDisabledHandleColor + color: indicator.control.enabled ? (indicator.control.checked ? indicator.control.Material.switchCheckedHandleColor : indicator.control.Material.switchUncheckedHandleColor) + : indicator.control.Material.switchDisabledHandleColor Behavior on x { - enabled: !control.pressed + enabled: !indicator.control.pressed SmoothedAnimation { duration: 300 } diff --git a/src/imports/controls/material/Tumbler.qml b/src/imports/controls/material/Tumbler.qml index 92e24430..30d66c58 100644 --- a/src/imports/controls/material/Tumbler.qml +++ b/src/imports/controls/material/Tumbler.qml @@ -63,11 +63,11 @@ T.Tumbler { model: control.model delegate: control.delegate path: Path { - startX: contentItem.width / 2 - startY: -contentItem.delegateHeight / 2 + startX: control.contentItem.width / 2 + startY: -control.contentItem.delegateHeight / 2 PathLine { - x: contentItem.width / 2 - y: (control.visibleItemCount + 1) * contentItem.delegateHeight - contentItem.delegateHeight / 2 + x: control.contentItem.width / 2 + y: (control.visibleItemCount + 1) * control.contentItem.delegateHeight - control.contentItem.delegateHeight / 2 } } diff --git a/src/imports/controls/material/plugins.qmltypes b/src/imports/controls/material/plugins.qmltypes index 3e95fa44..7546a7b0 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.14' 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" diff --git a/src/imports/controls/material/qquickmaterialbusyindicator.cpp b/src/imports/controls/material/qquickmaterialbusyindicator.cpp index c18a4005..58c1fd8c 100644 --- a/src/imports/controls/material/qquickmaterialbusyindicator.cpp +++ b/src/imports/controls/material/qquickmaterialbusyindicator.cpp @@ -184,7 +184,7 @@ QColor QQuickMaterialBusyIndicator::color() const return m_color; } -void QQuickMaterialBusyIndicator::setColor(QColor color) +void QQuickMaterialBusyIndicator::setColor(const QColor &color) { if (m_color == color) return; diff --git a/src/imports/controls/material/qquickmaterialbusyindicator_p.h b/src/imports/controls/material/qquickmaterialbusyindicator_p.h index d29427c1..ad7bc002 100644 --- a/src/imports/controls/material/qquickmaterialbusyindicator_p.h +++ b/src/imports/controls/material/qquickmaterialbusyindicator_p.h @@ -63,7 +63,7 @@ public: explicit QQuickMaterialBusyIndicator(QQuickItem *parent = nullptr); QColor color() const; - void setColor(QColor color); + void setColor(const QColor &color); bool isRunning() const; void setRunning(bool running); diff --git a/src/imports/controls/material/qtquickcontrols2materialstyleplugin.qrc b/src/imports/controls/material/qtquickcontrols2materialstyleplugin.qrc index 6e29aea4..71f9563b 100644 --- a/src/imports/controls/material/qtquickcontrols2materialstyleplugin.qrc +++ b/src/imports/controls/material/qtquickcontrols2materialstyleplugin.qrc @@ -15,5 +15,6 @@ <file>shaders/RectangularGlow.frag</file> <file>shaders/+glslcore/RectangularGlow.frag</file> <file>shaders/+hlsl/RectangularGlow.frag</file> + <file>shaders/+qsb/RectangularGlow.frag</file> </qresource> </RCC> diff --git a/src/imports/controls/material/shaders/+qsb/RectangularGlow.frag b/src/imports/controls/material/shaders/+qsb/RectangularGlow.frag Binary files differnew file mode 100644 index 00000000..a805b134 --- /dev/null +++ b/src/imports/controls/material/shaders/+qsb/RectangularGlow.frag diff --git a/src/imports/controls/material/shaders/RectangularGlow_rhi.frag b/src/imports/controls/material/shaders/RectangularGlow_rhi.frag new file mode 100644 index 00000000..3e7d2dfe --- /dev/null +++ b/src/imports/controls/material/shaders/RectangularGlow_rhi.frag @@ -0,0 +1,28 @@ +#version 440 + +layout(location = 0) in vec2 qt_TexCoord0; +layout(location = 0) out vec4 fragColor; + +layout(std140, binding = 0) uniform buf { + mat4 qt_Matrix; + float qt_Opacity; + float relativeSizeX; + float relativeSizeY; + float spread; + vec4 color; +} ubuf; + +float linearstep(float e0, float e1, float x) +{ + return clamp((x - e0) / (e1 - e0), 0.0, 1.0); +} + +void main() +{ + float alpha = + smoothstep(0.0, ubuf.relativeSizeX, 0.5 - abs(0.5 - qt_TexCoord0.x)) * + smoothstep(0.0, ubuf.relativeSizeY, 0.5 - abs(0.5 - qt_TexCoord0.y)); + + float spreadMultiplier = linearstep(ubuf.spread, 1.0 - ubuf.spread, alpha); + fragColor = ubuf.color * ubuf.qt_Opacity * spreadMultiplier * spreadMultiplier; +} diff --git a/src/imports/controls/plugins.qmltypes b/src/imports/controls/plugins.qmltypes index 9b4610f0..c3e53431 100644 --- a/src/imports/controls/plugins.qmltypes +++ b/src/imports/controls/plugins.qmltypes @@ -4,7 +4,7 @@ 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 2.13' +// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQuick.Controls 2.14' Module { dependencies: [ @@ -175,6 +175,13 @@ Module { Property { name: "bottomPadding"; type: "double" } } Component { + name: "QQuickImplicitSizeItem" + defaultProperty: "data" + prototype: "QQuickItem" + Property { name: "implicitWidth"; type: "double"; isReadonly: true } + Property { name: "implicitHeight"; type: "double"; isReadonly: true } + } + Component { name: "QQuickItemGroup" defaultProperty: "data" prototype: "QQuickImplicitSizeItem" @@ -191,6 +198,19 @@ Module { Property { name: "mnemonicVisible"; type: "bool" } } Component { + name: "QQuickOverlay" + defaultProperty: "data" + prototype: "QQuickItem" + exports: ["QtQuick.Controls/Overlay 2.3"] + isCreatable: false + exportMetaObjectRevisions: [0] + attachedType: "QQuickOverlayAttached" + Property { name: "modal"; type: "QQmlComponent"; isPointer: true } + Property { name: "modeless"; type: "QQmlComponent"; isPointer: true } + Signal { name: "pressed" } + Signal { name: "released" } + } + Component { name: "QQuickPaddedRectangle" defaultProperty: "data" prototype: "QQuickRectangle" @@ -210,6 +230,205 @@ Module { exportMetaObjectRevisions: [0] } Component { + name: "QQuickSplitHandleAttached" + prototype: "QObject" + exports: ["QtQuick.Controls/SplitHandle 2.13"] + isCreatable: false + exportMetaObjectRevisions: [0] + Property { name: "hovered"; type: "bool"; isReadonly: true } + Property { name: "pressed"; type: "bool"; isReadonly: true } + } + Component { + name: "QQuickText" + defaultProperty: "data" + prototype: "QQuickImplicitSizeItem" + Enum { + name: "HAlignment" + values: { + "AlignLeft": 1, + "AlignRight": 2, + "AlignHCenter": 4, + "AlignJustify": 8 + } + } + Enum { + name: "VAlignment" + values: { + "AlignTop": 32, + "AlignBottom": 64, + "AlignVCenter": 128 + } + } + Enum { + name: "TextStyle" + values: { + "Normal": 0, + "Outline": 1, + "Raised": 2, + "Sunken": 3 + } + } + Enum { + name: "TextFormat" + values: { + "PlainText": 0, + "RichText": 1, + "MarkdownText": 3, + "AutoText": 2, + "StyledText": 4 + } + } + Enum { + name: "TextElideMode" + values: { + "ElideLeft": 0, + "ElideRight": 1, + "ElideMiddle": 2, + "ElideNone": 3 + } + } + Enum { + name: "WrapMode" + values: { + "NoWrap": 0, + "WordWrap": 1, + "WrapAnywhere": 3, + "WrapAtWordBoundaryOrAnywhere": 4, + "Wrap": 4 + } + } + Enum { + name: "RenderType" + values: { + "QtRendering": 0, + "NativeRendering": 1 + } + } + Enum { + name: "LineHeightMode" + values: { + "ProportionalHeight": 0, + "FixedHeight": 1 + } + } + Enum { + name: "FontSizeMode" + values: { + "FixedSize": 0, + "HorizontalFit": 1, + "VerticalFit": 2, + "Fit": 3 + } + } + Property { name: "text"; type: "string" } + Property { name: "font"; type: "QFont" } + Property { name: "color"; type: "QColor" } + Property { name: "linkColor"; type: "QColor" } + Property { name: "style"; type: "TextStyle" } + Property { name: "styleColor"; type: "QColor" } + Property { name: "horizontalAlignment"; type: "HAlignment" } + Property { name: "effectiveHorizontalAlignment"; type: "HAlignment"; isReadonly: true } + Property { name: "verticalAlignment"; type: "VAlignment" } + Property { name: "wrapMode"; type: "WrapMode" } + Property { name: "lineCount"; type: "int"; isReadonly: true } + Property { name: "truncated"; type: "bool"; isReadonly: true } + Property { name: "maximumLineCount"; type: "int" } + Property { name: "textFormat"; type: "TextFormat" } + Property { name: "elide"; type: "TextElideMode" } + Property { name: "contentWidth"; type: "double"; isReadonly: true } + Property { name: "contentHeight"; type: "double"; isReadonly: true } + Property { name: "paintedWidth"; type: "double"; isReadonly: true } + Property { name: "paintedHeight"; type: "double"; isReadonly: true } + Property { name: "lineHeight"; type: "double" } + Property { name: "lineHeightMode"; type: "LineHeightMode" } + Property { name: "baseUrl"; type: "QUrl" } + Property { name: "minimumPixelSize"; type: "int" } + Property { name: "minimumPointSize"; type: "int" } + Property { name: "fontSizeMode"; type: "FontSizeMode" } + Property { name: "renderType"; type: "RenderType" } + Property { name: "hoveredLink"; revision: 2; type: "string"; isReadonly: true } + Property { name: "padding"; revision: 6; type: "double" } + Property { name: "topPadding"; revision: 6; type: "double" } + Property { name: "leftPadding"; revision: 6; type: "double" } + Property { name: "rightPadding"; revision: 6; type: "double" } + Property { name: "bottomPadding"; revision: 6; type: "double" } + Property { name: "fontInfo"; revision: 9; type: "QJSValue"; isReadonly: true } + Property { name: "advance"; revision: 10; type: "QSizeF"; isReadonly: true } + Signal { + name: "textChanged" + Parameter { name: "text"; type: "string" } + } + Signal { + name: "linkActivated" + Parameter { name: "link"; type: "string" } + } + Signal { + name: "linkHovered" + revision: 2 + Parameter { name: "link"; type: "string" } + } + Signal { + name: "fontChanged" + Parameter { name: "font"; type: "QFont" } + } + Signal { + name: "styleChanged" + Parameter { name: "style"; type: "QQuickText::TextStyle" } + } + Signal { + name: "horizontalAlignmentChanged" + Parameter { name: "alignment"; type: "QQuickText::HAlignment" } + } + Signal { + name: "verticalAlignmentChanged" + Parameter { name: "alignment"; type: "QQuickText::VAlignment" } + } + Signal { + name: "textFormatChanged" + Parameter { name: "textFormat"; type: "QQuickText::TextFormat" } + } + Signal { + name: "elideModeChanged" + Parameter { name: "mode"; type: "QQuickText::TextElideMode" } + } + Signal { name: "contentSizeChanged" } + Signal { + name: "contentWidthChanged" + Parameter { name: "contentWidth"; type: "double" } + } + Signal { + name: "contentHeightChanged" + Parameter { name: "contentHeight"; type: "double" } + } + Signal { + name: "lineHeightChanged" + Parameter { name: "lineHeight"; type: "double" } + } + Signal { + name: "lineHeightModeChanged" + Parameter { name: "mode"; type: "LineHeightMode" } + } + Signal { + name: "lineLaidOut" + Parameter { name: "line"; type: "QQuickTextLine"; isPointer: true } + } + Signal { name: "paddingChanged"; revision: 6 } + Signal { name: "topPaddingChanged"; revision: 6 } + Signal { name: "leftPaddingChanged"; revision: 6 } + Signal { name: "rightPaddingChanged"; revision: 6 } + Signal { name: "bottomPaddingChanged"; revision: 6 } + Signal { name: "fontInfoChanged"; revision: 9 } + Method { name: "doLayout" } + Method { name: "forceLayout"; revision: 9 } + Method { + name: "linkAt" + revision: 3 + type: "string" + Parameter { name: "x"; type: "double" } + Parameter { name: "y"; type: "double" } + } + } + Component { name: "QQuickTumblerView" defaultProperty: "data" prototype: "QQuickItem" diff --git a/src/imports/controls/universal/CheckBox.qml b/src/imports/controls/universal/CheckBox.qml index b726339a..9494f4d2 100644 --- a/src/imports/controls/universal/CheckBox.qml +++ b/src/imports/controls/universal/CheckBox.qml @@ -54,7 +54,7 @@ T.CheckBox { property bool useSystemFocusVisuals: true indicator: CheckIndicator { - x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 + x: control.text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 y: control.topPadding + (control.availableHeight - height) / 2 control: control } diff --git a/src/imports/controls/universal/CheckDelegate.qml b/src/imports/controls/universal/CheckDelegate.qml index 7847f459..b544c42e 100644 --- a/src/imports/controls/universal/CheckDelegate.qml +++ b/src/imports/controls/universal/CheckDelegate.qml @@ -61,7 +61,7 @@ T.CheckDelegate { icon.color: Color.transparent(Universal.foreground, enabled ? 1.0 : 0.2) indicator: CheckIndicator { - x: text ? (control.mirrored ? control.leftPadding : control.width - width - control.rightPadding) : control.leftPadding + (control.availableWidth - width) / 2 + x: control.text ? (control.mirrored ? control.leftPadding : control.width - width - control.rightPadding) : control.leftPadding + (control.availableWidth - width) / 2 y: control.topPadding + (control.availableHeight - height) / 2 control: control } diff --git a/src/imports/controls/universal/CheckIndicator.qml b/src/imports/controls/universal/CheckIndicator.qml index 0f535ea6..8f41617a 100644 --- a/src/imports/controls/universal/CheckIndicator.qml +++ b/src/imports/controls/universal/CheckIndicator.qml @@ -41,6 +41,7 @@ import QtQuick.Controls.impl 2.12 import QtQuick.Controls.Universal 2.12 Rectangle { + id: indicator implicitWidth: 20 implicitHeight: 20 @@ -59,23 +60,23 @@ Rectangle { x: (parent.width - width) / 2 y: (parent.height - height) / 2 - visible: control.checkState === Qt.Checked - color: !control.enabled ? control.Universal.baseLowColor : control.Universal.chromeWhiteColor + visible: indicator.control.checkState === Qt.Checked + color: !indicator.control.enabled ? indicator.control.Universal.baseLowColor : indicator.control.Universal.chromeWhiteColor source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Universal/images/checkmark.png" } Rectangle { x: (parent.width - width) / 2 y: (parent.height - height) / 2 - width: partiallyChecked ? parent.width / 2 : parent.width - height: partiallyChecked ? parent.height / 2 : parent.height + width: indicator.partiallyChecked ? parent.width / 2 : parent.width + height: indicator.partiallyChecked ? parent.height / 2 : parent.height - visible: !control.pressed && control.hovered || partiallyChecked - color: !partiallyChecked ? "transparent" : - !control.enabled ? control.Universal.baseLowColor : - control.down ? control.Universal.baseMediumColor : - control.hovered ? control.Universal.baseHighColor : control.Universal.baseMediumHighColor - border.width: partiallyChecked ? 0 : 2 // CheckBoxBorderThemeThickness - border.color: control.Universal.baseMediumLowColor + visible: !indicator.control.pressed && indicator.control.hovered || indicator.partiallyChecked + color: !indicator.partiallyChecked ? "transparent" : + !indicator.control.enabled ? indicator.control.Universal.baseLowColor : + indicator.control.down ? indicator.control.Universal.baseMediumColor : + indicator.control.hovered ? indicator.control.Universal.baseHighColor : indicator.control.Universal.baseMediumHighColor + border.width: indicator.partiallyChecked ? 0 : 2 // CheckBoxBorderThemeThickness + border.color: indicator.control.Universal.baseMediumLowColor } } diff --git a/src/imports/controls/universal/ComboBox.qml b/src/imports/controls/universal/ComboBox.qml index 3ec7e98b..9a4e119b 100644 --- a/src/imports/controls/universal/ComboBox.qml +++ b/src/imports/controls/universal/ComboBox.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Controls.Universal 2.12 +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.Universal 2.14 T.ComboBox { id: control diff --git a/src/imports/controls/universal/Dial.qml b/src/imports/controls/universal/Dial.qml index 276c87d6..f45d912e 100644 --- a/src/imports/controls/universal/Dial.qml +++ b/src/imports/controls/universal/Dial.qml @@ -64,8 +64,8 @@ T.Dial { implicitWidth: 14 implicitHeight: 14 - x: background.x + background.width / 2 - handle.width / 2 - y: background.y + background.height / 2 - handle.height / 2 + x: control.background.x + control.background.width / 2 - control.handle.width / 2 + y: control.background.y + control.background.height / 2 - control.handle.height / 2 radius: width / 2 color: !control.enabled ? control.Universal.baseLowColor : @@ -74,12 +74,12 @@ T.Dial { transform: [ Translate { - y: -background.height * 0.4 + handle.height / 2 + y: -control.background.height * 0.4 + control.handle.height / 2 }, Rotation { angle: control.angle - origin.x: handle.width / 2 - origin.y: handle.height / 2 + origin.x: control.handle.width / 2 + origin.y: control.handle.height / 2 } ] } diff --git a/src/imports/controls/universal/RadioButton.qml b/src/imports/controls/universal/RadioButton.qml index 5a61c3f7..a50cdf9b 100644 --- a/src/imports/controls/universal/RadioButton.qml +++ b/src/imports/controls/universal/RadioButton.qml @@ -54,7 +54,7 @@ T.RadioButton { property bool useSystemFocusVisuals: true indicator: RadioIndicator { - x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 + x: control.text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 y: control.topPadding + (control.availableHeight - height) / 2 control: control } diff --git a/src/imports/controls/universal/RadioDelegate.qml b/src/imports/controls/universal/RadioDelegate.qml index d56cef33..9fc910f3 100644 --- a/src/imports/controls/universal/RadioDelegate.qml +++ b/src/imports/controls/universal/RadioDelegate.qml @@ -61,7 +61,7 @@ T.RadioDelegate { icon.color: Color.transparent(Universal.foreground, enabled ? 1.0 : 0.2) indicator: RadioIndicator { - x: text ? (control.mirrored ? control.leftPadding : control.width - width - control.rightPadding) : control.leftPadding + (control.availableWidth - width) / 2 + x: control.text ? (control.mirrored ? control.leftPadding : control.width - width - control.rightPadding) : control.leftPadding + (control.availableWidth - width) / 2 y: control.topPadding + (control.availableHeight - height) / 2 control: control } diff --git a/src/imports/controls/universal/RadioIndicator.qml b/src/imports/controls/universal/RadioIndicator.qml index 68d53d45..1a32decb 100644 --- a/src/imports/controls/universal/RadioIndicator.qml +++ b/src/imports/controls/universal/RadioIndicator.qml @@ -38,6 +38,7 @@ import QtQuick 2.12 import QtQuick.Controls.Universal 2.12 Rectangle { + id: indicator implicitWidth: 20 implicitHeight: 20 radius: width / 2 @@ -56,11 +57,11 @@ Rectangle { height: parent.height radius: width / 2 - opacity: control.checked ? 1 : 0 + opacity: indicator.control.checked ? 1 : 0 color: "transparent" border.width: 2 // RadioButtonBorderThemeThickness - border.color: !control.enabled ? control.Universal.baseLowColor : - control.down ? control.Universal.baseMediumColor : control.Universal.accent + border.color: !indicator.control.enabled ? indicator.control.Universal.baseLowColor : + indicator.control.down ? indicator.control.Universal.baseMediumColor : indicator.control.Universal.accent } Rectangle { @@ -71,9 +72,9 @@ Rectangle { height: parent.height / 2 radius: width / 2 - opacity: control.checked ? 1 : 0 - color: !control.enabled ? control.Universal.baseLowColor : - control.down ? control.Universal.baseMediumColor : - control.hovered ? control.Universal.baseHighColor : control.Universal.baseMediumHighColor + opacity: indicator.control.checked ? 1 : 0 + color: !indicator.control.enabled ? indicator.control.Universal.baseLowColor : + indicator.control.down ? indicator.control.Universal.baseMediumColor : + indicator.control.hovered ? indicator.control.Universal.baseHighColor : indicator.control.Universal.baseMediumHighColor } } diff --git a/src/imports/controls/universal/ScrollBar.qml b/src/imports/controls/universal/ScrollBar.qml index d6a525f7..8b8e325d 100644 --- a/src/imports/controls/universal/ScrollBar.qml +++ b/src/imports/controls/universal/ScrollBar.qml @@ -47,6 +47,7 @@ T.ScrollBar { implicitContentHeight + topPadding + bottomPadding) visible: control.policy !== T.ScrollBar.AlwaysOff + minimumSize: orientation == Qt.Horizontal ? height / width : width / height // TODO: arrows @@ -78,14 +79,14 @@ T.ScrollBar { transitions: [ Transition { to: "active" - NumberAnimation { targets: [contentItem, background]; property: "opacity"; to: 1.0 } + NumberAnimation { targets: [control.contentItem, control.background]; property: "opacity"; to: 1.0 } }, Transition { from: "active" SequentialAnimation { - PropertyAction{ targets: [contentItem, background]; property: "opacity"; value: 1.0 } + PropertyAction{ targets: [control.contentItem, control.background]; property: "opacity"; value: 1.0 } PauseAnimation { duration: 3000 } - NumberAnimation { targets: [contentItem, background]; property: "opacity"; to: 0.0 } + NumberAnimation { targets: [control.contentItem, control.background]; property: "opacity"; to: 0.0 } } } ] diff --git a/src/imports/controls/universal/Switch.qml b/src/imports/controls/universal/Switch.qml index 962d5157..284b1229 100644 --- a/src/imports/controls/universal/Switch.qml +++ b/src/imports/controls/universal/Switch.qml @@ -54,7 +54,7 @@ T.Switch { property bool useSystemFocusVisuals: true indicator: SwitchIndicator { - x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 + x: control.text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 y: control.topPadding + (control.availableHeight - height) / 2 control: control } diff --git a/src/imports/controls/universal/SwitchDelegate.qml b/src/imports/controls/universal/SwitchDelegate.qml index bf6069f5..56ba8494 100644 --- a/src/imports/controls/universal/SwitchDelegate.qml +++ b/src/imports/controls/universal/SwitchDelegate.qml @@ -61,7 +61,7 @@ T.SwitchDelegate { icon.color: Color.transparent(Universal.foreground, enabled ? 1.0 : 0.2) indicator: SwitchIndicator { - x: text ? (control.mirrored ? control.leftPadding : control.width - width - control.rightPadding) : control.leftPadding + (control.availableWidth - width) / 2 + x: control.text ? (control.mirrored ? control.leftPadding : control.width - width - control.rightPadding) : control.leftPadding + (control.availableWidth - width) / 2 y: control.topPadding + (control.availableHeight - height) / 2 control: control } diff --git a/src/imports/controls/universal/SwitchIndicator.qml b/src/imports/controls/universal/SwitchIndicator.qml index ad9a23e9..10f39515 100644 --- a/src/imports/controls/universal/SwitchIndicator.qml +++ b/src/imports/controls/universal/SwitchIndicator.qml @@ -39,6 +39,7 @@ import QtQuick.Templates 2.12 as T import QtQuick.Controls.Universal 2.12 Item { + id: indicator implicitWidth: 44 implicitHeight: 20 @@ -47,13 +48,13 @@ Item { height: parent.height radius: 10 - color: !control.enabled ? "transparent" : - control.pressed ? control.Universal.baseMediumColor : - control.checked ? control.Universal.accent : "transparent" - border.color: !control.enabled ? control.Universal.baseLowColor : - control.checked && !control.pressed ? control.Universal.accent : - control.hovered && !control.checked && !control.pressed ? control.Universal.baseHighColor : control.Universal.baseMediumColor - opacity: control.hovered && control.checked && !control.pressed ? (control.Universal.theme === Universal.Light ? 0.7 : 0.9) : 1.0 + color: !indicator.control.enabled ? "transparent" : + indicator.control.pressed ? indicator.control.Universal.baseMediumColor : + indicator.control.checked ? indicator.control.Universal.accent : "transparent" + border.color: !indicator.control.enabled ? indicator.control.Universal.baseLowColor : + indicator.control.checked && !indicator.control.pressed ? indicator.control.Universal.accent : + indicator.control.hovered && !indicator.control.checked && !indicator.control.pressed ? indicator.control.Universal.baseHighColor : indicator.control.Universal.baseMediumColor + opacity: indicator.control.hovered && indicator.control.checked && !indicator.control.pressed ? (indicator.control.Universal.theme === Universal.Light ? 0.7 : 0.9) : 1.0 border.width: 2 } @@ -64,16 +65,16 @@ Item { height: 10 radius: 5 - color: !control.enabled ? control.Universal.baseLowColor : - control.pressed || control.checked ? control.Universal.chromeWhiteColor : - control.hovered && !control.checked ? control.Universal.baseHighColor : control.Universal.baseMediumHighColor + color: !indicator.control.enabled ? indicator.control.Universal.baseLowColor : + indicator.control.pressed || indicator.control.checked ? indicator.control.Universal.chromeWhiteColor : + indicator.control.hovered && !indicator.control.checked ? indicator.control.Universal.baseHighColor : indicator.control.Universal.baseMediumHighColor x: Math.max(5, Math.min(parent.width - width - 5, - control.visualPosition * parent.width - (width / 2))) + indicator.control.visualPosition * parent.width - (width / 2))) y: (parent.height - height) / 2 Behavior on x { - enabled: !control.pressed + enabled: !indicator.control.pressed SmoothedAnimation { velocity: 200 } } } diff --git a/src/imports/controls/universal/Tumbler.qml b/src/imports/controls/universal/Tumbler.qml index f7338c2b..d0e7b12f 100644 --- a/src/imports/controls/universal/Tumbler.qml +++ b/src/imports/controls/universal/Tumbler.qml @@ -63,11 +63,11 @@ T.Tumbler { model: control.model delegate: control.delegate path: Path { - startX: contentItem.width / 2 - startY: -contentItem.delegateHeight / 2 + startX: control.contentItem.width / 2 + startY: -control.contentItem.delegateHeight / 2 PathLine { - x: contentItem.width / 2 - y: (control.visibleItemCount + 1) * contentItem.delegateHeight - contentItem.delegateHeight / 2 + x: control.contentItem.width / 2 + y: (control.visibleItemCount + 1) * control.contentItem.delegateHeight - control.contentItem.delegateHeight / 2 } } diff --git a/src/imports/controls/universal/plugins.qmltypes b/src/imports/controls/universal/plugins.qmltypes index c80ff1d4..1734c01b 100644 --- a/src/imports/controls/universal/plugins.qmltypes +++ b/src/imports/controls/universal/plugins.qmltypes @@ -4,12 +4,212 @@ 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.Universal 2.13' +// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQuick.Controls.Universal 2.14' 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: "QQuickPaintedItem" + defaultProperty: "data" + prototype: "QQuickItem" + Enum { + name: "RenderTarget" + values: { + "Image": 0, + "FramebufferObject": 1, + "InvertedYFramebufferObject": 2 + } + } + Enum { + name: "PerformanceHints" + values: { + "FastFBOResizing": 1 + } + } + Property { name: "contentsSize"; type: "QSize" } + Property { name: "fillColor"; type: "QColor" } + Property { name: "contentsScale"; type: "double" } + Property { name: "renderTarget"; type: "RenderTarget" } + Property { name: "textureSize"; type: "QSize" } + } + Component { name: "QQuickUniversalBusyIndicator" defaultProperty: "data" prototype: "QQuickItem" |