feat: use indeterminate prog bar for loading perf
Also fix circ prog not showing when NaN value
This commit is contained in:
parent
bb573ea971
commit
86df8ae702
3 changed files with 5 additions and 4 deletions
|
|
@ -28,7 +28,7 @@ Item {
|
|||
|
||||
readonly property real size: Math.min(width, height)
|
||||
readonly property real arcRadius: (size - padding - strokeWidth * (1 + waveAmplitude * 2)) / 2
|
||||
readonly property real clampedVal: Math.max(1 / 360, Math.min(1, value))
|
||||
property real clampedVal: Math.max(1 / 360, Math.min(1, isNaN(value) ? 0 : value)) // Not readonly for animations
|
||||
readonly property real gapAngle: ((spacing + strokeWidth) / (arcRadius || 1)) * (180 / Math.PI)
|
||||
readonly property real dotAngleRad: (startAngle + sweepAngle - gapAngle * (sweepAngle < 360 ? 0 : 1)) * Math.PI / 180
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ Item {
|
|||
implicitSize: height
|
||||
strokeWidth: Tokens.sizes.dashboard.resourceProgressThickness
|
||||
|
||||
Behavior on value {
|
||||
Behavior on clampedVal {
|
||||
Anim {}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ StyledRect {
|
|||
implicitSize: Math.max(icon.implicitWidth, icon.implicitHeight) + Tokens.padding.medium * 2
|
||||
value: root.usage
|
||||
|
||||
Behavior on value {
|
||||
Behavior on clampedVal {
|
||||
Anim {}
|
||||
}
|
||||
|
||||
|
|
@ -102,6 +102,7 @@ StyledRect {
|
|||
value: root.temperature / 100
|
||||
implicitHeight: Tokens.padding.small
|
||||
fgColour: root.accent
|
||||
indeterminate: isNaN(root.usage) || isNaN(root.temperature)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -139,7 +140,7 @@ StyledRect {
|
|||
|
||||
StyledText {
|
||||
anchors.centerIn: parent
|
||||
text: Math.round(root.usage * 100) + "%"
|
||||
text: isNaN(root.usage) ? "...%" : Math.round(root.usage * 100) + "%"
|
||||
color: root.accent
|
||||
font: Tokens.font.headline.builders.small.width(50).build()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue