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
=== modified file 'qml/Stages/PhoneStage.qml'
--- qml/Stages/PhoneStage.qml 2016-01-14 13:03:20 +0000
+++ qml/Stages/PhoneStage.qml 2016-03-10 11:59:10 +0000
@@ -74,6 +74,12 @@
74 }74 }
75 }75 }
7676
77 function pushRightEdge(amount) {
78 if (spreadView.contentX == -spreadView.shift) {
79 edgeBarrier.push(amount);
80 }
81 }
82
77 mainApp: applicationManager.focusedApplicationId83 mainApp: applicationManager.focusedApplicationId
78 ? applicationManager.findApplication(applicationManager.focusedApplicationId)84 ? applicationManager.findApplication(applicationManager.focusedApplicationId)
79 : null85 : null
@@ -651,4 +657,31 @@
651 }657 }
652 }658 }
653 }659 }
660
661 EdgeBarrier {
662 id: edgeBarrier
663
664 // NB: it does its own positioning according to the specified edge
665 edge: Qt.RightEdge
666
667 onPassed: {
668 // Add 1 pixel to make sure we definitely hit positionMarker4 even with rounding errors of the animation.
669 snapAnimation.targetContentX = (root.width * spreadView.positionMarker4) + 1 - spreadView.shift;
670 snapAnimation.start();
671 }
672 material: Component {
673 Item {
674 Rectangle {
675 width: parent.height
676 height: parent.width
677 rotation: 90
678 anchors.centerIn: parent
679 gradient: Gradient {
680 GradientStop { position: 0.0; color: Qt.rgba(0.16,0.16,0.16,0.7)}
681 GradientStop { position: 1.0; color: Qt.rgba(0.16,0.16,0.16,0)}
682 }
683 }
684 }
685 }
686 }
654}687}
655688
=== modified file 'qml/Stages/TabletStage.qml'
--- qml/Stages/TabletStage.qml 2016-01-14 13:03:20 +0000
+++ qml/Stages/TabletStage.qml 2016-03-10 11:59:10 +0000
@@ -70,6 +70,12 @@
70 }70 }
71 }71 }
7272
73 function pushRightEdge(amount) {
74 if (spreadView.contentX == -spreadView.shift) {
75 edgeBarrier.push(amount);
76 }
77 }
78
73 orientationChangesEnabled: priv.mainAppOrientationChangesEnabled79 orientationChangesEnabled: priv.mainAppOrientationChangesEnabled
7480
75 supportedOrientations: mainApp ? mainApp.supportedOrientations81 supportedOrientations: mainApp ? mainApp.supportedOrientations
@@ -805,4 +811,31 @@
805 }811 }
806 }812 }
807 }813 }
814
815 EdgeBarrier {
816 id: edgeBarrier
817
818 // NB: it does its own positioning according to the specified edge
819 edge: Qt.RightEdge
820
821 onPassed: {
822 // Add 1 pixel to make sure we definitely hit positionMarker4 even with rounding errors of the animation.
823 snapAnimation.targetContentX = (root.width * spreadView.positionMarker4) + 1 - spreadView.shift;
824 snapAnimation.start();
825 }
826 material: Component {
827 Item {
828 Rectangle {
829 width: parent.height
830 height: parent.width
831 rotation: 90
832 anchors.centerIn: parent
833 gradient: Gradient {
834 GradientStop { position: 0.0; color: Qt.rgba(0.16,0.16,0.16,0.7)}
835 GradientStop { position: 1.0; color: Qt.rgba(0.16,0.16,0.16,0)}
836 }
837 }
838 }
839 }
840 }
808}841}
809842
=== modified file 'tests/qmltests/Stages/tst_PhoneStage.qml'
--- tests/qmltests/Stages/tst_PhoneStage.qml 2015-11-25 13:33:42 +0000
+++ tests/qmltests/Stages/tst_PhoneStage.qml 2016-03-10 11:59:10 +0000
@@ -40,12 +40,6 @@
40 orientations: Orientations {}40 orientations: Orientations {}
41 }41 }
4242
43 Binding {
44 target: ApplicationManager
45 property: "rightMargin"
46 value: phoneStage.anchors.rightMargin
47 }
48
49 Rectangle {43 Rectangle {
50 anchors { fill: parent; leftMargin: phoneStage.width }44 anchors { fill: parent; leftMargin: phoneStage.width }
5145
@@ -77,6 +71,15 @@
77 ApplicationManager.get(appList.selectedAppIndex).setState(ApplicationInfoInterface.Stopped);71 ApplicationManager.get(appList.selectedAppIndex).setState(ApplicationInfoInterface.Stopped);
78 }72 }
79 }73 }
74 EdgeBarrierControls {
75 id: edgeBarrierControls
76 text: "Drag here to pull out spread"
77 backgroundColor: "blue"
78 onDragged: { phoneStage.pushRightEdge(amount); }
79 Component.onCompleted: {
80 edgeBarrierControls.target = testCase.findChild(phoneStage, "edgeBarrierController");
81 }
82 }
80 }83 }
81 ListView {84 ListView {
82 id: appList85 id: appList
@@ -463,5 +466,15 @@
463466
464 tryCompare(delegate.application, "requestedState", ApplicationInfoInterface.RequestedRunning);467 tryCompare(delegate.application, "requestedState", ApplicationInfoInterface.RequestedRunning);
465 }468 }
469
470 function test_mouseEdgePush() {
471 var spreadView = findChild(phoneStage, "spreadView")
472 addApps(1);
473 mouseMove(phoneStage, phoneStage.width - 1, units.gu(10));
474 for (var i = 0; i < units.gu(10); i++) {
475 phoneStage.pushRightEdge(1);
476 }
477 tryCompare(spreadView, "phase", 2);
478 }
466 }479 }
467}480}
468481
=== modified file 'tests/qmltests/Stages/tst_TabletStage.qml'
--- tests/qmltests/Stages/tst_TabletStage.qml 2015-12-01 12:17:24 +0000
+++ tests/qmltests/Stages/tst_TabletStage.qml 2016-03-10 11:59:10 +0000
@@ -21,6 +21,7 @@
21import Unity.Application 0.121import Unity.Application 0.1
22import Unity.Test 0.122import Unity.Test 0.1
2323
24import ".."
24import "../../../qml/Stages"25import "../../../qml/Stages"
25import "../../../qml/Components"26import "../../../qml/Components"
2627
@@ -77,6 +78,15 @@
77 Column {78 Column {
78 anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }79 anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
79 spacing: units.gu(1)80 spacing: units.gu(1)
81 EdgeBarrierControls {
82 id: edgeBarrierControls
83 text: "Drag here to pull out spread"
84 backgroundColor: "blue"
85 onDragged: { tabletStageLoader.item.pushRightEdge(amount); }
86 Component.onCompleted: {
87 edgeBarrierControls.target = testCase.findChild(tabletStageLoader, "edgeBarrierController");
88 }
89 }
80 ApplicationCheckBox {90 ApplicationCheckBox {
81 id: webbrowserCheckBox91 id: webbrowserCheckBox
82 appId: "webbrowser-app"92 appId: "webbrowser-app"
@@ -365,6 +375,14 @@
365 tryCompare(webbrowserApp, "requestedState", ApplicationInfoInterface.RequestedRunning);375 tryCompare(webbrowserApp, "requestedState", ApplicationInfoInterface.RequestedRunning);
366 tryCompare(dialerApp, "requestedState", ApplicationInfoInterface.RequestedRunning);376 tryCompare(dialerApp, "requestedState", ApplicationInfoInterface.RequestedRunning);
367 }377 }
378
379 function test_mouseEdgePush() {
380 var spreadView = findChild(tabletStageLoader, "spreadView")
381 mouseMove(tabletStageLoader, tabletStageLoader.width - 1, units.gu(10));
382 for (var i = 0; i < units.gu(10); i++) {
383 tabletStageLoader.item.pushRightEdge(1);
384 }
385 tryCompare(spreadView, "phase", 2);
386 }
368 }387 }
369
370}388}

Subscribers

People subscribed via source and target branches