aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/universal/ProgressBar.qml
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2016-03-21 12:25:07 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2016-03-21 14:22:08 +0000
commite33b80dbc2dc696610e8ceee5d63e13c6f8edeb8 (patch)
treef55d047336cb5de510a59d2cebc7d1847ea36f93 /src/imports/controls/universal/ProgressBar.qml
parent17df1dd90e3f3afc653cf29fcd2c1a568c1d626a (diff)
Universal: eliminate the extra Rectangle from ProgressBar indicator
Make ProgressStrip capable of presenting non-indeterminate state the same way the Default and Material styles do. This makes the next step, which is to transition to contentItem, easier. Change-Id: I1a7e48cfba963f11764675b6e9a38ff2898b1212 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'src/imports/controls/universal/ProgressBar.qml')
-rw-r--r--src/imports/controls/universal/ProgressBar.qml25
1 files changed, 9 insertions, 16 deletions
diff --git a/src/imports/controls/universal/ProgressBar.qml b/src/imports/controls/universal/ProgressBar.qml
index 3d88fc67..308b83f7 100644
--- a/src/imports/controls/universal/ProgressBar.qml
+++ b/src/imports/controls/universal/ProgressBar.qml
@@ -48,29 +48,22 @@ T.ProgressBar {
indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding
//! [indicator]
- indicator: Rectangle {
+ indicator: ProgressStrip {
+ id: strip
x: control.leftPadding
y: control.topPadding + (control.availableHeight - height) / 2
- width: control.indeterminate ? 0 : control.position * control.availableWidth
+ width: control.availableWidth
height: 10
scale: control.mirrored ? -1 : 1
+ indeterminate: control.indeterminate
color: control.Universal.accent
+ progress: control.position
+ clip: control.indeterminate
- ProgressStrip {
- id: strip
-
- width: control.availableWidth
- height: control.availableHeight
-
- clip: control.indeterminate
- visible: control.indeterminate
- color: control.Universal.accent
-
- ProgressStripAnimator {
- target: strip
- running: strip.visible
- }
+ ProgressStripAnimator {
+ target: strip
+ running: control.visible && control.indeterminate
}
}
//! [indicator]