2019-12-19 07:46:16 -04:00
|
|
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
|
2019-11-06 13:49:48 -04:00
|
|
|
import QtQuick 2.12
|
|
|
|
import RadialBar 1.0
|
|
|
|
|
|
|
|
RadialBar {
|
|
|
|
id: bar
|
2019-12-04 09:08:38 -04:00
|
|
|
implicitWidth: 96 * (theme ? theme.uiScale : 1)
|
2019-11-06 15:30:51 -04:00
|
|
|
implicitHeight: implicitWidth
|
2019-11-06 13:49:48 -04:00
|
|
|
foregroundColor: theme.controls.circleProgressBar.background
|
|
|
|
progressColor: theme.controls.circleProgressBar.foreground
|
|
|
|
dialWidth: theme.controls.circleProgressBar.thickness
|
|
|
|
startAngle: 0
|
|
|
|
spanAngle: 360
|
|
|
|
|
|
|
|
from: 0
|
2019-11-06 15:47:18 -04:00
|
|
|
to: 1
|
2019-11-06 13:49:48 -04:00
|
|
|
value: 0
|
|
|
|
|
|
|
|
showText: true
|
2019-11-06 14:29:32 -04:00
|
|
|
textFont.pixelSize: theme ? theme.fontSize.big : 22
|
|
|
|
textColor: theme ? theme.controls.circleProgressBar.text : "white"
|
2019-11-06 13:49:48 -04:00
|
|
|
|
|
|
|
|
|
|
|
property alias from: bar.minValue
|
|
|
|
property alias to: bar.maxValue
|
|
|
|
property bool indeterminate: false
|
|
|
|
|
2019-11-06 14:29:32 -04:00
|
|
|
property real indeterminateSpan:
|
|
|
|
theme.controls.circleProgressBar.indeterminateSpan
|
|
|
|
|
2019-11-06 13:49:48 -04:00
|
|
|
|
2019-12-11 13:03:33 -04:00
|
|
|
Binding on value {
|
2019-11-06 14:29:32 -04:00
|
|
|
value: bar.to * bar.indeterminateSpan
|
2019-11-06 13:49:48 -04:00
|
|
|
when: bar.indeterminate
|
|
|
|
}
|
|
|
|
|
2019-12-11 13:03:33 -04:00
|
|
|
Binding on showText {
|
2019-11-06 13:49:48 -04:00
|
|
|
value: false
|
|
|
|
when: bar.indeterminate
|
|
|
|
}
|
|
|
|
|
2019-12-16 04:42:41 -04:00
|
|
|
HNumberAnimation on rotation {
|
2019-11-06 13:49:48 -04:00
|
|
|
running: bar.indeterminate
|
|
|
|
from: 0
|
|
|
|
to: 360
|
|
|
|
loops: Animation.Infinite
|
|
|
|
duration: theme ? (theme.animationDuration * 6) : 600
|
|
|
|
}
|
|
|
|
}
|