From 2626bd45633d351ca3627c78ad9648898d78e74e Mon Sep 17 00:00:00 2001 From: Mikhail Vinogradov Date: Wed, 14 Dec 2022 15:06:07 +0300 Subject: [PATCH] qml: fix bounce back action with/without animation --- qml/Keyboard.qml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/qml/Keyboard.qml b/qml/Keyboard.qml index 9498bddf..2432d4c4 100644 --- a/qml/Keyboard.qml +++ b/qml/Keyboard.qml @@ -110,8 +110,12 @@ Item { if (keyboardSurface.y > jumpBackThreshold) { MaliitGeometry.shown = false; } else { - bounceBackAnimation.from = keyboardSurface.y - bounceBackAnimation.start(); + if (maliit_input_method.animationEnabled) { + bounceBackAnimation.from = keyboardSurface.y; + bounceBackAnimation.start(); + } else { + keyboardSurface.y = 0; + } } } @@ -191,10 +195,7 @@ Item { PropertyAnimation { id: bounceBackAnimation - // Animations don't have an "enabled" property, so just set the - // target to null if animation is disabled, which effectively also - // disables the animation. - target: Keyboard.animationEnabled ? keyboardSurface : null + target: keyboardSurface properties: "y" easing.type: Easing.OutBounce; easing.overshoot: 2.0