on xenial help sign in
add support for the right edge push barrier
481dd71Michael Zanetti
qml/Components/EdgeBarrier.qml+2
@@ -29,6 +29,8 @@ Item {
29 // Supported values are: Qt.LeftEdge, Qt.RightEdge
29 // Supported values are: Qt.LeftEdge, Qt.RightEdge
30 property int edge: Qt.LeftEdge
30 property int edge: Qt.LeftEdge
31
31
32+ readonly property alias progress: controller.progress
33+
32 property Item target: parent
34 property Item target: parent
33 function push(amount) { controller.push(amount); }
35 function push(amount) { controller.push(amount); }
34 signal passed()
36 signal passed()
qml/Stage/Stage.qml+15−10
@@ -34,9 +34,9 @@ AbstractStage {
34 function updateFocusedAppOrientation() { /* TODO */ }
34 function updateFocusedAppOrientation() { /* TODO */ }
35 function updateFocusedAppOrientationAnimated() { /* TODO */}
35 function updateFocusedAppOrientationAnimated() { /* TODO */}
36 function pushRightEdge(amount) {
36 function pushRightEdge(amount) {
37− if (spread.state === "") {
37+// if (state === "windowed" || state == "") {
38 edgeBarrier.push(amount);
38 edgeBarrier.push(amount);
39− }
39+// }
40 }
40 }
41 function closeFocusedDelegate() {
41 function closeFocusedDelegate() {
42 if (priv.focusedAppDelegate && !priv.focusedAppDelegate.isDash) {
42 if (priv.focusedAppDelegate && !priv.focusedAppDelegate.isDash) {
@@ -340,14 +340,14 @@ AbstractStage {
340 PropertyChanges { target: hoverMouseArea; enabled: true }
340 PropertyChanges { target: hoverMouseArea; enabled: true }
341 },
341 },
342 State {
342 State {
343− name: "stagedRightEdge"; when: rightEdgeDragArea.dragging && root.mode == "staged"
343+ name: "stagedRightEdge"; when: (rightEdgeDragArea.dragging || edgeBarrier.progress > 0) && root.mode == "staged"
344 },
344 },
345 State {
345 State {
346− name: "sideStagedRightEdge"; when: rightEdgeDragArea.dragging && root.mode == "stagedWithSideStage"
346+ name: "sideStagedRightEdge"; when: (rightEdgeDragArea.dragging || edgeBarrier.progress > 0) && root.mode == "stagedWithSideStage"
347// PropertyChanges { target: priv; nextInStack: priv.sideStageDelegate && priv.sideStageDelegate.itemIndex < 2 ? 2 : 1 }
347// PropertyChanges { target: priv; nextInStack: priv.sideStageDelegate && priv.sideStageDelegate.itemIndex < 2 ? 2 : 1 }
348 },
348 },
349 State {
349 State {
350− name: "windowedRightEdge"; when: rightEdgeDragArea.dragging && root.mode == "windowed"
350+ name: "windowedRightEdge"; when: (rightEdgeDragArea.dragging || edgeBarrier.progress > 0) && root.mode == "windowed"
351 },
351 },
352 State {
352 State {
353 name: "staged"; when: root.mode === "staged"
353 name: "staged"; when: root.mode === "staged"
@@ -932,7 +932,7 @@ AbstractStage {
932 when: (root.mode == "staged" || root.mode == "stagedWithSideStage") && (root.state == "sideStagedRightEdge" || root.state == "stagedRightEdge" || rightEdgeFocusAnimation.running || hidingAnimation.running)
932 when: (root.mode == "staged" || root.mode == "stagedWithSideStage") && (root.state == "sideStagedRightEdge" || root.state == "stagedRightEdge" || rightEdgeFocusAnimation.running || hidingAnimation.running)
933 PropertyChanges {
933 PropertyChanges {
934 target: stagedRightEdgeMaths
934 target: stagedRightEdgeMaths
935− progress: rightEdgeDragArea.progress
935+ progress: Math.max(edgeBarrier.progress, rightEdgeDragArea.progress)
936 }
936 }
937 PropertyChanges {
937 PropertyChanges {
938 target: appDelegate
938 target: appDelegate
@@ -955,10 +955,10 @@ AbstractStage {
955 },
955 },
956 State {
956 State {
957 name: "windowedRightEdge"
957 name: "windowedRightEdge"
958− when: root.mode == "windowed" && (root.state == "windowedRightEdge" || rightEdgeFocusAnimation.running || hidingAnimation.running)
958+ when: root.mode == "windowed" && (root.state == "windowedRightEdge" || rightEdgeFocusAnimation.running || hidingAnimation.running || edgeBarrier.progress > 0)
959 PropertyChanges {
959 PropertyChanges {
960 target: windowedRightEdgeMaths
960 target: windowedRightEdgeMaths
961− progress: rightEdgeDragArea.progress
961+ progress: Math.max(rightEdgeDragArea.progress, edgeBarrier.progress)
962 }
962 }
963 PropertyChanges {
963 PropertyChanges {
964 target: appDelegate
964 target: appDelegate
@@ -1439,7 +1439,12 @@ AbstractStage {
1439 // NB: it does its own positioning according to the specified edge
1439 // NB: it does its own positioning according to the specified edge
1440 edge: Qt.RightEdge
1440 edge: Qt.RightEdge
1441
1441
1442− onPassed: { spread.show(); }
1442+ onProgressChanged: {
1443+ if (progress > spreadItem.rightEdgeBreakPoint) {
1444+ priv.goneToSpread = true;
1445+ }
1446+ }
1447+
1443 material: Component {
1448 material: Component {
1444 Item {
1449 Item {
1445 Rectangle {
1450 Rectangle {
@@ -1533,7 +1538,7 @@ AbstractStage {
1533 property var gesturePoints: new Array()
1538 property var gesturePoints: new Array()
1534 property bool cancelled: false
1539 property bool cancelled: false
1535
1540
1536− property real progress: -touchPosition.x / root.width
1541+ property real progress: dragging ? -touchPosition.x / root.width : 0
1537
1542
1538 onTouchPositionChanged: {
1543 onTouchPositionChanged: {
1539 gesturePoints.push(touchPosition.x);
1544 gesturePoints.push(touchPosition.x);
tests/qmltests/CMakeLists.txt+1−1
@@ -87,7 +87,7 @@ add_unity8_qmltest(Panel/Indicators IndicatorsLight)
87add_unity8_qmltest(Panel/Indicators MenuItemFactory)
87add_unity8_qmltest(Panel/Indicators MenuItemFactory)
88add_unity8_qmltest(Panel/Indicators MessageMenuItemFactory)
88add_unity8_qmltest(Panel/Indicators MessageMenuItemFactory)
89add_unity8_qmltest(Stages ApplicationWindow)
89add_unity8_qmltest(Stages ApplicationWindow)
90−add_unity8_qmltest(Stages DesktopStage)
90+add_unity8_qmltest(Stage DesktopStage)
91add_unity8_qmltest(Stages PhoneStage)
91add_unity8_qmltest(Stages PhoneStage)
92add_unity8_qmltest(Stages SpreadDelegate)
92add_unity8_qmltest(Stages SpreadDelegate)
93add_unity8_qmltest(Stages SurfaceContainer)
93add_unity8_qmltest(Stages SurfaceContainer)
tests/qmltests/Stage/tst_DesktopStage.qml+2−2
@@ -24,7 +24,7 @@ import WindowManager 0.1
24import Utils 0.1
24import Utils 0.1
25
25
26import ".." // For EdgeBarrierControls
26import ".." // For EdgeBarrierControls
27−import "../../../qml/Stages"
27+import "../../../qml/Stage"
28import "../../../qml/Components"
28import "../../../qml/Components"
29import "../../../qml/Components/PanelState"
29import "../../../qml/Components/PanelState"
30
30
@@ -73,7 +73,7 @@ Item {
73
73
74 property bool itemDestroyed: false
74 property bool itemDestroyed: false
75 sourceComponent: Component {
75 sourceComponent: Component {
76− DesktopStage {
76+ Stage {
77 anchors.fill: parent
77 anchors.fill: parent
78 background: "../../../qml/graphics/tablet_background.jpg"
78 background: "../../../qml/graphics/tablet_background.jpg"
79 focus: true
79 focus: true