moment/src/qml/Base/HProgressBar.qml

37 lines
1002 B
QML
Raw Normal View History

2019-08-28 14:28:20 -04:00
import QtQuick 2.12
import QtQuick.Controls 2.12
ProgressBar {
id: bar
2019-09-17 16:30:04 -04:00
property color backgroundColor: theme.controls.progressBar.background
property color foregroundColor: theme.controls.progressBar.foreground
2019-08-28 14:28:20 -04:00
background: Rectangle {
implicitWidth: 200
implicitHeight: theme.controls.progressBar.height
2019-09-17 16:30:04 -04:00
color: backgroundColor
2019-08-28 14:28:20 -04:00
}
contentItem: Item {
implicitWidth: 200
implicitHeight: theme.controls.progressBar.height
Rectangle {
2019-11-06 10:08:55 -04:00
id: indicator
width: bar.indeterminate ?
parent.width / 8 : bar.visualPosition * parent.width
2019-08-28 14:28:20 -04:00
height: parent.height
2019-09-17 16:30:04 -04:00
color: foregroundColor
2019-11-06 10:08:55 -04: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-28 14:28:20 -04:00
}
}
}