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
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.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()
Binding {
id: binding
target: icon
property: "text"
value: Math.round(root.value * 100)
when: false
}
SequentialAnimation {
id: anim
Anim {
target: icon
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
Behavior on moving {
SequentialAnimation {
Anim {
target: icon
property: "scale"
to: 0.3
duration: Tokens.anim.durations.small / 2
easing: Tokens.anim.standardAccel
}
PropertyAction {}
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
Behavior on dp {
Anim {}
Anim {
type: Anim.SlowEffects
}
}
}