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 GitHub
parent 84c529d58d
commit 64d6beb4a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 13 additions and 7 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -211,8 +211,9 @@ Item {
SequentialAnimation { SequentialAnimation {
id: blinkingAnimation id: blinkingAnimation
loops: Animation.Infinite loops: Animation.Infinite
NumberAnimation { target: inner; property: "opacity"; to: 0; duration: 800 } running: visible
NumberAnimation { target: inner; property: "opacity"; to: 1; duration: 800 } 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 { transitions: Transition {
reversible: true 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 { Behavior on color {
ColorAnimation { ColorAnimation {
running: visible
} }
} }
@ -155,7 +156,7 @@ RowLayout {
from: 0 from: 0
to: parent.width to: parent.width
duration: 800 duration: 800
running: mouseArea.containsPress running: visible && mouseArea.containsPress
onStopped: { onStopped: {
if (pressIndicator.width == parent.width) { if (pressIndicator.width == parent.width) {