Time drawer animations by their direction, so closing speeds apply

The duration was picked from `open`, which can update after the
progress animation has already started, so closes ran at the opening
speed. Use the Behavior's target value instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mxandClaude Opus 5.5 committed 2026-11-26 14:09:38 +01:00
1 parent b03bd77941
commit 604424869d
1 file changed
+6 -2
+6 -2
View File
@@ -50,13 +50,17 @@ Item {
// Content parent, for items reparented in at runtime. // Content parent, for items reparented in at runtime.
readonly property alias container: inner readonly property alias container: inner
// Enter: emphasized decelerate; exit: emphasized accelerate (Material 3). // Enter: emphasized decelerate; exit: emphasized accelerate (Material 3).
// Timing follows where the animation is heading, not `open`: both bindings
// depend on `open`, and the animation can start before the duration updates.
Behavior on progress { Behavior on progress {
id: motionBehavior
NumberAnimation { NumberAnimation {
id: anim id: anim
duration: root.liquid ? (root.open ? Theme.notchPanelOpenDuration : Theme.notchPanelCloseDuration) : root.open ? root.openDuration : root.closeDuration readonly property bool opening: motionBehavior.targetValue > 0.5
duration: root.liquid ? (anim.opening ? Theme.notchPanelOpenDuration : Theme.notchPanelCloseDuration) : anim.opening ? root.openDuration : root.closeDuration
// NotchDrop eases each phase itself. // NotchDrop eases each phase itself.
easing.type: root.liquid ? Easing.Linear : Easing.BezierSpline easing.type: root.liquid ? Easing.Linear : Easing.BezierSpline
easing.bezierCurve: root.open ? [0.05, 0.7, 0.1, 1, 1, 1] : [0.3, 0, 0.8, 0.15, 1, 1] easing.bezierCurve: anim.opening ? [0.05, 0.7, 0.1, 1, 1, 1] : [0.3, 0, 0.8, 0.15, 1, 1]
} }
} }
implicitWidth: contentWidth + 2 * ear implicitWidth: contentWidth + 2 * ear