Просмотр исходного кода

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.
Ghostkeeper 8 лет назад
Родитель
Сommit
8644fb7113
2 измененных файлов с 1 добавлено и 5 удалено
  1. 0 4
      resources/qml/MonitorButton.qml
  2. 1 1
      resources/themes/cura/styles.qml

+ 0 - 4
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":

+ 1 - 1
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;}