diff options
author | Tasuku Suzuki <tasuku.suzuki@qt.io> | 2017-12-25 13:30:10 +0900 |
---|---|---|
committer | Jan-Simon Moeller <jsmoeller@linuxfoundation.org> | 2017-12-27 13:40:41 +0000 |
commit | 62564427560871d4fb4092aed01610320d4649d9 (patch) | |
tree | cc6fd658098eb982b2f56276d708124c3d90a48e /imports/qtquickcontrols2aglstyle/ProgressBar.qml | |
parent | 68c9cdb72d888d6e74954c113941e96055f6db31 (diff) |
Improve ProgressBar and Slider styleeel_5.1.0eel_5.0.3eel_5.0.2eel_5.0.1eel_5.0.0eel/5.1.0eel/5.0.3eel/5.0.2eel/5.0.1eel/5.0.05.1.05.0.35.0.25.0.15.0.0eel
The position of stop 1.0 was set to the positoin of "value" in both
controls. Due to this, gradiation was changed/re-drawn whenever value
was changed.
This commit sets the position of stop 1.0 to the end of the control.
Now gradiation itself is fixed, not changed by its value.
Change-Id: I84e1b30a18af6a0af2d5b867a288b0d3501e565e
Signed-off-by: Tasuku Suzuki <tasuku.suzuki@qt.io>
Diffstat (limited to 'imports/qtquickcontrols2aglstyle/ProgressBar.qml')
-rw-r--r-- | imports/qtquickcontrols2aglstyle/ProgressBar.qml | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/imports/qtquickcontrols2aglstyle/ProgressBar.qml b/imports/qtquickcontrols2aglstyle/ProgressBar.qml index b44538c..6d5e3ae 100644 --- a/imports/qtquickcontrols2aglstyle/ProgressBar.qml +++ b/imports/qtquickcontrols2aglstyle/ProgressBar.qml @@ -16,6 +16,7 @@ import QtQuick 2.6 import QtQuick.Templates 2.0 as T +import QtGraphicalEffects 1.0 T.ProgressBar { id: control @@ -36,15 +37,34 @@ T.ProgressBar { implicitHeight: background.implicitHeight Rectangle { - rotation: -90 - transformOrigin: Item.TopLeft - y: 10 - width: parent.height - height: control.visualPosition * background.width - radius: width / 2 + width: control.visualPosition * background.width + height: background.height + radius: background.radius + visible: !control.indeterminate + } + + Rectangle { + visible: control.indeterminate + width: background.width * 0.1 + height: background.height + radius: background.radius + NumberAnimation on x { + from: 0 + to: background.width * 0.9 + duration: 2000 + loops: Animation.Infinite + running: control.indeterminate + easing.type: Easing.SineCurve + } + } + + layer.enabled: true + layer.effect: LinearGradient { + start: Qt.point(0, 0) + end: Qt.point(background.width, 0) gradient: Gradient { - GradientStop { position: 0.0; color: '#00ADDC' } - GradientStop { position: 1.0; color: '#6BFBFF' } + GradientStop { position: 0.0; color: "#00ADDC" } + GradientStop { position: 1.0; color: "#6BFBFF" } } } } |