bug(@status-q): only run animations when they are visible to avoid cpu issues (#744)

bug(@status-q): only run animations when they are visible to avoid cpu issues

remove prop that doesn't exist
This commit is contained in:
Iuri Matias 2022-06-28 11:03:17 -04:00 committed by Michał Cieślak
parent 2a64ba455b
commit 9f8caa00bb
8 changed files with 13 additions and 7 deletions

View File

@ -16,6 +16,7 @@ GradientStop {
NumberAnimation on position {
easing.type: Easing.Linear
loops: Animation.Infinite
running: visible
from: root.from
to: from + 4
duration: 2000

View File

@ -73,6 +73,7 @@ Item {
duration: 150
direction: RotationAnimation.Clockwise
easing.type: Easing.InCubic
running: visible
}
},
Transition {
@ -82,6 +83,7 @@ Item {
duration: 150
direction: RotationAnimation.Counterclockwise
easing.type: Easing.OutCubic
running: visible
}
}
]

View File

@ -217,12 +217,12 @@ Rectangle {
Transition {
from: "COLLAPSED"
to: "EXPANDED"
NumberAnimation { properties: "height"; duration: 200 }
NumberAnimation { properties: "height"; duration: 200; running: visible }
},
Transition {
from: "EXPANDED"
to: "COLLAPSED"
NumberAnimation { properties: "height"; duration: 200 }
NumberAnimation { properties: "height"; duration: 200; running: visible }
}
]
}

View File

@ -11,7 +11,7 @@ StatusIcon {
from: 0;
to: 360;
duration: 1200
running: true
running: visible
loops: Animation.Infinite
}
}

View File

@ -115,6 +115,7 @@ Rectangle {
properties: "scale";
duration: 100;
easing.type: Easing.InOutQuad
running: visible
}
}

View File

@ -211,8 +211,9 @@ Item {
SequentialAnimation {
id: blinkingAnimation
loops: Animation.Infinite
NumberAnimation { target: inner; property: "opacity"; to: 0; duration: 800 }
NumberAnimation { target: inner; property: "opacity"; to: 1; duration: 800 }
running: visible
NumberAnimation { target: inner; property: "opacity"; to: 0; duration: 800; running: visible }
NumberAnimation { target: inner; property: "opacity"; to: 1; duration: 800; running: visible }
}
}
}

View File

@ -52,7 +52,7 @@ Switch {
transitions: Transition {
reversible: true
NumberAnimation { properties: "x"; easing.type: Easing.Linear; duration: 120; }
NumberAnimation { properties: "x"; easing.type: Easing.Linear; duration: 120; running: visible }
}
}
}

View File

@ -108,6 +108,7 @@ RowLayout {
Behavior on color {
ColorAnimation {
running: visible
}
}
@ -155,7 +156,7 @@ RowLayout {
from: 0
to: parent.width
duration: 800
running: mouseArea.containsPress
running: visible && mouseArea.containsPress
onStopped: {
if (pressIndicator.width == parent.width) {