Use OpacityAnimators instead of NumberAnimations
This commit is contained in:
@@ -11,7 +11,7 @@ Rectangle {
|
||||
property QtObject buttonTheme
|
||||
|
||||
|
||||
Behavior on opacity { HNumberAnimation {} }
|
||||
Behavior on opacity { HOpacityAnimator {} }
|
||||
|
||||
|
||||
Rectangle {
|
||||
|
@@ -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 }
|
||||
}
|
||||
|
||||
|
@@ -17,7 +17,7 @@ CheckBox {
|
||||
property alias subtitle: subtitleText
|
||||
|
||||
|
||||
Behavior on opacity { HNumberAnimation { factor: 2 } }
|
||||
Behavior on opacity { HOpacityAnimator { factor: 2 } }
|
||||
|
||||
|
||||
indicator: Rectangle {
|
||||
|
@@ -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 }
|
||||
}
|
||||
}
|
||||
|
7
src/qml/Base/HOpacityAnimator.qml
Normal file
7
src/qml/Base/HOpacityAnimator.qml
Normal file
@@ -0,0 +1,7 @@
|
||||
import QtQuick 2.12
|
||||
|
||||
OpacityAnimator {
|
||||
duration: theme.animationDuration * factor
|
||||
|
||||
property real factor: 1.0
|
||||
}
|
Reference in New Issue
Block a user