feat: use indeterminate prog bar for loading perf

Also fix circ prog not showing when NaN value
This commit is contained in:
2 * r + 2 * t 2026-04-25 17:59:33 +10:00
parent bb573ea971
commit 86df8ae702
3 changed files with 5 additions and 4 deletions

View file

@ -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

View file

@ -53,7 +53,7 @@ Item {
implicitSize: height
strokeWidth: Tokens.sizes.dashboard.resourceProgressThickness
Behavior on value {
Behavior on clampedVal {
Anim {}
}

View file

@ -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()
}