From 97b1608bcb3c25875603bd6a3f7d9a1a8ca2eb44 Mon Sep 17 00:00:00 2001 From: miruka Date: Tue, 27 Aug 2019 22:59:26 -0400 Subject: [PATCH] Ensure opacity/rotation of button icon is reset After loading finished --- src/qml/Base/HButtonContent.qml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/qml/Base/HButtonContent.qml b/src/qml/Base/HButtonContent.qml index e7bb83de..c0c7a063 100644 --- a/src/qml/Base/HButtonContent.qml +++ b/src/qml/Base/HButtonContent.qml @@ -20,18 +20,28 @@ HRowLayout { HIcon { + property bool loading: button.loading || false + id: icon svgName: button.icon.name colorize: button.icon.color cache: button.icon.cache + onLoadingChanged: if (! loading) resetAnimations.start() + Layout.fillHeight: true Layout.alignment: Qt.AlignCenter - HNumberAnimation { + + ParallelAnimation { + id: resetAnimations + HNumberAnimation { target: icon; property: "opacity"; to: 1 } + HNumberAnimation { target: icon; property: "rotation"; to: 0 } + } + + + HNumberAnimation on opacity { id: blink - target: icon - property: "opacity" from: 1 to: 0.5 factor: 2