on xenial help sign in
move right edge push area up some levels so it can be used on top of the indicators
56c3b82Michael Zanetti
qml/Components/EdgeBarrierController.qml+1
@@ -34,6 +34,7 @@ MouseArea {
34
34
35 function push(amount) {
35 function push(amount) {
36 if (!root._containsMouse) {
36 if (!root._containsMouse) {
37+ console.warn("pushing right edge without mouse actually being at right edge!")
37 return;
38 return;
38 }
39 }
39
40
qml/Shell.qml+29−1
@@ -284,6 +284,7 @@ StyledItem {
284 applicationManager: ApplicationManager
284 applicationManager: ApplicationManager
285 topLevelSurfaceList: topLevelSurfaceList
285 topLevelSurfaceList: topLevelSurfaceList
286 inputMethodRect: inputMethod.visibleRect
286 inputMethodRect: inputMethod.visibleRect
287+ rightEdgePushProgress: rightEdgeBarrier.progress
287
288
288 property string usageScenario: shell.usageScenario === "phone" || greeter.hasLockedApp
289 property string usageScenario: shell.usageScenario === "phone" || greeter.hasLockedApp
289 ? "phone"
290 ? "phone"
@@ -660,6 +661,33 @@ StyledItem {
660 }
661 }
661 ]
662 ]
662 }
663 }
664+
665+ EdgeBarrier {
666+ id: rightEdgeBarrier
667+ enabled: !greeter.shown
668+
669+ // NB: it does its own positioning according to the specified edge
670+ edge: Qt.RightEdge
671+
672+ onPassed: {
673+ panel.indicators.hide()
674+ }
675+
676+ material: Component {
677+ Item {
678+ Rectangle {
679+ width: parent.height
680+ height: parent.width
681+ rotation: 90
682+ anchors.centerIn: parent
683+ gradient: Gradient {
684+ GradientStop { position: 0.0; color: Qt.rgba(0.16,0.16,0.16,0.5)}
685+ GradientStop { position: 1.0; color: Qt.rgba(0.16,0.16,0.16,0)}
686+ }
687+ }
688+ }
689+ }
690+ }
663 }
691 }
664
692
665 Dialogs {
693 Dialogs {
@@ -741,7 +769,7 @@ StyledItem {
741
769
742 onPushedRightBoundary: {
770 onPushedRightBoundary: {
743 if (buttons === Qt.NoButton) {
771 if (buttons === Qt.NoButton) {
744− stage.pushRightEdge(amount);
772+ rightEdgeBarrier.push(amount);
745 } else if (buttons === Qt.LeftButton && previewRectangle && previewRectangle.target.canBeMaximizedLeftRight) {
773 } else if (buttons === Qt.LeftButton && previewRectangle && previewRectangle.target.canBeMaximizedLeftRight) {
746 previewRectangle.maximizeRight(amount);
774 previewRectangle.maximizeRight(amount);
747 }
775 }
qml/Stage/Stage.qml+14−34
@@ -47,6 +47,7 @@ FocusScope {
47 property int leftMargin: 0
47 property int leftMargin: 0
48 property bool oskEnabled: false
48 property bool oskEnabled: false
49 property rect inputMethodRect
49 property rect inputMethodRect
50+ property real rightEdgePushProgress: 0
50
51
51 // Configuration
52 // Configuration
52 property string mode: "staged"
53 property string mode: "staged"
@@ -126,9 +127,6 @@ FocusScope {
126 // functions to be called from outside
127 // functions to be called from outside
127 function updateFocusedAppOrientation() { /* TODO */ }
128 function updateFocusedAppOrientation() { /* TODO */ }
128 function updateFocusedAppOrientationAnimated() { /* TODO */}
129 function updateFocusedAppOrientationAnimated() { /* TODO */}
129− function pushRightEdge(amount) {
130− edgeBarrier.push(amount);
131− }
132
130
133 function closeSpread() {
131 function closeSpread() {
134 priv.goneToSpread = false;
132 priv.goneToSpread = false;
@@ -140,6 +138,12 @@ FocusScope {
140 }
138 }
141 }
139 }
142
140
141+ onRightEdgePushProgressChanged: {
142+ if (rightEdgePushProgress >= 1) {
143+ priv.goneToSpread = true
144+ }
145+ }
146+
143 GSettings {
147 GSettings {
144 id: lifecycleExceptions
148 id: lifecycleExceptions
145 schema.id: "com.canonical.qtmir"
149 schema.id: "com.canonical.qtmir"
@@ -448,7 +452,7 @@ FocusScope {
448 PropertyChanges { target: wallpaper; visible: false }
452 PropertyChanges { target: wallpaper; visible: false }
449 },
453 },
450 State {
454 State {
451− name: "stagedRightEdge"; when: (rightEdgeDragArea.dragging || edgeBarrier.progress > 0) && root.mode == "staged"
455+ name: "stagedRightEdge"; when: (rightEdgeDragArea.dragging || rightEdgePushProgress > 0) && root.mode == "staged"
452 PropertyChanges {
456 PropertyChanges {
453 target: blurLayer;
457 target: blurLayer;
454 visible: true;
458 visible: true;
@@ -458,7 +462,7 @@ FocusScope {
458 }
462 }
459 },
463 },
460 State {
464 State {
461− name: "sideStagedRightEdge"; when: (rightEdgeDragArea.dragging || edgeBarrier.progress > 0) && root.mode == "stagedWithSideStage"
465+ name: "sideStagedRightEdge"; when: (rightEdgeDragArea.dragging || rightEdgePushProgress > 0) && root.mode == "stagedWithSideStage"
462 extend: "stagedRightEdge"
466 extend: "stagedRightEdge"
463 PropertyChanges {
467 PropertyChanges {
464 target: sideStage
468 target: sideStage
@@ -467,13 +471,13 @@ FocusScope {
467 }
471 }
468 },
472 },
469 State {
473 State {
470− name: "windowedRightEdge"; when: (rightEdgeDragArea.dragging || edgeBarrier.progress > 0) && root.mode == "windowed"
474+ name: "windowedRightEdge"; when: (rightEdgeDragArea.dragging || rightEdgePushProgress > 0) && root.mode == "windowed"
471 PropertyChanges {
475 PropertyChanges {
472 target: blurLayer;
476 target: blurLayer;
473 visible: true
477 visible: true
474 blurRadius: 32
478 blurRadius: 32
475 brightness: .65
479 brightness: .65
476− opacity: MathUtils.linearAnimation(spreadItem.rightEdgeBreakPoint, 1, 0, 1, Math.max(rightEdgeDragArea.dragging ? rightEdgeDragArea.progress : 0, edgeBarrier.progress))
480+ opacity: MathUtils.linearAnimation(spreadItem.rightEdgeBreakPoint, 1, 0, 1, Math.max(rightEdgeDragArea.dragging ? rightEdgeDragArea.progress : 0, rightEdgePushProgress))
477 }
481 }
478 },
482 },
479 State {
483 State {
@@ -1129,7 +1133,7 @@ FocusScope {
1129 when: (root.mode == "staged" || root.mode == "stagedWithSideStage") && (root.state == "sideStagedRightEdge" || root.state == "stagedRightEdge" || rightEdgeFocusAnimation.running || hidingAnimation.running)
1133 when: (root.mode == "staged" || root.mode == "stagedWithSideStage") && (root.state == "sideStagedRightEdge" || root.state == "stagedRightEdge" || rightEdgeFocusAnimation.running || hidingAnimation.running)
1130 PropertyChanges {
1134 PropertyChanges {
1131 target: stagedRightEdgeMaths
1135 target: stagedRightEdgeMaths
1132− progress: Math.max(edgeBarrier.progress, rightEdgeDragArea.draggedProgress)
1136+ progress: Math.max(rightEdgePushProgress, rightEdgeDragArea.draggedProgress)
1133 }
1137 }
1134 PropertyChanges {
1138 PropertyChanges {
1135 target: appDelegate
1139 target: appDelegate
@@ -1156,11 +1160,11 @@ FocusScope {
1156 },
1160 },
1157 State {
1161 State {
1158 name: "windowedRightEdge"
1162 name: "windowedRightEdge"
1159− when: root.mode == "windowed" && (root.state == "windowedRightEdge" || rightEdgeFocusAnimation.running || hidingAnimation.running || edgeBarrier.progress > 0)
1163+ when: root.mode == "windowed" && (root.state == "windowedRightEdge" || rightEdgeFocusAnimation.running || hidingAnimation.running || rightEdgePushProgress > 0)
1160 PropertyChanges {
1164 PropertyChanges {
1161 target: windowedRightEdgeMaths
1165 target: windowedRightEdgeMaths
1162 swipeProgress: rightEdgeDragArea.dragging ? rightEdgeDragArea.progress : 0
1166 swipeProgress: rightEdgeDragArea.dragging ? rightEdgeDragArea.progress : 0
1163− pushProgress: edgeBarrier.progress
1167+ pushProgress: rightEdgePushProgress
1164 }
1168 }
1165 PropertyChanges {
1169 PropertyChanges {
1166 target: appDelegate
1170 target: appDelegate
@@ -1675,30 +1679,6 @@ FocusScope {
1675 appContainerHeight: appContainer.height
1679 appContainerHeight: appContainer.height
1676 }
1680 }
1677
1681
1678− EdgeBarrier {
1679− id: edgeBarrier
1680−
1681− // NB: it does its own positioning according to the specified edge
1682− edge: Qt.RightEdge
1683−
1684− onPassed: priv.goneToSpread = true;
1685−
1686− material: Component {
1687− Item {
1688− Rectangle {
1689− width: parent.height
1690− height: parent.width
1691− rotation: 90
1692− anchors.centerIn: parent
1693− gradient: Gradient {
1694− GradientStop { position: 0.0; color: Qt.rgba(0.16,0.16,0.16,0.5)}
1695− GradientStop { position: 1.0; color: Qt.rgba(0.16,0.16,0.16,0)}
1696− }
1697− }
1698− }
1699− }
1700− }
1701−
1702 MouseArea {
1682 MouseArea {
1703 id: hoverMouseArea
1683 id: hoverMouseArea
1704 objectName: "hoverMouseArea"
1684 objectName: "hoverMouseArea"
tests/qmltests/tst_Shell.qml+49
@@ -2698,6 +2698,55 @@ Rectangle {
2698 tryCompareFunction(function() { return ApplicationManager.focusedApplicationId; }, "calendar-app");
2698 tryCompareFunction(function() { return ApplicationManager.focusedApplicationId; }, "calendar-app");
2699 }
2699 }
2700
2700
2701+ function test_rightEdgePushWithOpenIndicators() {
2702+ loadShell("desktop");
2703+ shell.usageScenario = "desktop";
2704+ waitForRendering(shell);
2705+ swipeAwayGreeter();
2706+
2707+ var stage = findChild(shell, "stage");
2708+ var cursor = findChild(shell, "cursor");
2709+ var indicators = findChild(shell, "indicators");
2710+
2711+ // Open indicators
2712+ var touchX = shell.width - units.gu(5);
2713+ touchFlick(shell,
2714+ touchX /* fromX */, indicators.minimizedPanelHeight * 0.5 /* fromY */,
2715+ touchX /* toX */, shell.height * 0.9 /* toY */,
2716+ true /* beginTouch */, true /* endTouch */);
2717+ tryCompare(indicators, "fullyOpened", true);
2718+
2719+ // push the right edge
2720+ mouseMove(shell, shell.width - 1, units.gu(10));
2721+ for (var i = 0; i < units.gu(10); i++) {
2722+ cursor.pushedRightBoundary(1, 0);
2723+ }
2724+ tryCompare(stage, "rightEdgePushProgress", 1);
2725+ tryCompare(stage, "state", "spread");
2726+ tryCompare(indicators, "fullyOpened", false);
2727+
2728+ mouseMove(shell, shell.width - units.gu(5), units.gu(10));
2729+
2730+ tryCompare(stage, "rightEdgePushProgress", 0);
2731+ }
2732+
2733+ function test_rightEdgePushOnGreeter() {
2734+ loadShell("desktop");
2735+ shell.usageScenario = "desktop";
2736+ waitForRendering(shell);
2737+
2738+ var stage = findChild(shell, "stage");
2739+ var cursor = findChild(shell, "cursor");
2740+
2741+ // push the right edge, but verify it doesn't emit any progress
2742+ mouseMove(shell, shell.width - 1, units.gu(10));
2743+ for (var i = 0; i < units.gu(10); i++) {
2744+ cursor.pushedRightBoundary(1, 0);
2745+ compare(stage.rightEdgePushProgress, 0);
2746+ }
2747+ compare(stage.rightEdgePushProgress, 0);
2748+ }
2749+
2701 function test_oskDisplacesWindow_data() {
2750 function test_oskDisplacesWindow_data() {
2702 return [
2751 return [
2703 {tag: "no need to displace", windowHeight: units.gu(10), windowY: units.gu(5), targetDisplacement: units.gu(5), oskEnabled: true},
2752 {tag: "no need to displace", windowHeight: units.gu(10), windowY: units.gu(5), targetDisplacement: units.gu(5), oskEnabled: true},