diff options
author | Mitch Curtis <mitch.curtis@theqtcompany.com> | 2015-12-21 11:50:06 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@theqtcompany.com> | 2016-01-06 11:31:08 +0000 |
commit | a757e8ca0a6f7bb628ac7a57cafa9f0ba5167d51 (patch) | |
tree | cfc8f8b8bf62b4562ecb409b4550d9dbfbeebace /src/imports/controls/ProgressBar.qml | |
parent | 8656d9f0c326520fec896b09ed717eef502ebd7b (diff) |
Implement default ProgressBar according to designs
Change-Id: I7f973deec7453c4b80c03b3dc063f4d0dbe850c5
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/imports/controls/ProgressBar.qml')
-rw-r--r-- | src/imports/controls/ProgressBar.qml | 36 |
1 files changed, 8 insertions, 28 deletions
diff --git a/src/imports/controls/ProgressBar.qml b/src/imports/controls/ProgressBar.qml index 732ae11d..112f3afb 100644 --- a/src/imports/controls/ProgressBar.qml +++ b/src/imports/controls/ProgressBar.qml @@ -36,6 +36,7 @@ import QtQuick 2.6 import Qt.labs.templates 1.0 as T +import Qt.labs.controls.impl 1.0 T.ProgressBar { id: control @@ -46,40 +47,19 @@ T.ProgressBar { indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding //! [indicator] - indicator: Item { + indicator: ProgressStrip { + id: strip x: control.leftPadding y: control.topPadding width: control.availableWidth height: control.availableHeight - scale: control.mirrored ? -1 : 1 + progress: control.position + indeterminate: control.indeterminate - Repeater { - model: indeterminate ? 2 : 1 - - Rectangle { - property real offset: indeterminate ? 0 : control.position - - x: indeterminate ? offset * parent.width : 0 - y: (parent.height - height) / 2 - width: offset * (parent.width - x) - height: 6 - - color: control.enabled ? "#353637" : "#bdbebf" - - SequentialAnimation on offset { - loops: Animation.Infinite - running: indeterminate && visible - PauseAnimation { duration: index ? 520 : 0 } - NumberAnimation { - easing.type: Easing.OutCubic - duration: 1240 - from: 0 - to: 1 - } - PauseAnimation { duration: index ? 0 : 520 } - } - } + ProgressStripAnimator { + target: strip + running: control.visible && control.indeterminate } } //! [indicator] |