Merge lp:~mzanetti/unity8/mouse-activated-staged-spreads into lp:unity8

Proposed by Michael Zanetti
Status: Merged
Approved by: Michael Zanetti
Approved revision: 2209
Merged at revision: 2235
Proposed branch: lp:~mzanetti/unity8/mouse-activated-staged-spreads
Merge into: lp:unity8
Prerequisite: lp:~mzanetti/unity8/launcher-sizing
Diff against target: 190 lines (+104/-7)
4 files modified
qml/Stages/PhoneStage.qml (+33/-0)
qml/Stages/TabletStage.qml (+33/-0)
tests/qmltests/Stages/tst_PhoneStage.qml (+19/-6)
tests/qmltests/Stages/tst_TabletStage.qml (+19/-1)
To merge this branch: bzr merge lp:~mzanetti/unity8/mouse-activated-staged-spreads
Reviewer Review Type Date Requested Status
Michael Zanetti (community) Approve
Unity8 CI Bot continuous-integration Pending
PS Jenkins bot continuous-integration Pending
Josh Arenson Pending
Review via email: mp+288628@code.launchpad.net

This proposal supersedes a proposal from 2016-02-25.

Commit message

Allow invoking the staged mode spreads by mouse right edge pushes too

Description of the change

The reason why this isn't in AbstractStage is because the spreads work too different between the staged and the windowed mode.

 * Are there any related MPs required for this MP to build/function as expected? Please list.

nope

 * Did you perform an exploratory manual test run of your code change and any related functionality?

yip yip

 * Did you make sure that your branch does not contain spurious tags?

yeeha

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?

N/A

 * If you changed the UI, has there been a design review?

N/A

To post a comment you must log in.
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

PASSED: Continuous integration, rev:2206
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/491/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/655
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay/218
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial/218
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/678
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/696
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/696
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/692
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/692/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/692
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/692/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/692
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/692/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/692
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/692/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/692
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/692/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/692
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/692/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/491/rebuild

review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:2206
http://jenkins.qa.ubuntu.com/job/unity8-ci/7420/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/6638
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/835/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/2125
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/828
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/2020
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/2020
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/827
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/826
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/5040
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6649
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6649/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27899
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/432/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/833
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/833/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27898

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/7420/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Josh Arenson (josharenson) wrote : Posted in a previous version of this proposal

Being nit-picky, but could you add parenthesis to your math (lines 30, 79)?
Otherwise, looks good and tests well.

review: Needs Fixing
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:2207
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/608/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/340
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial,testname=qmluitests.sh/340
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=autopilot.sh/340
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/799
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/815
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/815
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/813
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/813/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/813
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/813/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/813
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/813/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/813
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/813/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/813
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/813/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/813
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/813/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/608/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Josh Arenson (josharenson) wrote : Posted in a previous version of this proposal

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Yes

 * Did CI run pass?
It is "yellow"

 * Did you make sure that the branch does not contain spurious tags?
Yes, clean.

review: Approve
Revision history for this message
Michael Zanetti (mzanetti) wrote :

