fix: filled sliders

This commit is contained in:
2 * r + 2 * t 2026-05-05 21:05:42 +10:00
parent eb62e47d27
commit 4ebd0fcb92
2 changed files with 24 additions and 39 deletions

View file

@ -67,46 +67,29 @@ Slider {
property bool moving property bool moving
function update(): void {
animate = !moving;
binding.when = moving;
font = moving ? Tokens.font.body.small : Tokens.font.icon.large;
}
text: root.icon
color: Colours.palette.m3inverseOnSurface
anchors.centerIn: parent anchors.centerIn: parent
anchors.verticalCenterOffset: 1
text: moving ? Math.round(root.value * 100) : root.icon
color: Colours.palette.m3inverseOnSurface
font: moving ? Tokens.font.body.small : Tokens.font.icon.medium
onMovingChanged: anim.restart() Behavior on moving {
SequentialAnimation {
Binding { Anim {
id: binding target: icon
property: "scale"
target: icon to: 0.3
property: "text" duration: Tokens.anim.durations.small / 2
value: Math.round(root.value * 100) easing: Tokens.anim.standardAccel
when: false }
} PropertyAction {}
Anim {
SequentialAnimation { target: icon
id: anim property: "scale"
to: 1
Anim { duration: Tokens.anim.durations.normal / 2
target: icon easing: Tokens.anim.standardDecel
property: "scale" }
to: 0
duration: Tokens.anim.durations.normal / 2
easing: Tokens.anim.standardAccel
}
ScriptAction {
script: icon.update()
}
Anim {
target: icon
property: "scale"
to: 1
duration: Tokens.anim.durations.normal / 2
easing: Tokens.anim.standardDecel
} }
} }
} }

View file

@ -13,6 +13,8 @@ RectangularShadow {
offset.y: dp / 2 offset.y: dp / 2
Behavior on dp { Behavior on dp {
Anim {} Anim {
type: Anim.SlowEffects
}
} }
} }