Merge lp:~mzanetti/unity8/fix-left-edge-on-spread into lp:unity8

Proposed by Michael Zanetti
Status: Merged
Approved by: Andrea Cimitan
Approved revision: 1464
Merged at revision: 1571
Proposed branch: lp:~mzanetti/unity8/fix-left-edge-on-spread
Merge into: lp:unity8
Diff against target: 77 lines (+28/-4)
3 files modified
qml/Stages/PhoneStage.qml (+2/-2)
qml/Stages/TabletStage.qml (+2/-2)
tests/qmltests/Stages/tst_PhoneStage.qml (+24/-0)
To merge this branch: bzr merge lp:~mzanetti/unity8/fix-left-edge-on-spread
Reviewer Review Type Date Requested Status
Andrea Cimitan (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+243400@code.launchpad.net

Commit message

fixes left edge drag when in spread

don't allow to drag an application to the left while in spread
always focus the dash on long left edge swipes

Description of the change

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

no

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

yes

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

yes

 * 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
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Andrea Cimitan (cimi) wrote :

Two nitpicks and can we test this?

review: Needs Fixing
1461. By Michael Zanetti

use === to make the reviewer happy

(both sides are ints, there's no difference between == and === here as implicit coercion doesn't happen here anyways)

1462. By Michael Zanetti

add a test

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

> Two nitpicks and can we test this?

fixed.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Andrea Cimitan (cimi) :
1463. By Michael Zanetti

simplify

Revision history for this message
Andrea Cimitan (cimi) wrote :

let's see if CI runs fine now

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1464. By Michael Zanetti

merge trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Andrea Cimitan (cimi) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
y
 * Did CI run pass? If not, please explain why.
another failure
 * Did you make sure that the branch does not contain spurious tags?
y

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 2014-12-01 13:22:12 +0000
3+++ qml/Stages/PhoneStage.qml 2015-01-12 12:50:49 +0000
4@@ -52,7 +52,7 @@
5 if (inverseProgress == 0 && priv.oldInverseProgress > 0) {
6 // left edge drag released. Minimum distance is given by design.
7 if (priv.oldInverseProgress > units.gu(22)) {
8- ApplicationManager.focusApplication("unity8-dash");
9+ ApplicationManager.requestFocusApplication("unity8-dash");
10 }
11 }
12 priv.oldInverseProgress = inverseProgress;
13@@ -299,7 +299,7 @@
14 x: {
15 // focused app is always positioned at 0 except when following left edge drag
16 if (index == 0) {
17- if (!isDash && root.inverseProgress > 0) {
18+ if (!isDash && root.inverseProgress > 0 && spreadView.phase === 0) {
19 return root.inverseProgress;
20 }
21 return 0;
22
23=== modified file 'qml/Stages/TabletStage.qml'
24--- qml/Stages/TabletStage.qml 2014-12-01 13:22:12 +0000
25+++ qml/Stages/TabletStage.qml 2015-01-12 12:50:49 +0000
26@@ -43,7 +43,7 @@
27 if (inverseProgress == 0 && priv.oldInverseProgress > 0) {
28 // left edge drag released. Minimum distance is given by design.
29 if (priv.oldInverseProgress > units.gu(22)) {
30- ApplicationManager.focusApplication("unity8-dash");
31+ ApplicationManager.requestFocusApplication("unity8-dash");
32 }
33 }
34 priv.oldInverseProgress = inverseProgress;
35@@ -492,7 +492,7 @@
36 interactive: !spreadView.interactive && spreadView.phase === 0 && root.interactive
37 swipeToCloseEnabled: spreadView.interactive && !snapAnimation.running
38 maximizedAppTopMargin: root.maximizedAppTopMargin
39- dragOffset: !isDash && model.appId == priv.mainStageAppId && root.inverseProgress > 0 ? root.inverseProgress : 0
40+ dragOffset: !isDash && model.appId == priv.mainStageAppId && root.inverseProgress > 0 && spreadView.phase === 0 ? root.inverseProgress : 0
41 application: ApplicationManager.get(index)
42 closeable: !isDash
43
44
45=== modified file 'tests/qmltests/Stages/tst_PhoneStage.qml'
46--- tests/qmltests/Stages/tst_PhoneStage.qml 2015-01-09 08:31:03 +0000
47+++ tests/qmltests/Stages/tst_PhoneStage.qml 2015-01-12 12:50:49 +0000
48@@ -394,5 +394,29 @@
49
50 tryCompare(spreadView, "contentX", -spreadView.shift)
51 }
52+
53+ function test_leftEdge_data() {
54+ return [
55+ { tag: "normal", inSpread: false, leftEdgeDragWidth: units.gu(5), shouldMoveApp: true },
56+ { tag: "inSpread", inSpread: true, leftEdgeDragWidth: units.gu(5), shouldMoveApp: false }
57+ ]
58+ }
59+
60+ function test_leftEdge(data) {
61+ addApps(2);
62+
63+ if (data.inSpread) {
64+ goToSpread();
65+ }
66+
67+ var focusedDelegate = findChild(phoneStage, "appDelegate0");
68+ phoneStage.inverseProgress = data.leftEdgeDragWidth;
69+
70+ tryCompare(focusedDelegate, "x", data.shouldMoveApp ? data.leftEdgeDragWidth : 0);
71+
72+ phoneStage.inverseProgress = 0;
73+
74+ tryCompare(focusedDelegate, "x", 0);
75+ }
76 }
77 }

Subscribers

People subscribed via source and target branches