approving as per superseded

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Stages/PhoneStage.qml'
2--- qml/Stages/PhoneStage.qml 2016-01-14 13:03:20 +0000
3+++ qml/Stages/PhoneStage.qml 2016-03-10 11:59:10 +0000
4@@ -74,6 +74,12 @@
5 }
6 }
7
8+ function pushRightEdge(amount) {
9+ if (spreadView.contentX == -spreadView.shift) {
10+ edgeBarrier.push(amount);
11+ }
12+ }
13+
14 mainApp: applicationManager.focusedApplicationId
15 ? applicationManager.findApplication(applicationManager.focusedApplicationId)
16 : null
17@@ -651,4 +657,31 @@
18 }
19 }
20 }
21+
22+ EdgeBarrier {
23+ id: edgeBarrier
24+
25+ // NB: it does its own positioning according to the specified edge
26+ edge: Qt.RightEdge
27+
28+ onPassed: {
29+ // Add 1 pixel to make sure we definitely hit positionMarker4 even with rounding errors of the animation.
30+ snapAnimation.targetContentX = (root.width * spreadView.positionMarker4) + 1 - spreadView.shift;
31+ snapAnimation.start();
32+ }
33+ material: Component {
34+ Item {
35+ Rectangle {
36+ width: parent.height
37+ height: parent.width
38+ rotation: 90
39+ anchors.centerIn: parent
40+ gradient: Gradient {
41+ GradientStop { position: 0.0; color: Qt.rgba(0.16,0.16,0.16,0.7)}
42+ GradientStop { position: 1.0; color: Qt.rgba(0.16,0.16,0.16,0)}
43+ }
44+ }
45+ }
46+ }
47+ }
48 }
49
50=== modified file 'qml/Stages/TabletStage.qml'
51--- qml/Stages/TabletStage.qml 2016-01-14 13:03:20 +0000
52+++ qml/Stages/TabletStage.qml 2016-03-10 11:59:10 +0000
53@@ -70,6 +70,12 @@
54 }
55 }
56
57+ function pushRightEdge(amount) {
58+ if (spreadView.contentX == -spreadView.shift) {
59+ edgeBarrier.push(amount);
60+ }
61+ }
62+
63 orientationChangesEnabled: priv.mainAppOrientationChangesEnabled
64
65 supportedOrientations: mainApp ? mainApp.supportedOrientations
66@@ -805,4 +811,31 @@
67 }
68 }
69 }
70+
71+ EdgeBarrier {
72+ id: edgeBarrier
73+
74+ // NB: it does its own positioning according to the specified edge
75+ edge: Qt.RightEdge
76+
77+ onPassed: {
78+ // Add 1 pixel to make sure we definitely hit positionMarker4 even with rounding errors of the animation.
79+ snapAnimation.targetContentX = (root.width * spreadView.positionMarker4) + 1 - spreadView.shift;
80+ snapAnimation.start();
81+ }
82+ material: Component {
83+ Item {
84+ Rectangle {
85+ width: parent.height
86+ height: parent.width
87+ rotation: 90
88+ anchors.centerIn: parent
89+ gradient: Gradient {
90+ GradientStop { position: 0.0; color: Qt.rgba(0.16,0.16,0.16,0.7)}
91+ GradientStop { position: 1.0; color: Qt.rgba(0.16,0.16,0.16,0)}
92+ }
93+ }
94+ }
95+ }
96+ }
97 }
98
99=== modified file 'tests/qmltests/Stages/tst_PhoneStage.qml'
100--- tests/qmltests/Stages/tst_PhoneStage.qml 2015-11-25 13:33:42 +0000
101+++ tests/qmltests/Stages/tst_PhoneStage.qml 2016-03-10 11:59:10 +0000
102@@ -40,12 +40,6 @@
103 orientations: Orientations {}
104 }
105
106- Binding {
107- target: ApplicationManager
108- property: "rightMargin"
109- value: phoneStage.anchors.rightMargin
110- }
111-
112 Rectangle {
113 anchors { fill: parent; leftMargin: phoneStage.width }
114
115@@ -77,6 +71,15 @@
116 ApplicationManager.get(appList.selectedAppIndex).setState(ApplicationInfoInterface.Stopped);
117 }
118 }
119+ EdgeBarrierControls {
120+ id: edgeBarrierControls
121+ text: "Drag here to pull out spread"
122+ backgroundColor: "blue"
123+ onDragged: { phoneStage.pushRightEdge(amount); }
124+ Component.onCompleted: {
125+ edgeBarrierControls.target = testCase.findChild(phoneStage, "edgeBarrierController");
126+ }
127+ }
128 }
129 ListView {
130 id: appList
131@@ -463,5 +466,15 @@
132
133 tryCompare(delegate.application, "requestedState", ApplicationInfoInterface.RequestedRunning);
134 }
135+
136+ function test_mouseEdgePush() {
137+ var spreadView = findChild(phoneStage, "spreadView")
138+ addApps(1);
139+ mouseMove(phoneStage, phoneStage.width - 1, units.gu(10));
140+ for (var i = 0; i < units.gu(10); i++) {
141+ phoneStage.pushRightEdge(1);
142+ }
143+ tryCompare(spreadView, "phase", 2);
144+ }
145 }
146 }
147
148=== modified file 'tests/qmltests/Stages/tst_TabletStage.qml'
149--- tests/qmltests/Stages/tst_TabletStage.qml 2015-12-01 12:17:24 +0000
150+++ tests/qmltests/Stages/tst_TabletStage.qml 2016-03-10 11:59:10 +0000
151@@ -21,6 +21,7 @@
152 import Unity.Application 0.1
153 import Unity.Test 0.1
154
155+import ".."
156 import "../../../qml/Stages"
157 import "../../../qml/Components"
158
159@@ -77,6 +78,15 @@
160 Column {
161 anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
162 spacing: units.gu(1)
163+ EdgeBarrierControls {
164+ id: edgeBarrierControls
165+ text: "Drag here to pull out spread"
166+ backgroundColor: "blue"
167+ onDragged: { tabletStageLoader.item.pushRightEdge(amount); }
168+ Component.onCompleted: {
169+ edgeBarrierControls.target = testCase.findChild(tabletStageLoader, "edgeBarrierController");
170+ }
171+ }
172 ApplicationCheckBox {
173 id: webbrowserCheckBox
174 appId: "webbrowser-app"
175@@ -365,6 +375,14 @@
176 tryCompare(webbrowserApp, "requestedState", ApplicationInfoInterface.RequestedRunning);
177 tryCompare(dialerApp, "requestedState", ApplicationInfoInterface.RequestedRunning);
178 }
179+
180+ function test_mouseEdgePush() {
181+ var spreadView = findChild(tabletStageLoader, "spreadView")
182+ mouseMove(tabletStageLoader, tabletStageLoader.width - 1, units.gu(10));
183+ for (var i = 0; i < units.gu(10); i++) {
184+ tabletStageLoader.item.pushRightEdge(1);
185+ }
186+ tryCompare(spreadView, "phase", 2);
187+ }
188 }
189-
190 }

Subscribers

People subscribed via source and target branches