on xenial help sign in
tune right edge push as per design request
commit28416b1db6c532eb1260db333e407f9eaf9d992f authorMichael Zanetti <michael.zanetti@canonical.com> dateWed 30 Nov 2016, 20:49 (10 years ago) parentc8c2543
2 files changed+22−6
qml/Stage/Spread/WindowedRightEdgeMaths.qml+19−4 qml/Stage/Stage.qml+3−2
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+ 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+3−2
@@ -473,7 +473,7 @@ FocusScope {
473473 visible: true
474474 blurRadius: 32
475475 brightness: .65
476− opacity: MathUtils.linearAnimation(spreadItem.rightEdgeBreakPoint, 1, 0, 1, Math.max(rightEdgeDragArea.progress, edgeBarrier.progress))
476+ opacity: MathUtils.linearAnimation(spreadItem.rightEdgeBreakPoint, 1, 0, 1, Math.max(rightEdgeDragArea.dragging ? rightEdgeDragArea.progress : 0, edgeBarrier.progress))
477477 }
478478 },
479479 State {
@@ -1159,7 +1159,8 @@ FocusScope {
11591159 when: root.mode == "windowed" && (root.state == "windowedRightEdge" || rightEdgeFocusAnimation.running || hidingAnimation.running || edgeBarrier.progress > 0)
11601160 PropertyChanges {
11611161 target: windowedRightEdgeMaths
1162− progress: Math.max(rightEdgeDragArea.progress, edgeBarrier.progress)
1162+ swipeProgress: rightEdgeDragArea.dragging ? rightEdgeDragArea.progress : 0
1163+ pushProgress: edgeBarrier.progress
11631164 }
11641165 PropertyChanges {
11651166 target: appDelegate