on xenial help sign in
fix switching to sideStaged mode from windowed
commitaaee5f4d0fd30886e5bfe16d73e500bce093d52d authorMichael Zanetti <michael.zanetti@canonical.com> dateTue 13 Sep 2016, 13:49 (10 years ago) parent6ac6068
1 file changed+6−27
qml/Stage/Stage.qml+6−27
qml/Stage/Stage.qml+6−27
@@ -34,9 +34,7 @@ AbstractStage {
3434 function updateFocusedAppOrientation() { /* TODO */ }
3535 function updateFocusedAppOrientationAnimated() { /* TODO */}
3636 function pushRightEdge(amount) {
37−// if (state === "windowed" || state == "") {
38− edgeBarrier.push(amount);
39−// }
37+ edgeBarrier.push(amount);
4038 }
4139 function closeFocusedDelegate() {
4240 if (priv.focusedAppDelegate && !priv.focusedAppDelegate.isDash) {
@@ -143,7 +141,6 @@ AbstractStage {
143141 property var focusedAppDelegate: null
144142 onFocusedAppDelegateChanged: {
145143 if (focusedAppDelegate && root.state == "spread") {
146− print("clsing spread because of focus change to", focusedAppDelegate.application.appId)
147144 goneToSpread = false;
148145 }
149146 }
@@ -206,7 +203,6 @@ AbstractStage {
206203 }
207204
208205 function updateMainAndSideStageIndexes() {
209−// print("updating stage indexes, sideStage shown:", sideStage.shown)
210206 if (root.mode != "stagedWithSideStage") {
211207 priv.sideStageDelegate = null;
212208 priv.sideStageItemId = 0;
@@ -225,7 +221,7 @@ AbstractStage {
225221
226222 for (var i = 0; i < appRepeater.count && (!choseMainStage || !choseSideStage); ++i) {
227223 var appDelegate = appRepeater.itemAt(i);
228− if (/*sideStage.shown && */appDelegate.stage == ApplicationInfoInterface.SideStage
224+ if (appDelegate.stage == ApplicationInfoInterface.SideStage
229225 && !choseSideStage) {
230226 priv.sideStageDelegate = appDelegate
231227 priv.sideStageItemId = root.topLevelSurfaceList.idAt(i);
@@ -248,14 +244,11 @@ AbstractStage {
248244 priv.sideStageItemId = 0;
249245 priv.sideStageAppId = "";
250246 }
251−
252− print("*** updated! MainStage:", priv.mainStageAppId, "SideStage:", priv.sideStageAppId)
253247 }
254248
255249 property int nextInStack: {
256250 var mainStageIndex = priv.mainStageDelegate ? priv.mainStageDelegate.itemIndex : -1;
257251 var sideStageIndex = priv.sideStageDelegate ? priv.sideStageDelegate.itemIndex : -1;
258−// print("calculating nextInStack:", mainStageIndex, sideStageIndex, priv.mainStageDelegate.itemIndex, priv.sideStageDelegate.itemIndex)
259252 if (sideStageIndex == -1) {
260253 return topLevelSurfaceList.count > 1 ? 1 : -1;
261254 }
@@ -378,7 +371,6 @@ AbstractStage {
378371 },
379372 State {
380373 name: "sideStagedRightEdge"; when: (rightEdgeDragArea.dragging || edgeBarrier.progress > 0) && root.mode == "stagedWithSideStage"
381−// PropertyChanges { target: priv; nextInStack: priv.sideStageDelegate && priv.sideStageDelegate.itemIndex < 2 ? 2 : 1 }
382374 },
383375 State {
384376 name: "windowedRightEdge"; when: (rightEdgeDragArea.dragging || edgeBarrier.progress > 0) && root.mode == "windowed"
@@ -389,7 +381,6 @@ AbstractStage {
389381 State {
390382 name: "stagedWithSideStage"; when: root.mode === "stagedWithSideStage"
391383 PropertyChanges { target: triGestureArea; enabled: true }
392−// PropertyChanges { target: priv; nextInStack: priv.sideStageDelegate && priv.sideStageDelegate.itemIndex < 2 ? 2 : 1 }
393384 PropertyChanges { target: sideStage; visible: true }
394385 },
395386 State {
@@ -427,6 +418,10 @@ AbstractStage {
427418 Transition {
428419 to: "stagedRightEdge"
429420 PropertyAction { target: floatingFlickable; property: "contentX"; value: 0 }
421+ },
422+ Transition {
423+ to: "stagedWithSideStage"
424+ ScriptAction { script: priv.updateMainAndSideStageIndexes(); }
430425 }
431426
432427 ]
@@ -510,27 +505,11 @@ AbstractStage {
510505 }
511506
512507 onShownChanged: {
513− print("sidestage shown changed:", shown)
514508 if (!shown && priv.mainStageDelegate) {
515− print("claiming focus 2")
516509 priv.mainStageDelegate.claimFocus();
517510 }
518511 }
519512
520−// onShownChanged: {
521−// if (!shown && priv.sideStageDelegate && priv.focusedAppDelegate === priv.sideStageDelegate) {
522−// priv.updateMainAndSideStageIndexes();
523−// if (priv.mainStageDelegate) {
524−// priv.mainStageDelegate.focus = true;
525−// }
526−// } else if (shown) {
527−// priv.updateMainAndSideStageIndexes();
528−// if (priv.sideStageDelegate) {
529−// priv.sideStageDelegate.focus = true;
530−// }
531−// }
532−// }
533−
534513 DropArea {
535514 id: sideStageDropArea
536515 objectName: "SideStageDropArea"