@@ -25,21 +25,31 @@ QtObject {
26 property int itemIndex: 0
26 property int itemIndex: 0
27 property int normalZ: 0
27 property int normalZ: 0
28− property real progress: 0
29 property int startWidth: 0
28 property int startWidth: 0
30 property int startHeight: 0
29 property int startHeight: 0
31 property int startX: 0
30 property int startX: 0
32 property int targetX: 0
31 property int targetX: 0
33 property int startY: 0
32 property int startY: 0
34 property int targetY: 0
33 property int targetY: 0
35−// property real startAngle: 40
36 property real targetAngle: 0
34 property real targetAngle: 0
37 property int targetHeight: 0
35 property int targetHeight: 0
38 property real targetScale: 0
36 property real targetScale: 0
37+ property real swipeProgress: 0
38+ property real pushProgress: 0
41 property real breakPoint: 0.4
41 property real breakPoint: 0.4
44+ readonly property real progress: {
45+ if (pushProgress > 0) {
46+ // we don't do the full animation when pushing, just a little bit
47+ return MathUtils.linearAnimation(0, 1, 0, breakPoint + .1, pushProgress)
49+ return swipeProgress;
45 readonly property real scaleToPreviewProgress: {
55 readonly property real scaleToPreviewProgress: {
@@ -68,12 +78,17 @@ QtObject {
69 readonly property int animatedZ: {
79 readonly property int animatedZ: {
70 if (progress < breakPoint + (1 - breakPoint) / 2) {
80 if (progress < breakPoint + (1 - breakPoint) / 2) {
81+ if (swipeProgress > 0) {
71− return itemIndex == 1 ? normalZ + 2 : normalZ
82+ return itemIndex == 1 ? normalZ + 2 : normalZ
84+ if (pushProgress > 0) {
73 return itemIndex
88 return itemIndex
76− readonly property real opacityMask: itemIndex == 1 ? MathUtils.linearAnimation(0, breakPoint, 0, 1, progress) : 1
91+ readonly property real opacityMask: (swipeProgress > 0 && itemIndex == 1) ? MathUtils.linearAnimation(0, breakPoint, 0, 1, progress) : 1
78 readonly property real animatedScale: progress < breakPoint ? 1 : MathUtils.linearAnimation(breakPoint, 1, 1, targetScale, progress)
93 readonly property real animatedScale: progress < breakPoint ? 1 : MathUtils.linearAnimation(breakPoint, 1, 1, targetScale, progress)