moment/src/qml/Base/HProgressBar.qml
2019-11-06 10:08:55 -04:00

37 lines
1002 B
QML

import QtQuick 2.12
import QtQuick.Controls 2.12
ProgressBar {
id: bar
property color backgroundColor: theme.controls.progressBar.background
property color foregroundColor: theme.controls.progressBar.foreground
background: Rectangle {
implicitWidth: 200
implicitHeight: theme.controls.progressBar.height
color: backgroundColor
}
contentItem: Item {
implicitWidth: 200
implicitHeight: theme.controls.progressBar.height
Rectangle {
id: indicator
width: bar.indeterminate ?
parent.width / 8 : bar.visualPosition * parent.width
height: parent.height
color: foregroundColor
XAnimator on x {
running: indeterminate
duration: theme.animationDuration * 8
from: 0
to: bar.width - indicator.width
onStopped: {[from, to] = [to, from]; start()}
}
}
}
}