fix: dash perf battery animating on init

It's noisy since the fill is secondary, so don't animate on init
This commit is contained in:
Soramane 2026-05-22 17:30:07 +08:00
parent bed81f71fa
commit f829fc882c

View file

@ -9,12 +9,18 @@ import qs.services
StyledClippingRect {
id: root
property real animPerc: UPower.displayDevice.percentage
color: Colours.palette.m3secondaryContainer
radius: Tokens.rounding.large
implicitWidth: Config.dashboard.performance.showCpu || (Config.dashboard.performance.showGpu && Gpu.type !== Gpu.None) || Config.dashboard.performance.showStorage || Config.dashboard.performance.showMemory ? Tokens.sizes.dashboard.perfBattWidth : Tokens.sizes.dashboard.perfBattWidthSingle
implicitHeight: Tokens.sizes.dashboard.perfBattHeight
Behavior on animPerc {
Anim {}
}
Contents {
id: layout
@ -30,16 +36,12 @@ StyledClippingRect {
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
implicitHeight: parent.height * UPower.displayDevice.percentage
implicitHeight: parent.height * root.animPerc
color: Colours.palette.m3secondary
radius: Tokens.rounding.extraSmall
clip: true
Behavior on implicitHeight {
Anim {}
}
Contents {
anchors.left: parent.left
anchors.right: parent.right