on xenial help sign in
fixes left edge drag when in spread
458bd19Michael Zanetti
qml/Stages/PhoneStage.qml+2−2
@@ -52,7 +52,7 @@ Rectangle {
52 if (inverseProgress == 0 && priv.oldInverseProgress > 0) {
52 if (inverseProgress == 0 && priv.oldInverseProgress > 0) {
53 // left edge drag released. Minimum distance is given by design.
53 // left edge drag released. Minimum distance is given by design.
54 if (priv.oldInverseProgress > units.gu(22)) {
54 if (priv.oldInverseProgress > units.gu(22)) {
55− ApplicationManager.focusApplication("unity8-dash");
55+ ApplicationManager.requestFocusApplication("unity8-dash");
56 }
56 }
57 }
57 }
58 priv.oldInverseProgress = inverseProgress;
58 priv.oldInverseProgress = inverseProgress;
@@ -299,7 +299,7 @@ Rectangle {
299 x: {
299 x: {
300 // focused app is always positioned at 0 except when following left edge drag
300 // focused app is always positioned at 0 except when following left edge drag
301 if (index == 0) {
301 if (index == 0) {
302− if (!isDash && root.inverseProgress > 0) {
302+ if (!isDash && root.inverseProgress > 0 && spreadView.phase === 0) {
303 return root.inverseProgress;
303 return root.inverseProgress;
304 }
304 }
305 return 0;
305 return 0;
qml/Stages/TabletStage.qml+2−2
@@ -43,7 +43,7 @@ Rectangle {
43 if (inverseProgress == 0 && priv.oldInverseProgress > 0) {
43 if (inverseProgress == 0 && priv.oldInverseProgress > 0) {
44 // left edge drag released. Minimum distance is given by design.
44 // left edge drag released. Minimum distance is given by design.
45 if (priv.oldInverseProgress > units.gu(22)) {
45 if (priv.oldInverseProgress > units.gu(22)) {
46− ApplicationManager.focusApplication("unity8-dash");
46+ ApplicationManager.requestFocusApplication("unity8-dash");
47 }
47 }
48 }
48 }
49 priv.oldInverseProgress = inverseProgress;
49 priv.oldInverseProgress = inverseProgress;
@@ -492,7 +492,7 @@ Rectangle {
492 interactive: !spreadView.interactive && spreadView.phase === 0 && root.interactive
492 interactive: !spreadView.interactive && spreadView.phase === 0 && root.interactive
493 swipeToCloseEnabled: spreadView.interactive && !snapAnimation.running
493 swipeToCloseEnabled: spreadView.interactive && !snapAnimation.running
494 maximizedAppTopMargin: root.maximizedAppTopMargin
494 maximizedAppTopMargin: root.maximizedAppTopMargin
495− dragOffset: !isDash && model.appId == priv.mainStageAppId && root.inverseProgress > 0 ? root.inverseProgress : 0
495+ dragOffset: !isDash && model.appId == priv.mainStageAppId && root.inverseProgress > 0 && spreadView.phase === 0 ? root.inverseProgress : 0
496 application: ApplicationManager.get(index)
496 application: ApplicationManager.get(index)
497 closeable: !isDash
497 closeable: !isDash
498
498
tests/qmltests/Stages/tst_PhoneStage.qml+24
@@ -394,5 +394,29 @@ Item {
394
394
395 tryCompare(spreadView, "contentX", -spreadView.shift)
395 tryCompare(spreadView, "contentX", -spreadView.shift)
396 }
396 }
397+
398+ function test_leftEdge_data() {
399+ return [
400+ { tag: "normal", inSpread: false, leftEdgeDragWidth: units.gu(5), shouldMoveApp: true },
401+ { tag: "inSpread", inSpread: true, leftEdgeDragWidth: units.gu(5), shouldMoveApp: false }
402+ ]
403+ }
404+
405+ function test_leftEdge(data) {
406+ addApps(2);
407+
408+ if (data.inSpread) {
409+ goToSpread();
410+ }
411+
412+ var focusedDelegate = findChild(phoneStage, "appDelegate0");
413+ phoneStage.inverseProgress = data.leftEdgeDragWidth;
414+
415+ tryCompare(focusedDelegate, "x", data.shouldMoveApp ? data.leftEdgeDragWidth : 0);
416+
417+ phoneStage.inverseProgress = 0;
418+
419+ tryCompare(focusedDelegate, "x", 0);
420+ }
397 }
421 }
398}
422}