aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/material
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports/controls/material')
-rw-r--r--src/imports/controls/material/ApplicationWindow.qml6
-rw-r--r--src/imports/controls/material/BoxShadow.qml6
-rw-r--r--src/imports/controls/material/BusyIndicator.qml27
-rw-r--r--src/imports/controls/material/Button.qml8
-rw-r--r--src/imports/controls/material/CheckBox.qml8
-rw-r--r--src/imports/controls/material/CheckDelegate.qml8
-rw-r--r--src/imports/controls/material/CheckIndicator.qml6
-rw-r--r--src/imports/controls/material/ComboBox.qml63
-rw-r--r--src/imports/controls/material/CursorDelegate.qml65
-rw-r--r--src/imports/controls/material/DelayButton.qml126
-rw-r--r--src/imports/controls/material/Dial.qml8
-rw-r--r--src/imports/controls/material/Dialog.qml10
-rw-r--r--src/imports/controls/material/DialogButtonBox.qml10
-rw-r--r--src/imports/controls/material/Drawer.qml10
-rw-r--r--src/imports/controls/material/ElevationEffect.qml6
-rw-r--r--src/imports/controls/material/Frame.qml8
-rw-r--r--src/imports/controls/material/GroupBox.qml8
-rw-r--r--src/imports/controls/material/ItemDelegate.qml8
-rw-r--r--src/imports/controls/material/Label.qml6
-rw-r--r--src/imports/controls/material/Menu.qml10
-rw-r--r--src/imports/controls/material/MenuItem.qml8
-rw-r--r--src/imports/controls/material/MenuSeparator.qml6
-rw-r--r--src/imports/controls/material/Page.qml6
-rw-r--r--src/imports/controls/material/PageIndicator.qml6
-rw-r--r--src/imports/controls/material/Pane.qml8
-rw-r--r--src/imports/controls/material/Popup.qml8
-rw-r--r--src/imports/controls/material/ProgressBar.qml18
-rw-r--r--src/imports/controls/material/RadioButton.qml8
-rw-r--r--src/imports/controls/material/RadioDelegate.qml8
-rw-r--r--src/imports/controls/material/RadioIndicator.qml6
-rw-r--r--src/imports/controls/material/RangeSlider.qml8
-rw-r--r--src/imports/controls/material/RoundButton.qml8
-rw-r--r--src/imports/controls/material/ScrollBar.qml19
-rw-r--r--src/imports/controls/material/ScrollIndicator.qml6
-rw-r--r--src/imports/controls/material/Slider.qml8
-rw-r--r--src/imports/controls/material/SliderHandle.qml6
-rw-r--r--src/imports/controls/material/SpinBox.qml37
-rw-r--r--src/imports/controls/material/StackView.qml4
-rw-r--r--src/imports/controls/material/SwipeDelegate.qml26
-rw-r--r--src/imports/controls/material/SwipeView.qml6
-rw-r--r--src/imports/controls/material/Switch.qml8
-rw-r--r--src/imports/controls/material/SwitchDelegate.qml8
-rw-r--r--src/imports/controls/material/SwitchIndicator.qml6
-rw-r--r--src/imports/controls/material/TabBar.qml16
-rw-r--r--src/imports/controls/material/TabButton.qml8
-rw-r--r--src/imports/controls/material/TextArea.qml38
-rw-r--r--src/imports/controls/material/TextField.qml37
-rw-r--r--src/imports/controls/material/ToolBar.qml8
-rw-r--r--src/imports/controls/material/ToolButton.qml8
-rw-r--r--src/imports/controls/material/ToolSeparator.qml6
-rw-r--r--src/imports/controls/material/ToolTip.qml6
-rw-r--r--src/imports/controls/material/Tumbler.qml10
-rw-r--r--src/imports/controls/material/images/drop-indicator.pngbin192 -> 205 bytes
-rw-r--r--src/imports/controls/material/images/drop-indicator@2x.pngbin221 -> 255 bytes
-rw-r--r--src/imports/controls/material/images/drop-indicator@3x.pngbin256 -> 306 bytes
-rw-r--r--src/imports/controls/material/images/drop-indicator@4x.pngbin289 -> 331 bytes
-rw-r--r--src/imports/controls/material/material.pri14
-rw-r--r--src/imports/controls/material/qmldir2
-rw-r--r--src/imports/controls/material/qquickmaterialbusyindicator.cpp229
-rw-r--r--src/imports/controls/material/qquickmaterialbusyindicator_p.h (renamed from src/imports/controls/material/qquickmaterialprogressring_p.h)31
-rw-r--r--src/imports/controls/material/qquickmaterialprogressbar.cpp (renamed from src/imports/controls/material/qquickmaterialprogressstrip.cpp)202
-rw-r--r--src/imports/controls/material/qquickmaterialprogressbar_p.h (renamed from src/imports/controls/material/qquickmaterialprogressstrip_p.h)27
-rw-r--r--src/imports/controls/material/qquickmaterialprogressring.cpp260
-rw-r--r--src/imports/controls/material/qquickmaterialripple.cpp335
-rw-r--r--src/imports/controls/material/qquickmaterialripple_p.h8
-rw-r--r--src/imports/controls/material/qquickmaterialstyle.cpp4
-rw-r--r--src/imports/controls/material/qquickmaterialstyle_p.h1
-rw-r--r--src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp16
68 files changed, 977 insertions, 928 deletions
diff --git a/src/imports/controls/material/ApplicationWindow.qml b/src/imports/controls/material/ApplicationWindow.qml
index f4c9374e..82a0d135 100644
--- a/src/imports/controls/material/ApplicationWindow.qml
+++ b/src/imports/controls/material/ApplicationWindow.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.8
+import QtQuick 2.9
import QtQuick.Window 2.2
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
T.ApplicationWindow {
id: window
diff --git a/src/imports/controls/material/BoxShadow.qml b/src/imports/controls/material/BoxShadow.qml
index 5655c842..aa9fd0fa 100644
--- a/src/imports/controls/material/BoxShadow.qml
+++ b/src/imports/controls/material/BoxShadow.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick 2.9
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
/*
A implementation of CSS's box-shadow, used by ElevationEffect for a Material Design
diff --git a/src/imports/controls/material/BusyIndicator.qml b/src/imports/controls/material/BusyIndicator.qml
index a04c7c91..f1cf8eb5 100644
--- a/src/imports/controls/material/BusyIndicator.qml
+++ b/src/imports/controls/material/BusyIndicator.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
T.BusyIndicator {
id: control
@@ -47,24 +47,13 @@ T.BusyIndicator {
padding: 6
- contentItem: ProgressRing {
- id: ring
- x: control.leftPadding + (control.availableWidth - width) / 2
- y: control.topPadding + (control.availableHeight - height) / 2
+ contentItem: BusyIndicatorImpl {
implicitWidth: 48
implicitHeight: 48
- width: size
- height: size
- opacity: control.running ? 1 : 0
color: control.Material.accentColor
- readonly property real size: Math.min(control.availableWidth, control.availableHeight)
-
- Behavior on opacity { OpacityAnimator { duration: 250 } }
-
- RingAnimator {
- target: ring
- running: control.visible && control.running
- }
+ opacity: control.running ? 1 : 0
+ visible: control.running || animator.running
+ Behavior on opacity { OpacityAnimator { id: animator; duration: 250 } }
}
}
diff --git a/src/imports/controls/material/Button.qml b/src/imports/controls/material/Button.qml
index 312fcb1b..471ca8f2 100644
--- a/src/imports/controls/material/Button.qml
+++ b/src/imports/controls/material/Button.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
T.Button {
id: control
diff --git a/src/imports/controls/material/CheckBox.qml b/src/imports/controls/material/CheckBox.qml
index f0ae3b78..e1c559da 100644
--- a/src/imports/controls/material/CheckBox.qml
+++ b/src/imports/controls/material/CheckBox.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
T.CheckBox {
id: control
diff --git a/src/imports/controls/material/CheckDelegate.qml b/src/imports/controls/material/CheckDelegate.qml
index ee91ea7d..545ca64a 100644
--- a/src/imports/controls/material/CheckDelegate.qml
+++ b/src/imports/controls/material/CheckDelegate.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
T.CheckDelegate {
id: control
diff --git a/src/imports/controls/material/CheckIndicator.qml b/src/imports/controls/material/CheckIndicator.qml
index 4c73974f..8fe860f0 100644
--- a/src/imports/controls/material/CheckIndicator.qml
+++ b/src/imports/controls/material/CheckIndicator.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick 2.9
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
Rectangle {
id: indicatorItem
diff --git a/src/imports/controls/material/ComboBox.qml b/src/imports/controls/material/ComboBox.qml
index c38c2b01..0721e8f3 100644
--- a/src/imports/controls/material/ComboBox.qml
+++ b/src/imports/controls/material/ComboBox.qml
@@ -34,12 +34,12 @@
**
****************************************************************************/
-import QtQuick 2.8
+import QtQuick 2.9
import QtQuick.Window 2.2
-import QtQuick.Controls 2.1
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick.Controls 2.2
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
T.ComboBox {
id: control
@@ -51,11 +51,8 @@ T.ComboBox {
indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding)
baselineOffset: contentItem.y + contentItem.baselineOffset
- spacing: 6
- // external vertical padding is 6 (to increase touch area)
- padding: 12
- leftPadding: padding - 4
- rightPadding: padding - 4
+ leftPadding: padding + (!control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing)
+ rightPadding: padding + (control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing)
Material.elevation: flat ? control.pressed || control.hovered ? 2 : 0
: control.pressed ? 8 : 2
@@ -63,31 +60,42 @@ T.ComboBox {
Material.foreground: flat ? undefined : Material.primaryTextColor
delegate: MenuItem {
- width: control.popup.width
+ width: parent.width
text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData
- Material.foreground: control.currentIndex === index ? control.popup.Material.accent : control.popup.Material.foreground
+ Material.foreground: control.currentIndex === index ? parent.Material.accent : parent.Material.foreground
highlighted: control.highlightedIndex === index
hoverEnabled: control.hoverEnabled
}
indicator: Image {
- x: control.mirrored ? control.leftPadding : control.width - width - control.rightPadding
+ x: control.mirrored ? control.padding : control.width - width - control.padding
y: control.topPadding + (control.availableHeight - height) / 2
source: "image://material/drop-indicator/" + (control.enabled ? control.Material.foreground : control.Material.hintTextColor)
sourceSize.width: width
sourceSize.height: height
}
- contentItem: Text {
- leftPadding: control.mirrored && control.indicator ? control.indicator.width + control.spacing : 0
- rightPadding: !control.mirrored && control.indicator ? control.indicator.width + control.spacing : 0
+ contentItem: T.TextField {
+ padding: 6
+ leftPadding: control.editable ? 2 : control.mirrored ? 0 : 12
+ rightPadding: control.editable ? 2 : control.mirrored ? 12 : 0
+
+ text: control.editable ? control.editText : control.displayText
+
+ enabled: control.editable
+ autoScroll: control.editable
+ readOnly: control.popup.visible
+ inputMethodHints: control.inputMethodHints
+ validator: control.validator
- text: control.displayText
font: control.font
color: control.enabled ? control.Material.foreground : control.Material.hintTextColor
+ selectionColor: control.Material.accentColor
+ selectedTextColor: control.Material.primaryHighlightedTextColor
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
- elide: Text.ElideRight
+
+ cursorDelegate: CursorDelegate { }
}
background: Rectangle {
@@ -98,32 +106,43 @@ T.ComboBox {
y: 6
height: parent.height - 12
radius: control.flat ? 0 : 2
- color: control.Material.dialogColor
+ color: !control.editable ? control.Material.dialogColor : "transparent"
Behavior on color {
+ enabled: !control.editable
ColorAnimation {
duration: 400
}
}
- layer.enabled: control.enabled && control.Material.background.a > 0
+ layer.enabled: control.enabled && !control.editable && control.Material.background.a > 0
layer.effect: ElevationEffect {
elevation: control.Material.elevation
}
+ Rectangle {
+ visible: control.editable
+ y: parent.y + control.baselineOffset
+ width: parent.width
+ height: control.activeFocus ? 2 : 1
+ color: control.editable && control.activeFocus ? control.Material.accentColor : control.Material.hintTextColor
+ }
+
Ripple {
clip: control.flat
clipRadius: control.flat ? 0 : 2
- width: parent.width
+ x: control.editable && control.indicator ? control.indicator.x : 0
+ width: control.editable && control.indicator ? control.indicator.width : parent.width
height: parent.height
pressed: control.pressed
- anchor: control
+ anchor: control.editable && control.indicator ? control.indicator : control
active: control.pressed || control.visualFocus || control.hovered
color: control.Material.rippleColor
}
}
popup: T.Popup {
+ y: control.editable ? control.height - 5 : 0
width: control.width
implicitHeight: contentItem.implicitHeight
transformOrigin: Item.Top
diff --git a/src/imports/controls/material/CursorDelegate.qml b/src/imports/controls/material/CursorDelegate.qml
new file mode 100644
index 00000000..0880bc0a
--- /dev/null
+++ b/src/imports/controls/material/CursorDelegate.qml
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Controls.Material 2.2
+
+Rectangle {
+ id: cursor
+
+ color: parent.Material.accentColor
+ width: 2
+ visible: parent.activeFocus && parent.selectionStart === parent.selectionEnd
+
+ Connections {
+ target: cursor.parent
+ onCursorPositionChanged: {
+ // keep a moving cursor visible
+ cursor.opacity = 1
+ timer.restart()
+ }
+ }
+
+ Timer {
+ id: timer
+ running: cursor.parent.activeFocus
+ repeat: true
+ interval: Qt.styleHints.cursorFlashTime / 2
+ onTriggered: cursor.opacity = !cursor.opacity ? 1 : 0
+ // force the cursor visible when gaining focus
+ onRunningChanged: cursor.opacity = 1
+ }
+}
diff --git a/src/imports/controls/material/DelayButton.qml b/src/imports/controls/material/DelayButton.qml
new file mode 100644
index 00000000..8bc48784
--- /dev/null
+++ b/src/imports/controls/material/DelayButton.qml
@@ -0,0 +1,126 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
+
+T.DelayButton {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ contentItem.implicitHeight + topPadding + bottomPadding)
+ baselineOffset: contentItem.y + contentItem.baselineOffset
+
+ // external vertical padding is 6 (to increase touch area)
+ padding: 12
+ leftPadding: padding - 4
+ rightPadding: padding - 4
+
+ Material.elevation: control.down ? 8 : 2
+
+ transition: Transition {
+ NumberAnimation {
+ duration: control.delay * (control.pressed ? 1.0 - control.progress : 0.3 * control.progress)
+ }
+ }
+
+ contentItem: Text {
+ text: control.text
+ font: control.font
+ color: !control.enabled ? control.Material.hintTextColor : control.Material.foreground
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ elide: Text.ElideRight
+ }
+
+ // TODO: Add a proper ripple/ink effect for mouse/touch input and focus state
+ background: Rectangle {
+ implicitWidth: 64
+ implicitHeight: 48
+
+ // external vertical padding is 6 (to increase touch area)
+ y: 6
+ width: parent.width
+ height: parent.height - 12
+ radius: 2
+ color: !control.enabled ? control.Material.buttonDisabledColor : control.Material.buttonColor
+
+ PaddedRectangle {
+ y: parent.height - 4
+ width: parent.width
+ height: 4
+ radius: 2
+ topPadding: -2
+ clip: true
+ color: control.checked && control.enabled ? control.Material.accentColor : control.Material.secondaryTextColor
+
+ PaddedRectangle {
+ width: parent.width * control.progress
+ height: 4
+ radius: 2
+ topPadding: -2
+ rightPadding: Math.max(-2, width - parent.width)
+ clip: true
+ color: control.Material.accentColor
+ }
+ }
+
+ Behavior on color {
+ ColorAnimation {
+ duration: 400
+ }
+ }
+
+ layer.enabled: control.enabled && control.Material.buttonColor.a > 0
+ layer.effect: ElevationEffect {
+ elevation: control.Material.elevation
+ }
+
+ Ripple {
+ clipRadius: 2
+ width: parent.width
+ height: parent.height
+ pressed: control.pressed
+ anchor: control
+ active: control.down || control.visualFocus || control.hovered
+ color: control.Material.rippleColor
+ }
+ }
+}
diff --git a/src/imports/controls/material/Dial.qml b/src/imports/controls/material/Dial.qml
index abed2e93..e0632e62 100644
--- a/src/imports/controls/material/Dial.qml
+++ b/src/imports/controls/material/Dial.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
T.Dial {
id: control
diff --git a/src/imports/controls/material/Dialog.qml b/src/imports/controls/material/Dialog.qml
index 7d73b057..a97cb2fd 100644
--- a/src/imports/controls/material/Dialog.qml
+++ b/src/imports/controls/material/Dialog.qml
@@ -34,11 +34,11 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls 2.1
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls 2.2
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
T.Dialog {
id: control
diff --git a/src/imports/controls/material/DialogButtonBox.qml b/src/imports/controls/material/DialogButtonBox.qml
index 668b7664..c36a7749 100644
--- a/src/imports/controls/material/DialogButtonBox.qml
+++ b/src/imports/controls/material/DialogButtonBox.qml
@@ -34,11 +34,11 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls 2.1
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls 2.2
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
T.DialogButtonBox {
id: control
diff --git a/src/imports/controls/material/Drawer.qml b/src/imports/controls/material/Drawer.qml
index b52c910b..dc06c895 100644
--- a/src/imports/controls/material/Drawer.qml
+++ b/src/imports/controls/material/Drawer.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
T.Drawer {
id: control
@@ -58,7 +58,7 @@ T.Drawer {
enter: Transition { SmoothedAnimation { velocity: 5 } }
exit: Transition { SmoothedAnimation { velocity: 5 } }
- Material.elevation: 16
+ Material.elevation: !interactive && !dim ? 0 : 16
background: Rectangle {
color: control.Material.dialogColor
diff --git a/src/imports/controls/material/ElevationEffect.qml b/src/imports/controls/material/ElevationEffect.qml
index 9872c970..0d0c1992 100644
--- a/src/imports/controls/material/ElevationEffect.qml
+++ b/src/imports/controls/material/ElevationEffect.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick 2.9
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
/*
An effect for standard Material Design elevation shadows. Useful for using as \c layer.effect.
diff --git a/src/imports/controls/material/Frame.qml b/src/imports/controls/material/Frame.qml
index 01ea19f6..760fc6d2 100644
--- a/src/imports/controls/material/Frame.qml
+++ b/src/imports/controls/material/Frame.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
T.Frame {
id: control
diff --git a/src/imports/controls/material/GroupBox.qml b/src/imports/controls/material/GroupBox.qml
index de46466b..e7055404 100644
--- a/src/imports/controls/material/GroupBox.qml
+++ b/src/imports/controls/material/GroupBox.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
T.GroupBox {
id: control
diff --git a/src/imports/controls/material/ItemDelegate.qml b/src/imports/controls/material/ItemDelegate.qml
index 6d20c933..59d51c36 100644
--- a/src/imports/controls/material/ItemDelegate.qml
+++ b/src/imports/controls/material/ItemDelegate.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
T.ItemDelegate {
id: control
diff --git a/src/imports/controls/material/Label.qml b/src/imports/controls/material/Label.qml
index 5e0dfb70..4433e248 100644
--- a/src/imports/controls/material/Label.qml
+++ b/src/imports/controls/material/Label.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
T.Label {
id: control
diff --git a/src/imports/controls/material/Menu.qml b/src/imports/controls/material/Menu.qml
index d93d6401..3e76c81d 100644
--- a/src/imports/controls/material/Menu.qml
+++ b/src/imports/controls/material/Menu.qml
@@ -34,11 +34,11 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Controls 2.1
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick 2.9
+import QtQuick.Controls 2.2
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
T.Menu {
id: control
diff --git a/src/imports/controls/material/MenuItem.qml b/src/imports/controls/material/MenuItem.qml
index db7b83f0..5a136231 100644
--- a/src/imports/controls/material/MenuItem.qml
+++ b/src/imports/controls/material/MenuItem.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
T.MenuItem {
id: control
diff --git a/src/imports/controls/material/MenuSeparator.qml b/src/imports/controls/material/MenuSeparator.qml
index 00d4feeb..fd0febbe 100644
--- a/src/imports/controls/material/MenuSeparator.qml
+++ b/src/imports/controls/material/MenuSeparator.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
T.MenuSeparator {
id: control
diff --git a/src/imports/controls/material/Page.qml b/src/imports/controls/material/Page.qml
index 9df31627..825b9f90 100644
--- a/src/imports/controls/material/Page.qml
+++ b/src/imports/controls/material/Page.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
T.Page {
id: control
diff --git a/src/imports/controls/material/PageIndicator.qml b/src/imports/controls/material/PageIndicator.qml
index 3e86d89e..15acae5e 100644
--- a/src/imports/controls/material/PageIndicator.qml
+++ b/src/imports/controls/material/PageIndicator.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
T.PageIndicator {
id: control
diff --git a/src/imports/controls/material/Pane.qml b/src/imports/controls/material/Pane.qml
index e0f19069..925778fa 100644
--- a/src/imports/controls/material/Pane.qml
+++ b/src/imports/controls/material/Pane.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
T.Pane {
id: control
diff --git a/src/imports/controls/material/Popup.qml b/src/imports/controls/material/Popup.qml
index 7a49f231..04b58c2a 100644
--- a/src/imports/controls/material/Popup.qml
+++ b/src/imports/controls/material/Popup.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
T.Popup {
id: control
diff --git a/src/imports/controls/material/ProgressBar.qml b/src/imports/controls/material/ProgressBar.qml
index 431b2b69..1bc03016 100644
--- a/src/imports/controls/material/ProgressBar.qml
+++ b/src/imports/controls/material/ProgressBar.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
T.ProgressBar {
id: control
@@ -47,19 +47,13 @@ T.ProgressBar {
implicitHeight: Math.max(background ? background.implicitHeight : 0,
contentItem.implicitHeight + topPadding + bottomPadding)
- contentItem: ProgressStrip {
- id: strip
+ contentItem: ProgressBarImpl {
implicitHeight: 4
scale: control.mirrored ? -1 : 1
- indeterminate: control.indeterminate
color: control.Material.accentColor
progress: control.position
-
- StripAnimator {
- target: strip
- running: control.visible && control.indeterminate
- }
+ indeterminate: control.visible && control.indeterminate
}
background: Rectangle {
diff --git a/src/imports/controls/material/RadioButton.qml b/src/imports/controls/material/RadioButton.qml
index c21fe88c..d178654f 100644
--- a/src/imports/controls/material/RadioButton.qml
+++ b/src/imports/controls/material/RadioButton.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
T.RadioButton {
id: control
diff --git a/src/imports/controls/material/RadioDelegate.qml b/src/imports/controls/material/RadioDelegate.qml
index 855b0936..fb4f33dc 100644
--- a/src/imports/controls/material/RadioDelegate.qml
+++ b/src/imports/controls/material/RadioDelegate.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
T.RadioDelegate {
id: control
diff --git a/src/imports/controls/material/RadioIndicator.qml b/src/imports/controls/material/RadioIndicator.qml
index b611d145..82b01ad3 100644
--- a/src/imports/controls/material/RadioIndicator.qml
+++ b/src/imports/controls/material/RadioIndicator.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick 2.9
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
Rectangle {
implicitWidth: 20
diff --git a/src/imports/controls/material/RangeSlider.qml b/src/imports/controls/material/RangeSlider.qml
index e90533d8..0b38ad6d 100644
--- a/src/imports/controls/material/RangeSlider.qml
+++ b/src/imports/controls/material/RangeSlider.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
T.RangeSlider {
id: control
diff --git a/src/imports/controls/material/RoundButton.qml b/src/imports/controls/material/RoundButton.qml
index b06e936f..3ce3b39b 100644
--- a/src/imports/controls/material/RoundButton.qml
+++ b/src/imports/controls/material/RoundButton.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
T.RoundButton {
id: control
diff --git a/src/imports/controls/material/ScrollBar.qml b/src/imports/controls/material/ScrollBar.qml
index f5cc1b36..5993ab58 100644
--- a/src/imports/controls/material/ScrollBar.qml
+++ b/src/imports/controls/material/ScrollBar.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
T.ScrollBar {
id: control
@@ -46,25 +46,26 @@ T.ScrollBar {
implicitHeight: Math.max(background ? background.implicitHeight : 0,
contentItem.implicitHeight + topPadding + bottomPadding)
- padding: 1
+ padding: control.interactive ? 1 : 2
contentItem: Rectangle {
id: handle
- implicitWidth: 13
- implicitHeight: 13
+ implicitWidth: control.interactive ? 13 : 4
+ implicitHeight: control.interactive ? 13 : 4
color: control.pressed ? control.Material.scrollBarPressedColor :
- control.hovered ? control.Material.scrollBarHoveredColor : control.Material.scrollBarColor
+ control.interactive && control.hovered ? control.Material.scrollBarHoveredColor : control.Material.scrollBarColor
visible: control.size < 1.0
opacity: 0.0
}
background: Rectangle {
- implicitWidth: 16
- implicitHeight: 16
+ implicitWidth: control.interactive ? 16 : 4
+ implicitHeight: control.interactive ? 16 : 4
color: "#0e000000"
opacity: 0.0
+ visible: control.interactive
}
states: State {
diff --git a/src/imports/controls/material/ScrollIndicator.qml b/src/imports/controls/material/ScrollIndicator.qml
index 64597dd6..effb18ad 100644
--- a/src/imports/controls/material/ScrollIndicator.qml
+++ b/src/imports/controls/material/ScrollIndicator.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
T.ScrollIndicator {
id: control
diff --git a/src/imports/controls/material/Slider.qml b/src/imports/controls/material/Slider.qml
index 7f855fd7..cb60dba6 100644
--- a/src/imports/controls/material/Slider.qml
+++ b/src/imports/controls/material/Slider.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
T.Slider {
id: control
diff --git a/src/imports/controls/material/SliderHandle.qml b/src/imports/controls/material/SliderHandle.qml
index 2d564817..dd4de4a2 100644
--- a/src/imports/controls/material/SliderHandle.qml
+++ b/src/imports/controls/material/SliderHandle.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick 2.9
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
Item {
id: root
diff --git a/src/imports/controls/material/SpinBox.qml b/src/imports/controls/material/SpinBox.qml
index f1575152..f0dfba08 100644
--- a/src/imports/controls/material/SpinBox.qml
+++ b/src/imports/controls/material/SpinBox.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
T.SpinBox {
id: control
@@ -73,35 +73,12 @@ T.SpinBox {
selectedTextColor: control.Material.foreground
horizontalAlignment: Qt.AlignHCenter
verticalAlignment: Qt.AlignVCenter
- cursorDelegate: Rectangle {
- id: cursor
- color: control.Material.accentColor
- width: 2
- visible: control.activeFocus && contentItem.selectionStart === contentItem.selectionEnd
-
- Connections {
- target: contentItem
- onCursorPositionChanged: {
- // keep a moving cursor visible
- cursor.opacity = 1
- timer.restart()
- }
- }
-
- Timer {
- id: timer
- running: control.activeFocus
- repeat: true
- interval: Qt.styleHints.cursorFlashTime / 2
- onTriggered: cursor.opacity = !cursor.opacity ? 1 : 0
- // force the cursor visible when gaining focus
- onRunningChanged: cursor.opacity = 1
- }
- }
+
+ cursorDelegate: CursorDelegate { }
readOnly: !control.editable
validator: control.validator
- inputMethodHints: Qt.ImhDigitsOnly
+ inputMethodHints: control.inputMethodHints
}
up.indicator: Item {
diff --git a/src/imports/controls/material/StackView.qml b/src/imports/controls/material/StackView.qml
index f5f775b8..03cd384d 100644
--- a/src/imports/controls/material/StackView.qml
+++ b/src/imports/controls/material/StackView.qml
@@ -34,8 +34,8 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
T.StackView {
id: control
diff --git a/src/imports/controls/material/SwipeDelegate.qml b/src/imports/controls/material/SwipeDelegate.qml
index 457ba69c..d9014fcd 100644
--- a/src/imports/controls/material/SwipeDelegate.qml
+++ b/src/imports/controls/material/SwipeDelegate.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
T.SwipeDelegate {
id: control
@@ -54,6 +54,8 @@ T.SwipeDelegate {
bottomPadding: 8
spacing: 16
+ swipe.transition: Transition { SmoothedAnimation { velocity: 3; easing.type: Easing.InOutCubic } }
+
contentItem: Text {
leftPadding: !control.mirrored ? (control.indicator ? control.indicator.width + control.spacing : 0) : 0
rightPadding: control.mirrored ? (control.indicator ? control.indicator.width + control.spacing : 0) : 0
@@ -65,14 +67,6 @@ T.SwipeDelegate {
visible: control.text
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
-
- Behavior on x {
- enabled: !control.down
- NumberAnimation {
- easing.type: Easing.InOutCubic
- duration: 400
- }
- }
}
background: Rectangle {
@@ -98,13 +92,5 @@ T.SwipeDelegate {
color: control.Material.rippleColor
enabled: control.swipe.position === 0
}
-
- Behavior on x {
- enabled: !control.down
- NumberAnimation {
- easing.type: Easing.InOutCubic
- duration: 400
- }
- }
}
}
diff --git a/src/imports/controls/material/SwipeView.qml b/src/imports/controls/material/SwipeView.qml
index 400ac571..293cce46 100644
--- a/src/imports/controls/material/SwipeView.qml
+++ b/src/imports/controls/material/SwipeView.qml
@@ -34,8 +34,8 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
T.SwipeView {
id: control
@@ -51,7 +51,7 @@ T.SwipeView {
currentIndex: control.currentIndex
spacing: control.spacing
- orientation: Qt.Horizontal
+ orientation: control.orientation
snapMode: ListView.SnapOneItem
boundsBehavior: Flickable.StopAtBounds
diff --git a/src/imports/controls/material/Switch.qml b/src/imports/controls/material/Switch.qml
index e026c80e..c4f279ee 100644
--- a/src/imports/controls/material/Switch.qml
+++ b/src/imports/controls/material/Switch.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
-import QtQuick.Templates 2.1 as T
+import QtQuick 2.9
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
+import QtQuick.Templates 2.2 as T
T.Switch {
id: control
diff --git a/src/imports/controls/material/SwitchDelegate.qml b/src/imports/controls/material/SwitchDelegate.qml
index 16551519..717ee250 100644
--- a/src/imports/controls/material/SwitchDelegate.qml
+++ b/src/imports/controls/material/SwitchDelegate.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
T.SwitchDelegate {
id: control
diff --git a/src/imports/controls/material/SwitchIndicator.qml b/src/imports/controls/material/SwitchIndicator.qml
index 753db60b..0ac7aee3 100644
--- a/src/imports/controls/material/SwitchIndicator.qml
+++ b/src/imports/controls/material/SwitchIndicator.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick 2.9
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
Item {
id: indicator
diff --git a/src/imports/controls/material/TabBar.qml b/src/imports/controls/material/TabBar.qml
index c7577e79..db076447 100644
--- a/src/imports/controls/material/TabBar.qml
+++ b/src/imports/controls/material/TabBar.qml
@@ -34,25 +34,23 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
T.TabBar {
id: control
implicitWidth: Math.max(background ? background.implicitWidth : 0,
- contentItem.implicitWidth + leftPadding + rightPadding)
+ contentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(background ? background.implicitHeight : 0,
- contentItem.implicitHeight + topPadding + bottomPadding)
+ contentHeight + topPadding + bottomPadding)
spacing: 1
+ contentHeight: 48
contentItem: ListView {
- implicitWidth: contentWidth
- implicitHeight: 48
-
model: control.contentModel
currentIndex: control.currentIndex
diff --git a/src/imports/controls/material/TabButton.qml b/src/imports/controls/material/TabButton.qml
index bd068637..d83fc441 100644
--- a/src/imports/controls/material/TabButton.qml
+++ b/src/imports/controls/material/TabButton.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
T.TabButton {
id: control
diff --git a/src/imports/controls/material/TextArea.qml b/src/imports/controls/material/TextArea.qml
index afca4aa8..34c633b6 100644
--- a/src/imports/controls/material/TextArea.qml
+++ b/src/imports/controls/material/TextArea.qml
@@ -34,9 +34,12 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls 2.2
+import QtQuick.Controls.impl 2.2
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
T.TextArea {
id: control
@@ -54,34 +57,10 @@ T.TextArea {
color: enabled ? Material.foreground : Material.hintTextColor
selectionColor: Material.accentColor
selectedTextColor: Material.primaryHighlightedTextColor
- cursorDelegate: Rectangle {
- id: cursor
- clip: true // TODO
- color: control.Material.accentColor
- width: 2
- visible: control.activeFocus && control.selectionStart === control.selectionEnd
- Connections {
- target: control
- onCursorPositionChanged: {
- // keep a moving cursor visible
- cursor.opacity = 1
- timer.restart()
- }
- }
+ cursorDelegate: CursorDelegate { }
- Timer {
- id: timer
- running: control.activeFocus
- repeat: true
- interval: Qt.styleHints.cursorFlashTime / 2
- onTriggered: cursor.opacity = !cursor.opacity ? 1 : 0
- // force the cursor visible when gaining focus
- onRunningChanged: cursor.opacity = 1
- }
- }
-
- Text {
+ PlaceholderText {
id: placeholder
x: control.leftPadding
y: control.topPadding
@@ -90,7 +69,6 @@ T.TextArea {
text: control.placeholderText
font: control.font
color: control.Material.hintTextColor
- horizontalAlignment: control.horizontalAlignment
verticalAlignment: control.verticalAlignment
elide: Text.ElideRight
visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter)
diff --git a/src/imports/controls/material/TextField.qml b/src/imports/controls/material/TextField.qml
index 4b4d24a9..f5c77f86 100644
--- a/src/imports/controls/material/TextField.qml
+++ b/src/imports/controls/material/TextField.qml
@@ -34,9 +34,12 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls 2.2
+import QtQuick.Controls.impl 2.2
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
T.TextField {
id: control
@@ -55,33 +58,10 @@ T.TextField {
selectionColor: Material.accentColor
selectedTextColor: Material.primaryHighlightedTextColor
verticalAlignment: TextInput.AlignVCenter
- cursorDelegate: Rectangle {
- id: cursor
- color: control.Material.accentColor
- width: 2
- visible: control.activeFocus && control.selectionStart === control.selectionEnd
- Connections {
- target: control
- onCursorPositionChanged: {
- // keep a moving cursor visible
- cursor.opacity = 1
- timer.restart()
- }
- }
+ cursorDelegate: CursorDelegate { }
- Timer {
- id: timer
- running: control.activeFocus
- repeat: true
- interval: Qt.styleHints.cursorFlashTime / 2
- onTriggered: cursor.opacity = !cursor.opacity ? 1 : 0
- // force the cursor visible when gaining focus
- onRunningChanged: cursor.opacity = 1
- }
- }
-
- Text {
+ PlaceholderText {
id: placeholder
x: control.leftPadding
y: control.topPadding
@@ -90,7 +70,6 @@ T.TextField {
text: control.placeholderText
font: control.font
color: control.Material.hintTextColor
- horizontalAlignment: control.horizontalAlignment
verticalAlignment: control.verticalAlignment
elide: Text.ElideRight
visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter)
diff --git a/src/imports/controls/material/ToolBar.qml b/src/imports/controls/material/ToolBar.qml
index b4c8f27b..228a2692 100644
--- a/src/imports/controls/material/ToolBar.qml
+++ b/src/imports/controls/material/ToolBar.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
T.ToolBar {
id: control
diff --git a/src/imports/controls/material/ToolButton.qml b/src/imports/controls/material/ToolButton.qml
index cdb50746..eaff0b1c 100644
--- a/src/imports/controls/material/ToolButton.qml
+++ b/src/imports/controls/material/ToolButton.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
T.ToolButton {
id: control
diff --git a/src/imports/controls/material/ToolSeparator.qml b/src/imports/controls/material/ToolSeparator.qml
index 7ad8d430..84c28441 100644
--- a/src/imports/controls/material/ToolSeparator.qml
+++ b/src/imports/controls/material/ToolSeparator.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
T.ToolSeparator {
id: control
diff --git a/src/imports/controls/material/ToolTip.qml b/src/imports/controls/material/ToolTip.qml
index 2f4830bc..a1c2b0ef 100644
--- a/src/imports/controls/material/ToolTip.qml
+++ b/src/imports/controls/material/ToolTip.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
+import QtQuick 2.9
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
T.ToolTip {
id: control
diff --git a/src/imports/controls/material/Tumbler.qml b/src/imports/controls/material/Tumbler.qml
index 09335101..9b1309ab 100644
--- a/src/imports/controls/material/Tumbler.qml
+++ b/src/imports/controls/material/Tumbler.qml
@@ -34,11 +34,11 @@
**
****************************************************************************/
-import QtQuick 2.8
-import QtQuick.Controls 2.1
-import QtQuick.Controls.impl 2.1
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
+import QtQuick 2.9
+import QtQuick.Controls 2.2
+import QtQuick.Controls.impl 2.2
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
T.Tumbler {
id: control
diff --git a/src/imports/controls/material/images/drop-indicator.png b/src/imports/controls/material/images/drop-indicator.png
index 08bb4855..0f61fbb7 100644
--- a/src/imports/controls/material/images/drop-indicator.png
+++ b/src/imports/controls/material/images/drop-indicator.png
Binary files differ
diff --git a/src/imports/controls/material/images/drop-indicator@2x.png b/src/imports/controls/material/images/drop-indicator@2x.png
index ccdfc2b1..8f555eee 100644
--- a/src/imports/controls/material/images/drop-indicator@2x.png
+++ b/src/imports/controls/material/images/drop-indicator@2x.png
Binary files differ
diff --git a/src/imports/controls/material/images/drop-indicator@3x.png b/src/imports/controls/material/images/drop-indicator@3x.png
index 00cae691..7fd2af1f 100644
--- a/src/imports/controls/material/images/drop-indicator@3x.png
+++ b/src/imports/controls/material/images/drop-indicator@3x.png
Binary files differ
diff --git a/src/imports/controls/material/images/drop-indicator@4x.png b/src/imports/controls/material/images/drop-indicator@4x.png
index 0a61cb01..7e81fdd8 100644
--- a/src/imports/controls/material/images/drop-indicator@4x.png
+++ b/src/imports/controls/material/images/drop-indicator@4x.png
Binary files differ
diff --git a/src/imports/controls/material/material.pri b/src/imports/controls/material/material.pri
index 3170a695..64d91442 100644
--- a/src/imports/controls/material/material.pri
+++ b/src/imports/controls/material/material.pri
@@ -1,16 +1,16 @@
HEADERS += \
+ $$PWD/qquickmaterialbusyindicator_p.h \
+ $$PWD/qquickmaterialprogressbar_p.h \
$$PWD/qquickmaterialripple_p.h \
$$PWD/qquickmaterialstyle_p.h \
- $$PWD/qquickmaterialtheme_p.h \
- $$PWD/qquickmaterialprogressring_p.h \
- $$PWD/qquickmaterialprogressstrip_p.h
+ $$PWD/qquickmaterialtheme_p.h
SOURCES += \
+ $$PWD/qquickmaterialbusyindicator.cpp \
+ $$PWD/qquickmaterialprogressbar.cpp \
$$PWD/qquickmaterialripple.cpp \
$$PWD/qquickmaterialstyle.cpp \
- $$PWD/qquickmaterialtheme.cpp \
- $$PWD/qquickmaterialprogressring.cpp \
- $$PWD/qquickmaterialprogressstrip.cpp
+ $$PWD/qquickmaterialtheme.cpp
QML_FILES += \
$$PWD/ApplicationWindow.qml \
@@ -21,6 +21,8 @@ QML_FILES += \
$$PWD/CheckDelegate.qml \
$$PWD/CheckIndicator.qml \
$$PWD/ComboBox.qml \
+ $$PWD/CursorDelegate.qml \
+ $$PWD/DelayButton.qml \
$$PWD/Dial.qml \
$$PWD/Dialog.qml \
$$PWD/DialogButtonBox.qml \
diff --git a/src/imports/controls/material/qmldir b/src/imports/controls/material/qmldir
index 27d1298a..839ca3af 100644
--- a/src/imports/controls/material/qmldir
+++ b/src/imports/controls/material/qmldir
@@ -1,4 +1,4 @@
module QtQuick.Controls.Material
plugin qtquickcontrols2materialstyleplugin
classname QtQuickControls2MaterialStylePlugin
-depends QtQuick.Controls 2.1
+depends QtQuick.Controls 2.2
diff --git a/src/imports/controls/material/qquickmaterialbusyindicator.cpp b/src/imports/controls/material/qquickmaterialbusyindicator.cpp
new file mode 100644
index 00000000..7bc96505
--- /dev/null
+++ b/src/imports/controls/material/qquickmaterialbusyindicator.cpp
@@ -0,0 +1,229 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qquickmaterialbusyindicator_p.h"
+
+#include <QtCore/qeasingcurve.h>
+#include <QtGui/qpainter.h>
+#include <QtQuick/qsgimagenode.h>
+#include <QtQuick/qquickwindow.h>
+#include <QtQuickControls2/private/qquickanimatednode_p.h>
+
+QT_BEGIN_NAMESPACE
+
+/*
+ Relevant Android code:
+
+ - core/res/res/anim/progress_indeterminate_rotation_material.xml contains
+ the rotation animation data.
+ - core/res/res/anim/progress_indeterminate_material.xml contains the trim
+ animation data.
+ - core/res/res/interpolator/trim_start_interpolator.xml and
+ core/res/res/interpolator/trim_end_interpolator.xml contain the start
+ and end trim path interpolators.
+ - addCommand() in core/java/android/util/PathParser.java has a list of the
+ different path commands available.
+*/
+
+static const int SpanAnimationDuration = 700;
+static const int RotationAnimationDuration = SpanAnimationDuration * 6;
+static const int TargetRotation = 720;
+static const int OneDegree = 16;
+static const qreal MinSweepSpan = 10 * OneDegree;
+static const qreal MaxSweepSpan = 300 * OneDegree;
+
+class QQuickMaterialBusyIndicatorNode : public QQuickAnimatedNode
+{
+public:
+ QQuickMaterialBusyIndicatorNode(QQuickMaterialBusyIndicator *item);
+
+ void sync(QQuickItem *item) override;
+
+protected:
+ void updateCurrentTime(int time) override;
+
+private:
+ int m_lastStartAngle;
+ int m_lastEndAngle;
+ qreal m_width;
+ qreal m_height;
+ qreal m_devicePixelRatio;
+ QColor m_color;
+};
+
+QQuickMaterialBusyIndicatorNode::QQuickMaterialBusyIndicatorNode(QQuickMaterialBusyIndicator *item)
+ : QQuickAnimatedNode(item),
+ m_lastStartAngle(0),
+ m_lastEndAngle(0),
+ m_width(0),
+ m_height(0),
+ m_devicePixelRatio(1)
+{
+ setLoopCount(Infinite);
+ setCurrentTime(item->elapsed());
+ setDuration(RotationAnimationDuration);
+
+ QSGImageNode *textureNode = item->window()->createImageNode();
+ textureNode->setOwnsTexture(true);
+ appendChildNode(textureNode);
+
+ // A texture seems to be required here, but we don't have one yet, as we haven't drawn anything,
+ // so just use a blank image.
+ QImage blankImage(item->width(), item->height(), QImage::Format_ARGB32_Premultiplied);
+ blankImage.fill(Qt::transparent);
+ textureNode->setTexture(item->window()->createTextureFromImage(blankImage));
+}
+
+void QQuickMaterialBusyIndicatorNode::updateCurrentTime(int time)
+{
+ const qreal w = m_width;
+ const qreal h = m_height;
+ const qreal size = qMin(w, h);
+ const qreal dx = (w - size) / 2;
+ const qreal dy = (h - size) / 2;
+
+ QImage image(size * m_devicePixelRatio, size * m_devicePixelRatio, QImage::Format_ARGB32_Premultiplied);
+ image.fill(Qt::transparent);
+
+ QPainter painter(&image);
+ painter.setRenderHint(QPainter::Antialiasing);
+
+ QPen pen;
+ QSGImageNode *textureNode = static_cast<QSGImageNode *>(firstChild());
+ pen.setColor(m_color);
+ pen.setWidth(4 * m_devicePixelRatio);
+ painter.setPen(pen);
+
+ const qreal percentageComplete = time / qreal(RotationAnimationDuration);
+ const qreal spanPercentageComplete = (time % SpanAnimationDuration) / qreal(SpanAnimationDuration);
+ const int iteration = time / SpanAnimationDuration;
+ int startAngle = 0;
+ int endAngle = 0;
+
+ if (iteration % 2 == 0) {
+ if (m_lastStartAngle > 360 * OneDegree)
+ m_lastStartAngle -= 360 * OneDegree;
+
+ // The start angle is only affected by the rotation animation for the "grow" phase.
+ startAngle = m_lastStartAngle;
+ QEasingCurve angleCurve(QEasingCurve::OutQuad);
+ const qreal percentage = angleCurve.valueForProgress(spanPercentageComplete);
+ endAngle = m_lastStartAngle + MinSweepSpan + percentage * (MaxSweepSpan - MinSweepSpan);
+ m_lastEndAngle = endAngle;
+ } else {
+ // Both the start angle *and* the span are affected by the "shrink" phase.
+ QEasingCurve angleCurve(QEasingCurve::InQuad);
+ const qreal percentage = angleCurve.valueForProgress(spanPercentageComplete);
+ startAngle = m_lastEndAngle - MaxSweepSpan + percentage * (MaxSweepSpan - MinSweepSpan);
+ endAngle = m_lastEndAngle;
+ m_lastStartAngle = startAngle;
+ }
+
+ const int halfPen = pen.width() / 2;
+ const QRectF arcBounds = QRectF(halfPen, halfPen,
+ m_devicePixelRatio * size - pen.width(),
+ m_devicePixelRatio * size - pen.width());
+ // The current angle of the rotation animation.
+ const qreal rotation = OneDegree * percentageComplete * -TargetRotation;
+ startAngle -= rotation;
+ endAngle -= rotation;
+ const int angleSpan = endAngle - startAngle;
+ painter.drawArc(arcBounds, -startAngle, -angleSpan);
+ painter.end();
+
+ textureNode->setRect(QRectF(dx, dy, size, size));
+ textureNode->setTexture(window()->createTextureFromImage(image));
+}
+
+void QQuickMaterialBusyIndicatorNode::sync(QQuickItem *item)
+{
+ QQuickMaterialBusyIndicator *indicator = static_cast<QQuickMaterialBusyIndicator *>(item);
+ m_color = indicator->color();
+ m_width = indicator->width();
+ m_height = indicator->height();
+ m_devicePixelRatio = indicator->window()->effectiveDevicePixelRatio();
+}
+
+QQuickMaterialBusyIndicator::QQuickMaterialBusyIndicator(QQuickItem *parent) :
+ QQuickItem(parent)
+{
+ setFlag(ItemHasContents);
+}
+
+QColor QQuickMaterialBusyIndicator::color() const
+{
+ return m_color;
+}
+
+void QQuickMaterialBusyIndicator::setColor(QColor color)
+{
+ if (m_color == color)
+ return;
+
+ m_color = color;
+ update();
+}
+
+int QQuickMaterialBusyIndicator::elapsed() const
+{
+ return m_elapsed;
+}
+
+void QQuickMaterialBusyIndicator::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data)
+{
+ QQuickItem::itemChange(change, data);
+ if (change == ItemVisibleHasChanged)
+ update();
+}
+
+QSGNode *QQuickMaterialBusyIndicator::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *)
+{
+ QQuickMaterialBusyIndicatorNode *node = static_cast<QQuickMaterialBusyIndicatorNode *>(oldNode);
+ if (isVisible() && width() > 0 && height() > 0) {
+ if (!node) {
+ node = new QQuickMaterialBusyIndicatorNode(this);
+ node->start();
+ }
+ node->sync(this);
+ } else {
+ m_elapsed = node ? node->currentTime() : 0;
+ delete node;
+ node = nullptr;
+ }
+ return node;
+}
+
+QT_END_NAMESPACE
diff --git a/src/imports/controls/material/qquickmaterialprogressring_p.h b/src/imports/controls/material/qquickmaterialbusyindicator_p.h
index 004771d6..da84c7b1 100644
--- a/src/imports/controls/material/qquickmaterialprogressring_p.h
+++ b/src/imports/controls/material/qquickmaterialbusyindicator_p.h
@@ -34,8 +34,8 @@
**
****************************************************************************/
-#ifndef QQUICKMATERIALPROGRESSRING_P_H
-#define QQUICKMATERIALPROGRESSRING_P_H
+#ifndef QQUICKMATERIALBUSYINDICATOR_P_H
+#define QQUICKMATERIALBUSYINDICATOR_P_H
//
// W A R N I N G
@@ -50,44 +50,33 @@
#include <QtGui/qcolor.h>
#include <QtQuick/qquickitem.h>
-#include <QtQuick/private/qquickanimatorjob_p.h>
QT_BEGIN_NAMESPACE
-class QQuickMaterialProgressRing : public QQuickItem
+class QQuickMaterialBusyIndicator : public QQuickItem
{
Q_OBJECT
- Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged FINAL)
+ Q_PROPERTY(QColor color READ color WRITE setColor FINAL)
public:
- explicit QQuickMaterialProgressRing(QQuickItem *parent = nullptr);
- ~QQuickMaterialProgressRing();
+ explicit QQuickMaterialBusyIndicator(QQuickItem *parent = nullptr);
QColor color() const;
void setColor(QColor color);
-Q_SIGNALS:
- void colorChanged();
+ int elapsed() const;
protected:
+ void itemChange(ItemChange change, const ItemChangeData &data) override;
QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) override;
private:
+ int m_elapsed;
QColor m_color;
};
-class QQuickMaterialRingAnimator : public QQuickAnimator
-{
-public:
- QQuickMaterialRingAnimator(QObject *parent = nullptr);
-
-protected:
- QString propertyName() const override;
- QQuickAnimatorJob *createJob() const override;
-};
-
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QQuickMaterialProgressRing)
+QML_DECLARE_TYPE(QQuickMaterialBusyIndicator)
-#endif // QQUICKMATERIALPROGRESSRING_P_H
+#endif // QQUICKMATERIALBUSYINDICATOR_P_H
diff --git a/src/imports/controls/material/qquickmaterialprogressstrip.cpp b/src/imports/controls/material/qquickmaterialprogressbar.cpp
index 4bb558b3..c1d36d3b 100644
--- a/src/imports/controls/material/qquickmaterialprogressstrip.cpp
+++ b/src/imports/controls/material/qquickmaterialprogressbar.cpp
@@ -34,15 +34,16 @@
**
****************************************************************************/
-#include "qquickmaterialprogressstrip_p.h"
+#include "qquickmaterialprogressbar_p.h"
#include <QtCore/qmath.h>
#include <QtCore/qeasingcurve.h>
#include <QtQuick/private/qquickitem_p.h>
-#include <QtQuick/private/qquickanimatorjob_p.h>
#include <QtQuick/private/qsgadaptationlayer_p.h>
#include <QtQuick/qsgrectanglenode.h>
#include <QtQuick/qsgimagenode.h>
+#include <QtQuick/qquickwindow.h>
+#include <QtQuickControls2/private/qquickanimatednode_p.h>
QT_BEGIN_NAMESPACE
@@ -50,43 +51,34 @@ static const int PauseDuration = 520;
static const int SlideDuration = 1240;
static const int TotalDuration = SlideDuration + PauseDuration;
-class QQuickMaterialProgressStripAnimatorJob : public QQuickAnimatorJob
+class QQuickMaterialProgressBarNode : public QQuickAnimatedNode
{
public:
- QQuickMaterialProgressStripAnimatorJob();
+ QQuickMaterialProgressBarNode(QQuickMaterialProgressBar *item);
- void initialize(QQuickAnimatorController *controller) override;
void updateCurrentTime(int time) override;
- void writeBack() override;
- void nodeWasDestroyed() override;
- void afterNodeSync() override;
+ void sync(QQuickItem *item) override;
+private:
void moveNode(QSGTransformNode *node, const QRectF &geometry, qreal progress);
-private:
- QSGNode *m_node;
+ bool m_indeterminate;
+ QEasingCurve m_easing;
};
-QQuickMaterialProgressStripAnimatorJob::QQuickMaterialProgressStripAnimatorJob() : m_node(nullptr)
-{
-}
-
-void QQuickMaterialProgressStripAnimatorJob::initialize(QQuickAnimatorController *controller)
+QQuickMaterialProgressBarNode::QQuickMaterialProgressBarNode(QQuickMaterialProgressBar *item)
+ : QQuickAnimatedNode(item),
+ m_indeterminate(false),
+ m_easing(QEasingCurve::OutCubic)
{
- QQuickAnimatorJob::initialize(controller);
- m_node = QQuickItemPrivate::get(m_target)->childContainerNode();
+ setLoopCount(Infinite);
+ setDuration(TotalDuration);
}
-void QQuickMaterialProgressStripAnimatorJob::updateCurrentTime(int time)
+void QQuickMaterialProgressBarNode::updateCurrentTime(int time)
{
- if (!m_node)
- return;
-
- QSGRectangleNode *geometryNode = static_cast<QSGRectangleNode *>(m_node->firstChild());
- Q_ASSERT(!geometryNode || geometryNode->type() == QSGNode::GeometryNodeType);
- if (!geometryNode)
- return;
-
+ QSGRectangleNode *geometryNode = static_cast<QSGRectangleNode *>(firstChild());
+ Q_ASSERT(geometryNode->type() == QSGNode::GeometryNodeType);
const QRectF geometry = geometryNode->rect();
QSGTransformNode *firstNode = static_cast<QSGTransformNode *>(geometryNode->firstChild());
@@ -106,21 +98,66 @@ void QQuickMaterialProgressStripAnimatorJob::updateCurrentTime(int time)
}
}
-void QQuickMaterialProgressStripAnimatorJob::writeBack()
+void QQuickMaterialProgressBarNode::sync(QQuickItem *item)
{
-}
+ QQuickMaterialProgressBar *bar = static_cast<QQuickMaterialProgressBar *>(item);
+ if (m_indeterminate != bar->isIndeterminate()) {
+ m_indeterminate = bar->isIndeterminate();
+ if (m_indeterminate)
+ start();
+ else
+ stop();
+ }
-void QQuickMaterialProgressStripAnimatorJob::nodeWasDestroyed()
-{
- m_node = nullptr;
-}
+ QQuickItemPrivate *d = QQuickItemPrivate::get(item);
-void QQuickMaterialProgressStripAnimatorJob::afterNodeSync()
-{
- m_node = QQuickItemPrivate::get(m_target)->childContainerNode();
+ QRectF bounds = item->boundingRect();
+ bounds.setHeight(item->implicitHeight());
+ bounds.moveTop((item->height() - bounds.height()) / 2.0);
+
+ QSGRectangleNode *geometryNode = static_cast<QSGRectangleNode *>(firstChild());
+ if (!geometryNode) {
+ geometryNode = item->window()->createRectangleNode();
+ geometryNode->setColor(Qt::transparent);
+ appendChildNode(geometryNode);
+ }
+ geometryNode->setRect(bounds);
+
+ const int count = m_indeterminate ? 2 : 1;
+ const qreal w = m_indeterminate ? 0 : bar->progress() * item->width();
+ const QRectF rect(0, bounds.y(), w, bounds.height());
+
+ QSGNode *transformNode = geometryNode->firstChild();
+ for (int i = 0; i < count; ++i) {
+ if (!transformNode) {
+ transformNode = new QSGTransformNode;
+ geometryNode->appendChildNode(transformNode);
+
+ QSGInternalRectangleNode *rectNode = d->sceneGraphContext()->createInternalRectangleNode();
+ rectNode->setAntialiasing(true);
+ transformNode->appendChildNode(rectNode);
+ }
+ Q_ASSERT(transformNode->type() == QSGNode::TransformNodeType);
+ static_cast<QSGTransformNode *>(transformNode)->setMatrix(QMatrix4x4());
+
+ QSGInternalRectangleNode *rectNode = static_cast<QSGInternalRectangleNode *>(transformNode->firstChild());
+ Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType);
+
+ rectNode->setRect(rect);
+ rectNode->setColor(bar->color());
+ rectNode->update();
+
+ transformNode = transformNode->nextSibling();
+ }
+
+ while (transformNode) {
+ QSGNode *nextSibling = transformNode->nextSibling();
+ delete transformNode;
+ transformNode = nextSibling;
+ }
}
-void QQuickMaterialProgressStripAnimatorJob::moveNode(QSGTransformNode *transformNode, const QRectF &geometry, qreal progress)
+void QQuickMaterialProgressBarNode::moveNode(QSGTransformNode *transformNode, const QRectF &geometry, qreal progress)
{
const qreal value = m_easing.valueForProgress(progress);
const qreal x = value * geometry.width();
@@ -138,36 +175,18 @@ void QQuickMaterialProgressStripAnimatorJob::moveNode(QSGTransformNode *transfor
rectNode->update();
}
-QQuickMaterialStripAnimator::QQuickMaterialStripAnimator(QObject *parent)
- : QQuickAnimator(parent)
-{
- setLoops(Infinite);
- setDuration(TotalDuration);
- setEasing(QEasingCurve::OutCubic);
-}
-
-QString QQuickMaterialStripAnimator::propertyName() const
-{
- return QString();
-}
-
-QQuickAnimatorJob *QQuickMaterialStripAnimator::createJob() const
-{
- return new QQuickMaterialProgressStripAnimatorJob;
-}
-
-QQuickMaterialProgressStrip::QQuickMaterialProgressStrip(QQuickItem *parent)
+QQuickMaterialProgressBar::QQuickMaterialProgressBar(QQuickItem *parent)
: QQuickItem(parent), m_color(Qt::black), m_progress(0.0), m_indeterminate(false)
{
setFlag(ItemHasContents);
}
-QColor QQuickMaterialProgressStrip::color() const
+QColor QQuickMaterialProgressBar::color() const
{
return m_color;
}
-void QQuickMaterialProgressStrip::setColor(const QColor &color)
+void QQuickMaterialProgressBar::setColor(const QColor &color)
{
if (color == m_color)
return;
@@ -176,12 +195,12 @@ void QQuickMaterialProgressStrip::setColor(const QColor &color)
update();
}
-qreal QQuickMaterialProgressStrip::progress() const
+qreal QQuickMaterialProgressBar::progress() const
{
return m_progress;
}
-void QQuickMaterialProgressStrip::setProgress(qreal progress)
+void QQuickMaterialProgressBar::setProgress(qreal progress)
{
if (progress == m_progress)
return;
@@ -190,12 +209,12 @@ void QQuickMaterialProgressStrip::setProgress(qreal progress)
update();
}
-bool QQuickMaterialProgressStrip::isIndeterminate() const
+bool QQuickMaterialProgressBar::isIndeterminate() const
{
return m_indeterminate;
}
-void QQuickMaterialProgressStrip::setIndeterminate(bool indeterminate)
+void QQuickMaterialProgressBar::setIndeterminate(bool indeterminate)
{
if (indeterminate == m_indeterminate)
return;
@@ -204,54 +223,25 @@ void QQuickMaterialProgressStrip::setIndeterminate(bool indeterminate)
update();
}
-QSGNode *QQuickMaterialProgressStrip::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *)
+void QQuickMaterialProgressBar::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data)
{
- QQuickItemPrivate *d = QQuickItemPrivate::get(this);
-
- QRectF bounds = boundingRect();
- bounds.setHeight(implicitHeight());
- bounds.moveTop((height() - bounds.height()) / 2.0);
-
- if (!oldNode) {
- oldNode = window()->createRectangleNode();
- static_cast<QSGRectangleNode *>(oldNode)->setColor(Qt::transparent);
- }
- static_cast<QSGRectangleNode *>(oldNode)->setRect(bounds);
-
- const int count = m_indeterminate ? 2 : 1;
- const qreal w = m_indeterminate ? 0 : m_progress * width();
- const QRectF rect(0, bounds.y(), w, bounds.height());
-
- QSGNode *transformNode = oldNode->firstChild();
- for (int i = 0; i < count; ++i) {
- if (!transformNode) {
- transformNode = new QSGTransformNode;
- oldNode->appendChildNode(transformNode);
-
- QSGInternalRectangleNode *rectNode = d->sceneGraphContext()->createInternalRectangleNode();
- rectNode->setAntialiasing(true);
- transformNode->appendChildNode(rectNode);
- }
- Q_ASSERT(transformNode->type() == QSGNode::TransformNodeType);
- static_cast<QSGTransformNode *>(transformNode)->setMatrix(QMatrix4x4());
-
- QSGInternalRectangleNode *rectNode = static_cast<QSGInternalRectangleNode *>(transformNode->firstChild());
- Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType);
-
- rectNode->setRect(rect);
- rectNode->setColor(m_color);
- rectNode->update();
-
- transformNode = transformNode->nextSibling();
- }
+ QQuickItem::itemChange(change, data);
+ if (change == ItemVisibleHasChanged)
+ update();
+}
- while (transformNode) {
- QSGNode *nextSibling = transformNode->nextSibling();
- delete transformNode;
- transformNode = nextSibling;
+QSGNode *QQuickMaterialProgressBar::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *)
+{
+ QQuickMaterialProgressBarNode *node = static_cast<QQuickMaterialProgressBarNode *>(oldNode);
+ if (isVisible() && width() > 0 && height() > 0) {
+ if (!node)
+ node = new QQuickMaterialProgressBarNode(this);
+ node->sync(this);
+ } else {
+ delete node;
+ node = nullptr;
}
-
- return oldNode;
+ return node;
}
QT_END_NAMESPACE
diff --git a/src/imports/controls/material/qquickmaterialprogressstrip_p.h b/src/imports/controls/material/qquickmaterialprogressbar_p.h
index affe0670..f481281d 100644
--- a/src/imports/controls/material/qquickmaterialprogressstrip_p.h
+++ b/src/imports/controls/material/qquickmaterialprogressbar_p.h
@@ -34,8 +34,8 @@
**
****************************************************************************/
-#ifndef QQUICKMATERIALPROGRESSSTRIP_P_H
-#define QQUICKMATERIALPROGRESSSTRIP_P_H
+#ifndef QQUICKMATERIALPROGRESSBAR_P_H
+#define QQUICKMATERIALPROGRESSBAR_P_H
//
// W A R N I N G
@@ -49,11 +49,10 @@
//
#include <QtQuick/qquickitem.h>
-#include <QtQuick/private/qquickanimator_p.h>
QT_BEGIN_NAMESPACE
-class QQuickMaterialProgressStrip : public QQuickItem
+class QQuickMaterialProgressBar : public QQuickItem
{
Q_OBJECT
Q_PROPERTY(QColor color READ color WRITE setColor FINAL)
@@ -61,7 +60,7 @@ class QQuickMaterialProgressStrip : public QQuickItem
Q_PROPERTY(bool indeterminate READ isIndeterminate WRITE setIndeterminate FINAL)
public:
- QQuickMaterialProgressStrip(QQuickItem *parent = nullptr);
+ explicit QQuickMaterialProgressBar(QQuickItem *parent = nullptr);
QColor color() const;
void setColor(const QColor &color);
@@ -73,6 +72,7 @@ public:
void setIndeterminate(bool indeterminate);
protected:
+ void itemChange(ItemChange change, const ItemChangeData &data) override;
QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) override;
private:
@@ -81,21 +81,8 @@ private:
bool m_indeterminate;
};
-class QQuickMaterialStripAnimator : public QQuickAnimator
-{
- Q_OBJECT
-
-public:
- QQuickMaterialStripAnimator(QObject *parent = nullptr);
-
-protected:
- QString propertyName() const override;
- QQuickAnimatorJob *createJob() const override;
-};
-
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QQuickMaterialProgressStrip)
-QML_DECLARE_TYPE(QQuickMaterialStripAnimator)
+QML_DECLARE_TYPE(QQuickMaterialProgressBar)
-#endif // QQUICKMATERIALPROGRESSSTRIP_P_H
+#endif // QQUICKMATERIALPROGRESSBAR_P_H
diff --git a/src/imports/controls/material/qquickmaterialprogressring.cpp b/src/imports/controls/material/qquickmaterialprogressring.cpp
deleted file mode 100644
index 53ca68d2..00000000
--- a/src/imports/controls/material/qquickmaterialprogressring.cpp
+++ /dev/null
@@ -1,260 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickmaterialprogressring_p.h"
-
-#include <cmath>
-
-#include <QtCore/qset.h>
-#include <QtGui/qpainter.h>
-#include <QtQuick/private/qquickitem_p.h>
-#include <QtQuick/qsgrectanglenode.h>
-#include <QtQuick/qsgimagenode.h>
-#include <QtQuick/qquickwindow.h>
-
-QT_BEGIN_NAMESPACE
-
-/*
- Relevant Android code:
-
- - core/res/res/anim/progress_indeterminate_rotation_material.xml contains
- the rotation animation data.
- - core/res/res/anim/progress_indeterminate_material.xml contains the trim
- animation data.
- - core/res/res/interpolator/trim_start_interpolator.xml and
- core/res/res/interpolator/trim_end_interpolator.xml contain the start
- and end trim path interpolators.
- - addCommand() in core/java/android/util/PathParser.java has a list of the
- different path commands available.
-*/
-
-class QQuickMaterialRingAnimatorJob : public QQuickAnimatorJob
-{
-public:
- QQuickMaterialRingAnimatorJob();
- ~QQuickMaterialRingAnimatorJob();
-
- void initialize(QQuickAnimatorController *controller) override;
- void updateCurrentTime(int time) override;
- void writeBack() override;
- void nodeWasDestroyed() override;
- void afterNodeSync() override;
-
-private:
- int m_lastStartAngle;
- int m_lastEndAngle;
- qreal m_devicePixelRatio;
- QSGNode *m_containerNode;
- QQuickWindow *m_window;
- QColor m_color;
-};
-
-QQuickMaterialProgressRing::QQuickMaterialProgressRing(QQuickItem *parent) :
- QQuickItem(parent)
-{
- setFlag(QQuickItem::ItemHasContents);
-}
-
-QQuickMaterialProgressRing::~QQuickMaterialProgressRing()
-{
-}
-
-QSGNode *QQuickMaterialProgressRing::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *)
-{
- if (!oldNode) {
- oldNode = window()->createRectangleNode();
- static_cast<QSGRectangleNode *>(oldNode)->setColor(Qt::transparent);
- }
- static_cast<QSGRectangleNode *>(oldNode)->setRect(boundingRect());
-
- QSGImageNode *textureNode = static_cast<QSGImageNode *>(oldNode->firstChild());
- if (!textureNode) {
- textureNode = window()->createImageNode();
- textureNode->setOwnsTexture(true);
- oldNode->appendChildNode(textureNode);
- }
-
- // A texture seems to be required here, but we don't have one yet, as we haven't drawn anything,
- // so just use a blank image.
- QImage blankImage(width(), height(), QImage::Format_ARGB32_Premultiplied);
- blankImage.fill(Qt::transparent);
- textureNode->setRect(boundingRect());
- textureNode->setTexture(window()->createTextureFromImage(blankImage));
-
- return oldNode;
-}
-
-QColor QQuickMaterialProgressRing::color() const
-{
- return m_color;
-}
-
-void QQuickMaterialProgressRing::setColor(QColor color)
-{
- if (m_color == color)
- return;
-
- m_color = color;
- update();
- emit colorChanged();
-}
-
-static const int spanAnimationDuration = 700;
-static const int rotationAnimationDuration = spanAnimationDuration * 6;
-static const int targetRotation = 720;
-static const int oneDegree = 16;
-static const qreal minSweepSpan = 10 * oneDegree;
-static const qreal maxSweepSpan = 300 * oneDegree;
-
-QQuickMaterialRingAnimator::QQuickMaterialRingAnimator(QObject *parent) :
- QQuickAnimator(parent)
-{
- setDuration(rotationAnimationDuration);
- setLoops(QQuickAnimator::Infinite);
-}
-
-QString QQuickMaterialRingAnimator::propertyName() const
-{
- return QString();
-}
-
-QQuickAnimatorJob *QQuickMaterialRingAnimator::createJob() const
-{
- return new QQuickMaterialRingAnimatorJob;
-}
-
-QQuickMaterialRingAnimatorJob::QQuickMaterialRingAnimatorJob() :
- m_lastStartAngle(0),
- m_lastEndAngle(0),
- m_devicePixelRatio(1.0),
- m_containerNode(nullptr),
- m_window(nullptr)
-{
-}
-
-QQuickMaterialRingAnimatorJob::~QQuickMaterialRingAnimatorJob()
-{
-}
-
-void QQuickMaterialRingAnimatorJob::initialize(QQuickAnimatorController *controller)
-{
- QQuickAnimatorJob::initialize(controller);
- m_containerNode = QQuickItemPrivate::get(m_target)->childContainerNode();
- m_window = m_target->window();
- m_devicePixelRatio = m_window->effectiveDevicePixelRatio();
-}
-
-void QQuickMaterialRingAnimatorJob::updateCurrentTime(int time)
-{
- if (!m_containerNode)
- return;
-
- QSGRectangleNode *rectNode = static_cast<QSGRectangleNode *>(m_containerNode->firstChild());
- if (!rectNode)
- return;
-
- Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType);
-
- const qreal width = rectNode->rect().width() * m_devicePixelRatio;
- const qreal height = rectNode->rect().height() * m_devicePixelRatio;
- QImage image(width, height, QImage::Format_ARGB32_Premultiplied);
- image.fill(Qt::transparent);
-
- QPainter painter(&image);
- painter.setRenderHint(QPainter::Antialiasing);
-
- QPen pen;
- QSGImageNode *textureNode = static_cast<QSGImageNode *>(rectNode->firstChild());
- pen.setColor(m_color);
- pen.setWidth(4 * m_devicePixelRatio);
- painter.setPen(pen);
-
- const qreal percentageComplete = time / qreal(rotationAnimationDuration);
- const qreal spanPercentageComplete = (time % spanAnimationDuration) / qreal(spanAnimationDuration);
- const int iteration = time / spanAnimationDuration;
- int startAngle = 0;
- int endAngle = 0;
-
- if (iteration % 2 == 0) {
- if (m_lastStartAngle > 360 * oneDegree) {
- m_lastStartAngle -= 360 * oneDegree;
- }
-
- // The start angle is only affected by the rotation animation for the "grow" phase.
- startAngle = m_lastStartAngle;
- QEasingCurve angleCurve(QEasingCurve::OutQuad);
- const qreal percentage = angleCurve.valueForProgress(spanPercentageComplete);
- endAngle = m_lastStartAngle + minSweepSpan + percentage * (maxSweepSpan - minSweepSpan);
- m_lastEndAngle = endAngle;
- } else {
- // Both the start angle *and* the span are affected by the "shrink" phase.
- QEasingCurve angleCurve(QEasingCurve::InQuad);
- const qreal percentage = angleCurve.valueForProgress(spanPercentageComplete);
- startAngle = m_lastEndAngle - maxSweepSpan + percentage * (maxSweepSpan - minSweepSpan);
- endAngle = m_lastEndAngle;
- m_lastStartAngle = startAngle;
- }
-
- const int halfPen = pen.width() / 2;
- const QRectF arcBounds = QRectF(halfPen, halfPen, width - pen.width(), height - pen.width());
- // The current angle of the rotation animation.
- const qreal rotation = oneDegree * percentageComplete * -targetRotation;
- startAngle -= rotation;
- endAngle -= rotation;
- const int angleSpan = endAngle - startAngle;
- painter.drawArc(arcBounds, -startAngle, -angleSpan);
- painter.end();
-
- textureNode->setTexture(m_window->createTextureFromImage(image));
-}
-
-void QQuickMaterialRingAnimatorJob::writeBack()
-{
-}
-
-void QQuickMaterialRingAnimatorJob::nodeWasDestroyed()
-{
- m_containerNode = nullptr;
- m_window = nullptr;
-}
-
-void QQuickMaterialRingAnimatorJob::afterNodeSync()
-{
- m_containerNode = QQuickItemPrivate::get(m_target)->childContainerNode();
- m_color = static_cast<QQuickMaterialProgressRing *>(m_target.data())->color();
-}
-
-QT_END_NAMESPACE
diff --git a/src/imports/controls/material/qquickmaterialripple.cpp b/src/imports/controls/material/qquickmaterialripple.cpp
index bd916f83..ac2fbc06 100644
--- a/src/imports/controls/material/qquickmaterialripple.cpp
+++ b/src/imports/controls/material/qquickmaterialripple.cpp
@@ -38,10 +38,8 @@
#include <QtCore/qmath.h>
#include <QtQuick/private/qquickitem_p.h>
-#include <QtQuick/private/qquickanimator_p.h>
-#include <QtQuick/private/qquickrectangle_p.h>
-#include <QtQuick/private/qquickanimatorjob_p.h>
#include <QtQuick/private/qsgadaptationlayer_p.h>
+#include <QtQuickControls2/private/qquickanimatednode_p.h>
#include <QtQuickTemplates2/private/qquickabstractbutton_p.h>
#include <QtQuickTemplates2/private/qquickabstractbutton_p_p.h>
@@ -54,157 +52,184 @@ namespace {
static const int RIPPLE_ENTER_DELAY = 80;
static const int OPACITY_ENTER_DURATION_FAST = 120;
static const int WAVE_OPACITY_DECAY_DURATION = 333;
-static const qreal WAVE_TOUCH_UP_ACCELERATION = 3400.0;
static const qreal WAVE_TOUCH_DOWN_ACCELERATION = 1024.0;
-class QQuickMaterialRippleAnimatorJob : public QQuickAnimatorJob
+class QQuickMaterialRippleWaveNode : public QQuickAnimatedNode
{
public:
- QQuickMaterialRippleAnimatorJob(WavePhase phase, const QPointF &anchor, const QRectF &bounds);
+ QQuickMaterialRippleWaveNode(QQuickMaterialRipple *ripple);
- void initialize(QQuickAnimatorController *controller) override;
+ void exit();
void updateCurrentTime(int time) override;
- void writeBack() override;
- void nodeWasDestroyed() override;
- void afterNodeSync() override;
+ void sync(QQuickItem *item) override;
private:
- qreal m_diameter;
+ qreal m_from;
+ qreal m_to;
+ qreal m_value;
WavePhase m_phase;
- QRectF m_bounds;
QPointF m_anchor;
- QSGTransformNode *m_itemNode;
- QSGOpacityNode *m_opacityNode;
- QSGInternalRectangleNode *m_rectNode;
+ QRectF m_bounds;
};
-QQuickMaterialRippleAnimatorJob::QQuickMaterialRippleAnimatorJob(WavePhase phase, const QPointF &anchor, const QRectF &bounds)
- : m_diameter(qSqrt(bounds.width() * bounds.width() + bounds.height() * bounds.height())),
- m_phase(phase),
- m_bounds(bounds),
- m_anchor(anchor),
- m_itemNode(nullptr),
- m_opacityNode(nullptr),
- m_rectNode(nullptr)
+QQuickMaterialRippleWaveNode::QQuickMaterialRippleWaveNode(QQuickMaterialRipple *ripple)
+ : QQuickAnimatedNode(ripple),
+ m_from(0),
+ m_to(0),
+ m_value(0),
+ m_phase(WaveEnter)
{
+ start(qRound(1000.0 * qSqrt(ripple->diameter() / 2.0 / WAVE_TOUCH_DOWN_ACCELERATION)));
+
+ QSGOpacityNode *opacityNode = new QSGOpacityNode;
+ appendChildNode(opacityNode);
+
+ QQuickItemPrivate *d = QQuickItemPrivate::get(ripple);
+ QSGInternalRectangleNode *rectNode = d->sceneGraphContext()->createInternalRectangleNode();
+ rectNode->setAntialiasing(true);
+ opacityNode->appendChildNode(rectNode);
}
-void QQuickMaterialRippleAnimatorJob::initialize(QQuickAnimatorController *controller)
+void QQuickMaterialRippleWaveNode::exit()
{
- QQuickAnimatorJob::initialize(controller);
- afterNodeSync();
+ m_phase = WaveExit;
+ m_from = m_value;
+ setDuration(WAVE_OPACITY_DECAY_DURATION);
+ restart();
+ connect(this, &QQuickAnimatedNode::stopped, this, &QObject::deleteLater);
}
-void QQuickMaterialRippleAnimatorJob::updateCurrentTime(int time)
+void QQuickMaterialRippleWaveNode::updateCurrentTime(int time)
{
- if (!m_itemNode || !m_rectNode)
- return;
-
- qreal duration = 0;
- if (m_phase == WaveEnter)
- duration = QQuickAnimatorJob::duration();
- else
- duration = 1000.0 * qSqrt((m_diameter - m_from) / 2.0 / (WAVE_TOUCH_UP_ACCELERATION + WAVE_TOUCH_DOWN_ACCELERATION));
-
qreal p = 1.0;
- if (!qFuzzyIsNull(duration) && time < duration)
- p = time / duration;
+ if (duration() > 0)
+ p = time / static_cast<qreal>(duration());
m_value = m_from + (m_to - m_from) * p;
- p = m_value / m_diameter;
+ p = m_value / m_to;
const qreal dx = (1.0 - p) * (m_anchor.x() - m_bounds.width() / 2);
const qreal dy = (1.0 - p) * (m_anchor.y() - m_bounds.height() / 2);
- m_rectNode->setRect(QRectF(0, 0, m_value, m_value));
- m_rectNode->setRadius(m_value / 2);
- m_rectNode->update();
-
QMatrix4x4 m;
m.translate((m_bounds.width() - m_value) / 2 + dx,
(m_bounds.height() - m_value) / 2 + dy);
- m_itemNode->setMatrix(m);
+ setMatrix(m);
- if (m_opacityNode) {
- qreal opacity = 1.0;
- if (m_phase == WaveExit)
- opacity -= static_cast<qreal>(time) / WAVE_OPACITY_DECAY_DURATION;
- m_opacityNode->setOpacity(opacity);
- }
-}
-
-void QQuickMaterialRippleAnimatorJob::writeBack()
-{
- if (m_target)
- m_target->setSize(QSizeF(m_value, m_value));
+ QSGOpacityNode *opacityNode = static_cast<QSGOpacityNode *>(firstChild());
+ Q_ASSERT(opacityNode->type() == QSGNode::OpacityNodeType);
+ qreal opacity = 1.0;
if (m_phase == WaveExit)
- m_target->deleteLater();
-}
+ opacity -= static_cast<qreal>(time) / WAVE_OPACITY_DECAY_DURATION;
+ opacityNode->setOpacity(opacity);
-void QQuickMaterialRippleAnimatorJob::nodeWasDestroyed()
-{
- m_itemNode = nullptr;
- m_opacityNode = nullptr;
- m_rectNode = nullptr;
+ QSGInternalRectangleNode *rectNode = static_cast<QSGInternalRectangleNode *>(opacityNode->firstChild());
+ Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType);
+ rectNode->setRect(QRectF(0, 0, m_value, m_value));
+ rectNode->setRadius(m_value / 2);
+ rectNode->update();
}
-void QQuickMaterialRippleAnimatorJob::afterNodeSync()
+void QQuickMaterialRippleWaveNode::sync(QQuickItem *item)
{
- m_itemNode = QQuickItemPrivate::get(m_target)->itemNode();
- m_opacityNode = QQuickItemPrivate::get(m_target)->opacityNode();
- m_rectNode = static_cast<QSGInternalRectangleNode *>(QQuickItemPrivate::get(m_target)->childContainerNode()->firstChild());
+ QQuickMaterialRipple *ripple = static_cast<QQuickMaterialRipple *>(item);
+ m_to = ripple->diameter();
+ m_anchor = ripple->anchorPoint();
+ m_bounds = ripple->boundingRect();
+
+ QSGOpacityNode *opacityNode = static_cast<QSGOpacityNode *>(firstChild());
+ Q_ASSERT(opacityNode->type() == QSGNode::OpacityNodeType);
+
+ QSGInternalRectangleNode *rectNode = static_cast<QSGInternalRectangleNode *>(opacityNode->firstChild());
+ Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType);
+ rectNode->setColor(ripple->color());
}
-class QQuickMaterialRippleAnimator : public QQuickAnimator
+class QQuickMaterialRippleBackgroundNode : public QQuickAnimatedNode
{
-public:
- QQuickMaterialRippleAnimator(const QPointF &anchor, const QRectF &bounds, QObject *parent = nullptr);
+ Q_OBJECT
- WavePhase phase() const;
- void setPhase(WavePhase phase);
+public:
+ QQuickMaterialRippleBackgroundNode(QQuickMaterialRipple *ripple);
-protected:
- QString propertyName() const override;
- QQuickAnimatorJob *createJob() const override;
+ void updateCurrentTime(int time) override;
+ void sync(QQuickItem *item) override;
private:
- QPointF m_anchor;
- QRectF m_bounds;
- WavePhase m_phase;
+ bool m_active;
};
-QQuickMaterialRippleAnimator::QQuickMaterialRippleAnimator(const QPointF &anchor, const QRectF &bounds, QObject *parent)
- : QQuickAnimator(parent), m_anchor(anchor), m_bounds(bounds), m_phase(WaveEnter)
+QQuickMaterialRippleBackgroundNode::QQuickMaterialRippleBackgroundNode(QQuickMaterialRipple *ripple)
+ : QQuickAnimatedNode(ripple),
+ m_active(false)
{
-}
+ setDuration(OPACITY_ENTER_DURATION_FAST);
-WavePhase QQuickMaterialRippleAnimator::phase() const
-{
- return m_phase;
+ QSGOpacityNode *opacityNode = new QSGOpacityNode;
+ opacityNode->setOpacity(0.0);
+ appendChildNode(opacityNode);
+
+ QQuickItemPrivate *d = QQuickItemPrivate::get(ripple);
+ QSGInternalRectangleNode *rectNode = d->sceneGraphContext()->createInternalRectangleNode();
+ rectNode->setAntialiasing(true);
+ opacityNode->appendChildNode(rectNode);
}
-void QQuickMaterialRippleAnimator::setPhase(WavePhase phase)
+void QQuickMaterialRippleBackgroundNode::updateCurrentTime(int time)
{
- if (m_phase == phase)
- return;
+ qreal opacity = time / static_cast<qreal>(duration());
+ if (!m_active)
+ opacity = 1.0 - opacity;
- m_phase = phase;
+ QSGOpacityNode *opacityNode = static_cast<QSGOpacityNode *>(firstChild());
+ Q_ASSERT(opacityNode->type() == QSGNode::OpacityNodeType);
+ opacityNode->setOpacity(opacity);
}
-QString QQuickMaterialRippleAnimator::propertyName() const
+void QQuickMaterialRippleBackgroundNode::sync(QQuickItem *item)
{
- return QString();
-}
+ QQuickMaterialRipple *ripple = static_cast<QQuickMaterialRipple *>(item);
+ if (m_active != ripple->isActive()) {
+ m_active = ripple->isActive();
+ setDuration(m_active ? OPACITY_ENTER_DURATION_FAST : WAVE_OPACITY_DECAY_DURATION);
+ restart();
+ }
-QQuickAnimatorJob *QQuickMaterialRippleAnimator::createJob() const
-{
- return new QQuickMaterialRippleAnimatorJob(m_phase, m_anchor, m_bounds);
+ QSGOpacityNode *opacityNode = static_cast<QSGOpacityNode *>(firstChild());
+ Q_ASSERT(opacityNode->type() == QSGNode::OpacityNodeType);
+
+ QSGInternalRectangleNode *rectNode = static_cast<QSGInternalRectangleNode *>(opacityNode->firstChild());
+ Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType);
+
+ const qreal w = ripple->width();
+ const qreal h = ripple->height();
+ const qreal sz = qSqrt(w * w + h * h);
+
+ QMatrix4x4 matrix;
+ if (qFuzzyIsNull(ripple->clipRadius())) {
+ matrix.translate((w - sz) / 2, (h - sz) / 2);
+ rectNode->setRect(QRectF(0, 0, sz, sz));
+ rectNode->setRadius(sz / 2);
+ } else {
+ rectNode->setRect(QRectF(0, 0, w, h));
+ rectNode->setRadius(ripple->clipRadius());
+ }
+
+ setMatrix(matrix);
+ rectNode->setColor(ripple->color());
+ rectNode->update();
}
QQuickMaterialRipple::QQuickMaterialRipple(QQuickItem *parent)
- : QQuickItem(parent), m_active(false), m_pressed(false), m_enterDelay(0), m_trigger(Press), m_clipRadius(0.0), m_anchor(nullptr), m_opacityAnimator(nullptr)
+ : QQuickItem(parent),
+ m_active(false),
+ m_pressed(false),
+ m_waves(0),
+ m_enterDelay(0),
+ m_trigger(Press),
+ m_clipRadius(0.0),
+ m_anchor(nullptr)
{
- setOpacity(0.0);
setFlag(ItemHasContents);
}
@@ -219,19 +244,7 @@ void QQuickMaterialRipple::setActive(bool active)
return;
m_active = active;
-
- if (!m_opacityAnimator) {
- m_opacityAnimator = new QQuickOpacityAnimator(this);
- m_opacityAnimator->setTargetItem(this);
- }
- m_opacityAnimator->setDuration(active ? OPACITY_ENTER_DURATION_FAST : WAVE_OPACITY_DECAY_DURATION);
-
- const int time = m_opacityAnimator->currentTime();
- m_opacityAnimator->stop();
- m_opacityAnimator->setFrom(opacity());
- m_opacityAnimator->setTo(active ? 1.0 : 0.0);
- m_opacityAnimator->setCurrentTime(time);
- m_opacityAnimator->start();
+ update();
}
QColor QQuickMaterialRipple::color() const
@@ -275,8 +288,10 @@ void QQuickMaterialRipple::setPressed(bool pressed)
m_pressed = pressed;
- if (!isEnabled())
+ if (!isEnabled()) {
+ exitWave();
return;
+ }
if (pressed) {
if (m_trigger == Press)
@@ -336,15 +351,16 @@ void QQuickMaterialRipple::setAnchor(QQuickItem *item)
m_anchor = item;
}
+qreal QQuickMaterialRipple::diameter() const
+{
+ const qreal w = width();
+ const qreal h = height();
+ return qSqrt(w * w + h * h);
+}
+
void QQuickMaterialRipple::itemChange(ItemChange change, const ItemChangeData &data)
{
QQuickItem::itemChange(change, data);
-
- if (change == ItemChildRemovedChange) {
- QQuickMaterialRippleAnimator *animator = data.item->findChild<QQuickMaterialRippleAnimator *>();
- if (animator)
- m_rippleAnimators.removeOne(animator);
- }
}
QSGNode *QQuickMaterialRipple::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *)
@@ -358,35 +374,41 @@ QSGNode *QQuickMaterialRipple::updatePaintNode(QSGNode *oldNode, UpdatePaintNode
clipNode->update();
}
- const qreal w = width();
- const qreal h = height();
- const qreal sz = qSqrt(w * w + h * h);
+ QSGNode *container = oldNode;
+ if (!container)
+ container = new QSGNode;
- QSGTransformNode *transformNode = static_cast<QSGTransformNode *>(oldNode);
- if (!transformNode)
- transformNode = new QSGTransformNode;
-
- QSGInternalRectangleNode *rectNode = static_cast<QSGInternalRectangleNode *>(transformNode->firstChild());
- if (!rectNode) {
- rectNode = d->sceneGraphContext()->createInternalRectangleNode();
- rectNode->setAntialiasing(true);
- transformNode->appendChildNode(rectNode);
+ QQuickMaterialRippleBackgroundNode *backgroundNode = static_cast<QQuickMaterialRippleBackgroundNode *>(container->firstChild());
+ if (!backgroundNode) {
+ backgroundNode = new QQuickMaterialRippleBackgroundNode(this);
+ backgroundNode->setObjectName(objectName());
+ container->appendChildNode(backgroundNode);
+ }
+ backgroundNode->sync(this);
+
+ // enter new waves
+ int i = m_waves;
+ QQuickMaterialRippleWaveNode *enterNode = static_cast<QQuickMaterialRippleWaveNode *>(backgroundNode->nextSibling());
+ while (i-- > 0) {
+ if (!enterNode) {
+ enterNode = new QQuickMaterialRippleWaveNode(this);
+ container->appendChildNode(enterNode);
+ }
+ enterNode->sync(this);
+ enterNode = static_cast<QQuickMaterialRippleWaveNode *>(enterNode->nextSibling());
}
- QMatrix4x4 matrix;
- if (qFuzzyIsNull(m_clipRadius)) {
- matrix.translate((w - sz) / 2, (h - sz) / 2);
- rectNode->setRect(QRectF(0, 0, sz, sz));
- rectNode->setRadius(sz / 2);
- } else {
- rectNode->setRect(QRectF(0, 0, w, h));
- rectNode->setRadius(m_clipRadius);
+ // exit old waves
+ int j = container->childCount() - 1 - m_waves;
+ while (j-- > 0) {
+ QQuickMaterialRippleWaveNode *exitNode = static_cast<QQuickMaterialRippleWaveNode *>(backgroundNode->nextSibling());
+ if (exitNode) {
+ exitNode->exit();
+ exitNode->sync(this);
+ }
}
- transformNode->setMatrix(matrix);
- rectNode->setColor(m_color);
- rectNode->update();
- return transformNode;
+ return container;
}
void QQuickMaterialRipple::timerEvent(QTimerEvent *event)
@@ -410,23 +432,8 @@ void QQuickMaterialRipple::enterWave()
m_enterDelay = 0;
}
- const qreal w = width();
- const qreal h = height();
- const qreal sz = qSqrt(w * w + h * h);
-
- QQuickRectangle *wave = new QQuickRectangle(this);
- wave->setPosition(QPointF((w - sz) / 2, (h - sz) / 2));
- wave->setSize(QSizeF(sz, sz));
- wave->setRadius(sz / 2);
- wave->setColor(color());
- wave->setOpacity(0.0);
-
- QQuickMaterialRippleAnimator *animator = new QQuickMaterialRippleAnimator(anchorPoint(), boundingRect(), wave);
- animator->setDuration(qRound(1000.0 * qSqrt(sz / 2.0 / WAVE_TOUCH_DOWN_ACCELERATION)));
- animator->setTargetItem(wave);
- animator->setTo(sz);
- animator->start();
- m_rippleAnimators += animator;
+ ++m_waves;
+ update();
}
void QQuickMaterialRipple::exitWave()
@@ -436,16 +443,12 @@ void QQuickMaterialRipple::exitWave()
m_enterDelay = 0;
}
- for (QQuickMaterialRippleAnimator *animator : m_rippleAnimators) {
- if (animator->phase() == WaveEnter) {
- animator->stop(); // -> writeBack() -> setSize()
- if (QQuickItem *wave = animator->targetItem())
- animator->setFrom(wave->width());
- animator->setDuration(WAVE_OPACITY_DECAY_DURATION);
- animator->setPhase(WaveExit);
- animator->restart();
- }
+ if (m_waves > 0) {
+ --m_waves;
+ update();
}
}
QT_END_NAMESPACE
+
+#include "qquickmaterialripple.moc"
diff --git a/src/imports/controls/material/qquickmaterialripple_p.h b/src/imports/controls/material/qquickmaterialripple_p.h
index 8e511bbb..712697da 100644
--- a/src/imports/controls/material/qquickmaterialripple_p.h
+++ b/src/imports/controls/material/qquickmaterialripple_p.h
@@ -53,9 +53,6 @@
QT_BEGIN_NAMESPACE
-class QQuickOpacityAnimator;
-class QQuickMaterialRippleAnimator;
-
class QQuickMaterialRipple : public QQuickItem
{
Q_OBJECT
@@ -92,6 +89,8 @@ public:
QQuickItem *anchor() const;
void setAnchor(QQuickItem *anchor);
+ qreal diameter() const;
+
protected:
void itemChange(ItemChange change, const ItemChangeData &data) override;
QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) override;
@@ -104,13 +103,12 @@ protected:
private:
bool m_active;
bool m_pressed;
+ int m_waves;
int m_enterDelay;
Trigger m_trigger;
qreal m_clipRadius;
QColor m_color;
QQuickItem *m_anchor;
- QQuickOpacityAnimator *m_opacityAnimator;
- QVector<QQuickMaterialRippleAnimator *> m_rippleAnimators;
};
QT_END_NAMESPACE
diff --git a/src/imports/controls/material/qquickmaterialstyle.cpp b/src/imports/controls/material/qquickmaterialstyle.cpp
index e4d7e4cd..788c0cf2 100644
--- a/src/imports/controls/material/qquickmaterialstyle.cpp
+++ b/src/imports/controls/material/qquickmaterialstyle.cpp
@@ -1255,7 +1255,7 @@ bool QQuickMaterialStyle::variantToRgba(const QVariant &var, const char *name, Q
if (var.type() == QVariant::Int) {
int val = var.toInt();
if (val > BlueGrey) {
- qmlInfo(parent()) << "unknown Material." << name << " value: " << val;
+ qmlWarning(parent()) << "unknown Material." << name << " value: " << val;
return false;
}
*rgba = val;
@@ -1266,7 +1266,7 @@ bool QQuickMaterialStyle::variantToRgba(const QVariant &var, const char *name, Q
} else {
QColor color(var.toString());
if (!color.isValid()) {
- qmlInfo(parent()) << "unknown Material." << name << " value: " << var.toString();
+ qmlWarning(parent()) << "unknown Material." << name << " value: " << var.toString();
return false;
}
*custom = true;
diff --git a/src/imports/controls/material/qquickmaterialstyle_p.h b/src/imports/controls/material/qquickmaterialstyle_p.h
index 839a4863..bb494697 100644
--- a/src/imports/controls/material/qquickmaterialstyle_p.h
+++ b/src/imports/controls/material/qquickmaterialstyle_p.h
@@ -63,7 +63,6 @@ class QQuickMaterialStyle : public QQuickStyleAttached
Q_PROPERTY(QVariant background READ background WRITE setBackground RESET resetBackground NOTIFY backgroundChanged FINAL)
Q_PROPERTY(int elevation READ elevation WRITE setElevation RESET resetElevation NOTIFY elevationChanged FINAL)
-
Q_PROPERTY(QColor primaryColor READ primaryColor NOTIFY primaryChanged FINAL) // TODO: remove?
Q_PROPERTY(QColor accentColor READ accentColor NOTIFY accentChanged FINAL) // TODO: remove?
Q_PROPERTY(QColor backgroundColor READ backgroundColor NOTIFY backgroundChanged FINAL)
diff --git a/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp b/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp
index 94941b4c..0deb429c 100644
--- a/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp
+++ b/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp
@@ -38,8 +38,8 @@
#include "qquickmaterialstyle_p.h"
#include "qquickmaterialtheme_p.h"
-#include "qquickmaterialprogressring_p.h"
-#include "qquickmaterialprogressstrip_p.h"
+#include "qquickmaterialbusyindicator_p.h"
+#include "qquickmaterialprogressbar_p.h"
#include "qquickmaterialripple_p.h"
#include <QtQuickControls2/private/qquickstyleselector_p.h>
@@ -78,8 +78,8 @@ QtQuickControls2MaterialStylePlugin::QtQuickControls2MaterialStylePlugin(QObject
void QtQuickControls2MaterialStylePlugin::registerTypes(const char *uri)
{
+ qmlRegisterModule(uri, 2, QT_VERSION_MINOR - 7); // Qt 5.7->2.0, 5.8->2.1, 5.9->2.2...
qmlRegisterUncreatableType<QQuickMaterialStyle>(uri, 2, 0, "Material", tr("Material is an attached property"));
- qmlRegisterRevision<QQuickMaterialStyle, 1>(uri, 2, 1);
}
void QtQuickControls2MaterialStylePlugin::initializeEngine(QQmlEngine *engine, const char *uri)
@@ -89,15 +89,15 @@ void QtQuickControls2MaterialStylePlugin::initializeEngine(QQmlEngine *engine, c
engine->addImageProvider(name(), new QQuickColorImageProvider(QStringLiteral(":/qt-project.org/imports/QtQuick/Controls.2/Material/images")));
QByteArray import = QByteArray(uri) + ".impl";
+ qmlRegisterModule(import, 2, QT_VERSION_MINOR - 7); // Qt 5.7->2.0, 5.8->2.1, 5.9->2.2...
+
qmlRegisterType<QQuickPaddedRectangle>(import, 2, 0, "PaddedRectangle");
- qmlRegisterRevision<QQuickPaddedRectangle, 1>(import, 2, 1);
- qmlRegisterType<QQuickMaterialProgressRing>(import, 2, 0, "ProgressRing");
- qmlRegisterType<QQuickMaterialProgressStrip>(import, 2, 0, "ProgressStrip");
- qmlRegisterType<QQuickMaterialRingAnimator>(import, 2, 0, "RingAnimator");
+ qmlRegisterType<QQuickMaterialBusyIndicator>(import, 2, 0, "BusyIndicatorImpl");
+ qmlRegisterType<QQuickMaterialProgressBar>(import, 2, 0, "ProgressBarImpl");
qmlRegisterType<QQuickMaterialRipple>(import, 2, 0, "Ripple");
- qmlRegisterType<QQuickMaterialStripAnimator>(import, 2, 0, "StripAnimator");
qmlRegisterType(typeUrl(QStringLiteral("BoxShadow.qml")), import, 2, 0, "BoxShadow");
qmlRegisterType(typeUrl(QStringLiteral("CheckIndicator.qml")), import, 2, 0, "CheckIndicator");
+ qmlRegisterType(typeUrl(QStringLiteral("CursorDelegate.qml")), import, 2, 0, "CursorDelegate");
qmlRegisterType(typeUrl(QStringLiteral("ElevationEffect.qml")), import, 2, 0, "ElevationEffect");
qmlRegisterType(typeUrl(QStringLiteral("RectangularGlow.qml")), import, 2, 0, "RectangularGlow");
qmlRegisterType(typeUrl(QStringLiteral("SliderHandle.qml")), import, 2, 0, "SliderHandle");