Use new HScaleAnimator instead of HNumberAnimation

This commit is contained in:
miruka 2019-11-30 14:59:48 -04:00
parent 29cdc0f3f8
commit c5a8be9ef9
8 changed files with 20 additions and 12 deletions

View File

@ -41,7 +41,7 @@ Rectangle {
}
HNumberAnimation on scale {
HScaleAnimator on scale {
running: true
from: 0
to: 1

View File

@ -45,8 +45,9 @@ CheckBox {
svgName: "check-mark"
colorize: theme.controls.checkBox.checkIconColorize
visible: scale > 0
scale: box.checked ? 1 : 0
// FIXME: HScaleAnimator won't work here?
Behavior on scale {
HNumberAnimation {
overshoot: 4

View File

@ -53,9 +53,8 @@ Image {
theme.controls.image.maxPauseIndicatorSize,
)
scale: parent.status == Image.Ready && parent.paused ? 1 : 0
visible: scale > 0
Behavior on scale { HNumberAnimation { overshoot: 4 } }
Behavior on scale { HScaleAnimator { overshoot: 4 } }
}
}
}

View File

@ -10,10 +10,11 @@ Popup {
enter: Transition {
HNumberAnimation { property: "scale"; from: 0; to: 1; overshoot: 4 }
HScaleAnimator { from: 0; to: 1; overshoot: 4 }
}
exit: Transition {
// FIXME: HScaleAnimator won't work here?
HNumberAnimation { property: "scale"; to: 0 }
}

View File

@ -0,0 +1,10 @@
import QtQuick 2.12
ScaleAnimator {
property real factor: 1.0
property real overshoot: 1.0
duration: theme.animationDuration * Math.max(overshoot / 1.7, 1.0) * factor
easing.type: overshoot > 1 ? Easing.OutBack : Easing.Linear
easing.overshoot: overshoot
}

View File

@ -37,6 +37,7 @@ ToolTip {
}
}
// FIXME: HOpacityAnimator won't work for these?
enter: Transition {
HNumberAnimation { property: "opacity"; from: 0.0; to: 1.0 }
}

View File

@ -21,12 +21,8 @@ Item {
SequentialAnimation {
id: pressAnimation
HNumberAnimation {
target: mainUI; property: "scale"; from: 1.0; to: 0.9
}
HNumberAnimation {
target: mainUI; property: "scale"; from: 0.9; to: 1.0
}
HScaleAnimator { target: mainUI; from: 1.0; to: 0.9 }
HScaleAnimator { target: mainUI; from: 0.9; to: 1.0 }
}
property bool accountsPresent:

View File

@ -52,6 +52,6 @@ ApplicationWindow {
scale: py.ready ? 1 : 0.5
source: py.ready ? (Qt.application.arguments[1] || "UI.qml") : ""
Behavior on scale { HNumberAnimation { overshoot: 5; factor: 1.2 } }
Behavior on scale { HScaleAnimator { overshoot: 5; factor: 1.2 } }
}
}