on xenial help sign in
tune right edge push

make it less intrusive when accidentally hitting the edge with the mouse tweak visuals for the mouse case (LP: #1646094) Approved by: Unity8 CI Bot

commite828c8b2c4febbbed3360046596461670e866121 authorMichael Zanetti <michael.zanetti@canonical.com> dateWed 7 Dec 2016, 13:43 (10 years ago) parentfb0d4b4f0a6e21
2 files changed+21−5
qml/Stage/Spread/WindowedRightEdgeMaths.qml+19−4 qml/Stage/Stage.qml+2−1
qml/Stage/Spread/WindowedRightEdgeMaths.qml+19−4
@@ -25,21 +25,31 @@ QtObject {
2525 // Input
2626 property int itemIndex: 0
2727 property int normalZ: 0
28− property real progress: 0
2928 property int startWidth: 0
3029 property int startHeight: 0
3130 property int startX: 0
3231 property int targetX: 0
3332 property int startY: 0
3433 property int targetY: 0
35−// property real startAngle: 40
3634 property real targetAngle: 0
3735 property int targetHeight: 0
3836 property real targetScale: 0
37+ property real swipeProgress: 0
38+ property real pushProgress: 0
3939
4040 // Config
4141 property real breakPoint: 0.4
4242
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+
4353 // Output
4454
4555 readonly property real scaleToPreviewProgress: {
@@ -68,12 +78,17 @@ QtObject {
6878
6979 readonly property int animatedZ: {
7080 if (progress < breakPoint + (1 - breakPoint) / 2) {
71− return itemIndex == 1 ? normalZ + 2 : normalZ
81+ if (swipeProgress > 0) {
82+ return itemIndex == 1 ? normalZ + 2 : normalZ
83+ }
84+ if (pushProgress > 0) {
85+ return normalZ;
86+ }
7287 }
7388 return itemIndex
7489 }
7590
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
7792
7893 readonly property real animatedScale: progress < breakPoint ? 1 : MathUtils.linearAnimation(breakPoint, 1, 1, targetScale, progress)
7994
qml/Stage/Stage.qml+2−1
@@ -1161,7 +1161,8 @@ FocusScope {
11611161 when: root.mode == "windowed" && (root.state == "windowedRightEdge" || rightEdgeFocusAnimation.running || hidingAnimation.running || edgeBarrier.progress > 0)
11621162 PropertyChanges {
11631163 target: windowedRightEdgeMaths
1164− progress: Math.max(rightEdgeDragArea.dragging ? rightEdgeDragArea.progress : 0, edgeBarrier.progress)
1164+ swipeProgress: rightEdgeDragArea.dragging ? rightEdgeDragArea.progress : 0
1165+ pushProgress: edgeBarrier.progress
11651166 }
11661167 PropertyChanges {
11671168 target: appDelegate