From 3439a74dab39b1447d11c3c25826ea20fcb7bf0b Mon Sep 17 00:00:00 2001 From: miruka Date: Wed, 24 Jul 2019 15:33:36 -0400 Subject: [PATCH] Add color animation to HBusyIndicator --- src/qml/Base/HBusyIndicator.qml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/qml/Base/HBusyIndicator.qml b/src/qml/Base/HBusyIndicator.qml index 5f8a584c..83543325 100644 --- a/src/qml/Base/HBusyIndicator.qml +++ b/src/qml/Base/HBusyIndicator.qml @@ -13,10 +13,22 @@ BusyIndicator { height: indicator.height radius: height / 2 + ColorAnimation on color { + // Can't swap direct colors values + property string c1: "white" + property string c2: theme ? theme.colors.accentText : "cyan" + + id: colorAnimation + from: c1 + to: c2 + duration: 1000 + onStopped: {[c1, c2] = [c2, c1]; start()} + } + XAnimator on x { from: 0 to: indicator.width - rect.width - duration: 500 + duration: colorAnimation.duration / 2 onStopped: {[from, to] = [to, from]; start()} } }