diff options
Diffstat (limited to 'src/imports/controls/imagine/ProgressBar.qml')
-rw-r--r-- | src/imports/controls/imagine/ProgressBar.qml | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/src/imports/controls/imagine/ProgressBar.qml b/src/imports/controls/imagine/ProgressBar.qml index 5cfc292c..7fd0ce1b 100644 --- a/src/imports/controls/imagine/ProgressBar.qml +++ b/src/imports/controls/imagine/ProgressBar.qml @@ -58,11 +58,13 @@ T.ProgressBar { implicitHeight: control.indeterminate ? animation.implicitHeight || progress.implicitHeight : progress.implicitHeight scale: control.mirrored ? -1 : 1 - NinePatchImage { - id: progress + readonly property bool hasMask: mask.status !== Image.Null + + readonly property NinePatchImage progress: NinePatchImage { + parent: control.contentItem width: control.position * parent.width height: parent.height - visible: !control.indeterminate && mask.status === Image.Null + visible: !control.indeterminate && !control.contentItem.hasMask source: Imagine.url + "progressbar-progress" NinePatchImageSelector on source { @@ -75,12 +77,12 @@ T.ProgressBar { } } - AnimatedImage { - id: animation + readonly property AnimatedImage animation: AnimatedImage { + parent: control.contentItem width: parent.width height: parent.height playing: control.indeterminate - visible: control.indeterminate && mask.status === Image.Null + visible: control.indeterminate && !control.contentItem.hasMask source: Imagine.url + "progressbar-animation" AnimatedImageSelector on source { @@ -92,10 +94,9 @@ T.ProgressBar { } } - NinePatchImage { - id: mask - width: parent.width - height: parent.height + readonly property NinePatchImage mask: NinePatchImage { + width: control.availableWidth + height: control.availableHeight visible: false source: Imagine.url + "progressbar-mask" @@ -109,15 +110,15 @@ T.ProgressBar { } } - OpacityMask { - id: effect + readonly property OpacityMask effect: OpacityMask { + parent: control.contentItem width: source.width height: source.height - source: control.indeterminate ? animation : progress + source: control.indeterminate ? control.contentItem.animation : control.contentItem.progress maskSource: ShaderEffectSource { - sourceItem: mask - sourceRect: Qt.rect(0, 0, effect.width, effect.height) + sourceItem: control.contentItem.mask + sourceRect: Qt.rect(0, 0, control.contentItem.effect.width, control.contentItem.effect.height) } } } |