diff --git a/components/controls/FilledSlider.qml b/components/controls/FilledSlider.qml index f8807108..5dd8b641 100644 --- a/components/controls/FilledSlider.qml +++ b/components/controls/FilledSlider.qml @@ -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 + } } } } diff --git a/components/effects/Elevation.qml b/components/effects/Elevation.qml index 9e0962da..9b8822c5 100644 --- a/components/effects/Elevation.qml +++ b/components/effects/Elevation.qml @@ -13,6 +13,8 @@ RectangularShadow { offset.y: dp / 2 Behavior on dp { - Anim {} + Anim { + type: Anim.SlowEffects + } } }