diff options
author | Mitch Curtis <mitch.curtis@theqtcompany.com> | 2015-12-15 09:21:39 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@theqtcompany.com> | 2015-12-16 17:24:47 +0000 |
commit | 2600bd0eedeaff3dd7727a57ee6149f5211780b4 (patch) | |
tree | 4a04a4bb12568fc0b5c76db0ccabf7a41f63a076 /src/imports/controls/BusyIndicator.qml | |
parent | 2b81cdd40cdd265a50f91b4775cf5638b987d69f (diff) |
Implement BusyIndicator according to designs
Change-Id: Iffaafc1d5512b4e47a7c6c304a3883ab8d986b12
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'src/imports/controls/BusyIndicator.qml')
-rw-r--r-- | src/imports/controls/BusyIndicator.qml | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/src/imports/controls/BusyIndicator.qml b/src/imports/controls/BusyIndicator.qml index 2d898566..1c55e75d 100644 --- a/src/imports/controls/BusyIndicator.qml +++ b/src/imports/controls/BusyIndicator.qml @@ -36,6 +36,7 @@ import QtQuick 2.6 import Qt.labs.controls 1.0 +import Qt.labs.controls.impl 1.0 import Qt.labs.templates 1.0 as T T.BusyIndicator { @@ -47,30 +48,17 @@ T.BusyIndicator { padding: 6 //! [contentItem] - contentItem: Item { - id: delegate + contentItem: BusyRing { + id: ring implicitWidth: 48 implicitHeight: 48 - opacity: control.running ? 1 : 0 - Behavior on opacity { OpacityAnimator { duration: 250 } } - Image { - x: (parent.width - width) / 2 - y: (parent.height - height) / 2 - width: Math.min(parent.width, parent.height) - height: width - source: width <= 32 ? "qrc:/qt-project.org/imports/Qt/labs/controls/images/spinner_small.png" : - width >= 48 ? "qrc:/qt-project.org/imports/Qt/labs/controls/images/spinner_large.png" : - "qrc:/qt-project.org/imports/Qt/labs/controls/images/spinner_medium.png" + Behavior on opacity { OpacityAnimator { duration: 250 } } - RotationAnimator on rotation { - duration: 800 - loops: Animation.Infinite - from: 0 - to: 360 - running: control.visible && (control.running || delegate.opacity > 0) - } + BusyRingAnimator { + target: ring + running: control.visible && control.running } } //! [contentItem] |