on xenial help sign in
tune right edge push
e828c8bMichael Zanetti
qml/Stage/Spread/WindowedRightEdgeMaths.qml+19−4
@@ -25,21 +25,31 @@ QtObject {
25 // Input
25 // Input
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
39
39
40 // Config
40 // Config
41 property real breakPoint: 0.4
41 property real breakPoint: 0.4
42
42
43+ // internal
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)
48+ } else {
49+ return swipeProgress;
50+ }
51+ }
52+
43 // Output
53 // Output
44
54
45 readonly property real scaleToPreviewProgress: {
55 readonly property real scaleToPreviewProgress: {
@@ -68,12 +78,17 @@ QtObject {
68
78
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
83+ }
84+ if (pushProgress > 0) {
85+ return normalZ;
86+ }
72 }
87 }
73 return itemIndex
88 return itemIndex
74 }
89 }
75
90
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
77
92
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)
79
94
qml/Stage/Stage.qml+2−1
@@ -1161,7 +1161,8 @@ FocusScope {
1161 when: root.mode == "windowed" && (root.state == "windowedRightEdge" || rightEdgeFocusAnimation.running || hidingAnimation.running || edgeBarrier.progress > 0)
1161 when: root.mode == "windowed" && (root.state == "windowedRightEdge" || rightEdgeFocusAnimation.running || hidingAnimation.running || edgeBarrier.progress > 0)
1162 PropertyChanges {
1162 PropertyChanges {
1163 target: windowedRightEdgeMaths
1163 target: windowedRightEdgeMaths
1164− progress: Math.max(rightEdgeDragArea.dragging ? rightEdgeDragArea.progress : 0, edgeBarrier.progress)
1164+ swipeProgress: rightEdgeDragArea.dragging ? rightEdgeDragArea.progress : 0
1165+ pushProgress: edgeBarrier.progress
1165 }
1166 }
1166 PropertyChanges {
1167 PropertyChanges {
1167 target: appDelegate
1168 target: appDelegate