moment/src/qml/Base/HProgressBar.qml

37 lines
1002 B
QML
Raw Normal View History

2019-08-29 04:28:20 +10:00
import QtQuick 2.12
import QtQuick.Controls 2.12
ProgressBar {
id: bar
2019-09-18 06:30:04 +10:00
property color backgroundColor: theme.controls.progressBar.background
property color foregroundColor: theme.controls.progressBar.foreground
2019-08-29 04:28:20 +10:00
background: Rectangle {
implicitWidth: 200
implicitHeight: theme.controls.progressBar.height
2019-09-18 06:30:04 +10:00
color: backgroundColor
2019-08-29 04:28:20 +10:00
}
contentItem: Item {
implicitWidth: 200
implicitHeight: theme.controls.progressBar.height
Rectangle {
2019-11-07 01:08:55 +11:00
id: indicator
width: bar.indeterminate ?
parent.width / 8 : bar.visualPosition * parent.width
2019-08-29 04:28:20 +10:00
height: parent.height
2019-09-18 06:30:04 +10:00
color: foregroundColor
2019-11-07 01:08:55 +11:00
XAnimator on x {
running: indeterminate
duration: theme.animationDuration * 8
from: 0
to: bar.width - indicator.width
onStopped: {[from, to] = [to, from]; start()}
}
2019-08-29 04:28:20 +10:00
}
}
}