Use OpacityAnimators instead of NumberAnimations

This commit is contained in:
miruka
2019-11-30 11:29:59 -04:00
parent d1e1ed07dd
commit 6a442da16f
12 changed files with 25 additions and 16 deletions

View File

@@ -11,7 +11,7 @@ Rectangle {
property QtObject buttonTheme
Behavior on opacity { HNumberAnimation {} }
Behavior on opacity { HOpacityAnimator {} }
Rectangle {

View File

@@ -16,7 +16,7 @@ HRowLayout {
readonly property alias label: label
Behavior on opacity { HNumberAnimation {} }
Behavior on opacity { HOpacityAnimator {} }
HIcon {
@@ -35,7 +35,7 @@ HRowLayout {
ParallelAnimation {
id: resetAnimations
HNumberAnimation { target: icon; property: "opacity"; to: 1 }
HOpacityAnimator { target: icon; to: 1 }
HNumberAnimation { target: icon; property: "rotation"; to: 0 }
}

View File

@@ -17,7 +17,7 @@ CheckBox {
property alias subtitle: subtitleText
Behavior on opacity { HNumberAnimation { factor: 2 } }
Behavior on opacity { HOpacityAnimator { factor: 2 } }
indicator: Rectangle {

View File

@@ -31,7 +31,7 @@ ListView {
add: Transition {
ParallelAnimation {
HNumberAnimation { property: "opacity"; from: 0; to: 1 }
HOpacityAnimator { from: 0; to: 1 }
HNumberAnimation { properties: "x,y"; from: 100 }
}
}
@@ -39,14 +39,14 @@ ListView {
move: Transition {
ParallelAnimation {
// Ensure opacity goes to 1 if add/remove transition is interrupted
HNumberAnimation { property: "opacity"; to: 1 }
HOpacityAnimator { to: 1 }
HNumberAnimation { properties: "x,y" }
}
}
remove: Transition {
ParallelAnimation {
HNumberAnimation { property: "opacity"; to: 0 }
HOpacityAnimator { to: 0 }
HNumberAnimation { properties: "x,y"; to: 100 }
}
}

View File

@@ -0,0 +1,7 @@
import QtQuick 2.12
OpacityAnimator {
duration: theme.animationDuration * factor
property real factor: 1.0
}