From 33aaa857965eca1dfa77155afee3ed666a9f74f5 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sat, 25 Apr 2020 18:11:49 +0300 Subject: [PATCH] improve AutoSizer animations signaling --- .../ui/abilities/AnimationsPrivate.qml | 4 ++-- .../contents/ui/abilities/AutoSizePrivate.qml | 19 ++++++++----------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/containment/package/contents/ui/abilities/AnimationsPrivate.qml b/containment/package/contents/ui/abilities/AnimationsPrivate.qml index 2a354c22c..1b00b6fda 100644 --- a/containment/package/contents/ui/abilities/AnimationsPrivate.qml +++ b/containment/package/contents/ui/abilities/AnimationsPrivate.qml @@ -44,8 +44,8 @@ Ability { //C7 property int durationTime -> speedFactor.current //C6 property int animationTime -> duration.proposed - //root.shortDuration -> animations.shortDuration - //root.longDuration -> animations.longDuration + //C20 root.shortDuration -> animations.shortDuration + //C21 root.longDuration -> animations.longDuration //parabolic //C3 property int animationStep -> hoverPixelSensitivity diff --git a/containment/package/contents/ui/abilities/AutoSizePrivate.qml b/containment/package/contents/ui/abilities/AutoSizePrivate.qml index fcb44f801..9b66b2933 100644 --- a/containment/package/contents/ui/abilities/AutoSizePrivate.qml +++ b/containment/package/contents/ui/abilities/AutoSizePrivate.qml @@ -34,7 +34,8 @@ Ability { && latteView && latteView.visibility.mode !== LatteCore.Types.SideBar property int iconSize: -1 //it is not set, this is the default - property bool automaticSizeAnimation: false + readonly property bool inCalculatedIconSize: ((container.iconSize === sizer.iconSize) || (container.iconSize === container.maxIconSize)) + readonly property bool inAutoSizeAnimation: !inCalculatedIconSize readonly property int automaticStep: 8 readonly property int historyMaxSize: 10 @@ -50,10 +51,13 @@ Ability { property Item layouts property Item visibility - onIconSizeChanged: { - if (!automaticSizeAnimation) { - automaticSizeAnimation = true; + + + onInAutoSizeAnimationChanged: { + if (inAutoSizeAnimation) { animations.needBothAxis.addEvent(sizer); + } else { + animations.needBothAxis.removeEvent(sizer); } } @@ -79,13 +83,6 @@ Ability { sizer.updateIconSize(); } } - - onIconSizeChanged: { - if (((container.iconSize === sizer.iconSize) || (container.iconSize === container.maxIconSize)) && sizer.automaticSizeAnimation){ - animations.needBothAxis.removeEvent(sizer); - sizer.automaticSizeAnimation=false; - } - } } Connections {