Use new HScaleAnimator instead of HNumberAnimation
This commit is contained in:
parent
29cdc0f3f8
commit
c5a8be9ef9
|
@ -41,7 +41,7 @@ Rectangle {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
HNumberAnimation on scale {
|
HScaleAnimator on scale {
|
||||||
running: true
|
running: true
|
||||||
from: 0
|
from: 0
|
||||||
to: 1
|
to: 1
|
||||||
|
|
|
@ -45,8 +45,9 @@ CheckBox {
|
||||||
svgName: "check-mark"
|
svgName: "check-mark"
|
||||||
colorize: theme.controls.checkBox.checkIconColorize
|
colorize: theme.controls.checkBox.checkIconColorize
|
||||||
|
|
||||||
visible: scale > 0
|
|
||||||
scale: box.checked ? 1 : 0
|
scale: box.checked ? 1 : 0
|
||||||
|
|
||||||
|
// FIXME: HScaleAnimator won't work here?
|
||||||
Behavior on scale {
|
Behavior on scale {
|
||||||
HNumberAnimation {
|
HNumberAnimation {
|
||||||
overshoot: 4
|
overshoot: 4
|
||||||
|
|
|
@ -53,9 +53,8 @@ Image {
|
||||||
theme.controls.image.maxPauseIndicatorSize,
|
theme.controls.image.maxPauseIndicatorSize,
|
||||||
)
|
)
|
||||||
scale: parent.status == Image.Ready && parent.paused ? 1 : 0
|
scale: parent.status == Image.Ready && parent.paused ? 1 : 0
|
||||||
visible: scale > 0
|
|
||||||
|
|
||||||
Behavior on scale { HNumberAnimation { overshoot: 4 } }
|
Behavior on scale { HScaleAnimator { overshoot: 4 } }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,10 +10,11 @@ Popup {
|
||||||
|
|
||||||
|
|
||||||
enter: Transition {
|
enter: Transition {
|
||||||
HNumberAnimation { property: "scale"; from: 0; to: 1; overshoot: 4 }
|
HScaleAnimator { from: 0; to: 1; overshoot: 4 }
|
||||||
}
|
}
|
||||||
|
|
||||||
exit: Transition {
|
exit: Transition {
|
||||||
|
// FIXME: HScaleAnimator won't work here?
|
||||||
HNumberAnimation { property: "scale"; to: 0 }
|
HNumberAnimation { property: "scale"; to: 0 }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
10
src/qml/Base/HScaleAnimator.qml
Normal file
10
src/qml/Base/HScaleAnimator.qml
Normal 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
|
||||||
|
}
|
|
@ -37,6 +37,7 @@ ToolTip {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME: HOpacityAnimator won't work for these?
|
||||||
enter: Transition {
|
enter: Transition {
|
||||||
HNumberAnimation { property: "opacity"; from: 0.0; to: 1.0 }
|
HNumberAnimation { property: "opacity"; from: 0.0; to: 1.0 }
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,12 +21,8 @@ Item {
|
||||||
|
|
||||||
SequentialAnimation {
|
SequentialAnimation {
|
||||||
id: pressAnimation
|
id: pressAnimation
|
||||||
HNumberAnimation {
|
HScaleAnimator { target: mainUI; from: 1.0; to: 0.9 }
|
||||||
target: mainUI; property: "scale"; from: 1.0; to: 0.9
|
HScaleAnimator { target: mainUI; from: 0.9; to: 1.0 }
|
||||||
}
|
|
||||||
HNumberAnimation {
|
|
||||||
target: mainUI; property: "scale"; from: 0.9; to: 1.0
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
property bool accountsPresent:
|
property bool accountsPresent:
|
||||||
|
|
|
@ -52,6 +52,6 @@ ApplicationWindow {
|
||||||
scale: py.ready ? 1 : 0.5
|
scale: py.ready ? 1 : 0.5
|
||||||
source: py.ready ? (Qt.application.arguments[1] || "UI.qml") : ""
|
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 } }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user