From 8644fb7113fc860cfefb271a2a30e5d3b3271aa3 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 6 Oct 2016 11:54:00 +0200 Subject: [PATCH] Never animate progress bars if they are invisible This is now the responsibility of the theme rather than the interface element, since the theme defines the animation itself. This makes it that the interface element doesn't need to worry about things like its style or animation. Contributes to issue CURA-2497. --- resources/qml/MonitorButton.qml | 4 ---- resources/themes/cura/styles.qml | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/resources/qml/MonitorButton.qml b/resources/qml/MonitorButton.qml index 8bd593dd11..607d0a24ca 100644 --- a/resources/qml/MonitorButton.qml +++ b/resources/qml/MonitorButton.qml @@ -161,10 +161,6 @@ Rectangle visible: showProgress; indeterminate: { - if(!showProgress) - { - return false; //Never be indeterminate when not visible, since that triggers a redraw of the screen. - } switch(Cura.MachineManager.printerOutputDevices[0].jobState) { case "pausing": diff --git a/resources/themes/cura/styles.qml b/resources/themes/cura/styles.qml index 8c419fb245..cc6bdfed77 100644 --- a/resources/themes/cura/styles.qml +++ b/resources/themes/cura/styles.qml @@ -237,7 +237,7 @@ QtObject { SequentialAnimation on x { id: xAnim property int animEndPoint: Theme.getSize("message").width - (Theme.getSize("default_margin").width * 2) - Theme.getSize("progressbar_control").width - running: control.indeterminate + running: control.indeterminate && control.visible loops: Animation.Infinite NumberAnimation { from: 0; to: xAnim.animEndPoint; duration: 2000;} NumberAnimation { from: xAnim.animEndPoint; to: 0; duration: 2000;}