on xenial help sign in
sync progress for tablet right edge from trunk
28eaf6cMichael Zanetti
qml/Stages/TabletStage.qml+6−5
@@ -226,8 +226,8 @@ Item {
226 snapAnimation.start();
226 snapAnimation.start();
227 } else if (contentX < phase1Width) {
227 } else if (contentX < phase1Width) {
228 snapTo(1)
228 snapTo(1)
229− } else if (contentX < phase1Width + units.gu(5)) {
229+// } else if (contentX < phase1Width + units.gu(5)) {
230− snapTo(1)
230+// snapTo(1)
231 } else {
231 } else {
232 // Add 1 pixel to make sure we definitely hit positionMarker4 even with rounding errors of the animation.
232 // Add 1 pixel to make sure we definitely hit positionMarker4 even with rounding errors of the animation.
233 snapAnimation.targetContentX = spreadView.width * spreadView.positionMarker4 + 1;
233 snapAnimation.targetContentX = spreadView.width * spreadView.positionMarker4 + 1;
@@ -246,7 +246,6 @@ Item {
246 // We don't want to really reorder them in the model because that allows us to keep track
246 // We don't want to really reorder them in the model because that allows us to keep track
247 // of the last focused order.
247 // of the last focused order.
248 function indexToZIndex(index) {
248 function indexToZIndex(index) {
249− print("zindex asked", index)
250 var app = ApplicationManager.get(index);
249 var app = ApplicationManager.get(index);
251 var isActive = app.appId == priv.mainStageAppId || app.appId == priv.sideStageAppId;
250 var isActive = app.appId == priv.mainStageAppId || app.appId == priv.sideStageAppId;
252 if (isActive && app.stage == ApplicationInfoInterface.MainStage) return 0;
251 if (isActive && app.stage == ApplicationInfoInterface.MainStage) return 0;
@@ -478,12 +477,14 @@ Item {
478 // no matter if we didn't cross positionMarker1 yet.
477 // no matter if we didn't cross positionMarker1 yet.
479 spreadView.snapTo(spreadView.nextInStack);
478 spreadView.snapTo(spreadView.nextInStack);
480 } else if (!dragging && attachedToView) {
479 } else if (!dragging && attachedToView) {
481− if (spreadView.contentX / spreadView.width < spreadView.positionMarker1) {
480+ if (spreadView.contentX < spreadView.width * spreadView.positionMarker1) {
482 spreadView.snap();
481 spreadView.snap();
482+ } else if (spreadView.contentX < spreadView.width * spreadView.positionMarker2) {
483+ spreadView.snapTo(spreadView.nextInStack)
483 } else {
484 } else {
484 // otherwise snap to the closest snap position we can find
485 // otherwise snap to the closest snap position we can find
485 // (might be back to start, to app 1 or to spread)
486 // (might be back to start, to app 1 or to spread)
486− spreadView.snapTo(spreadView.nextInStack);
487+ spreadView.snap();
487 }
488 }
488 }
489 }
489 }
490 }
qml/Stages/TransformedTabletSpreadDelegate.qml+16−6
@@ -142,10 +142,15 @@ SpreadDelegate {
142 }
142 }
143 }
143 }
144
144
145+ // The tile should move a bit to the left if a new one comes on top of it, but not for the Side Stage and not
146+ // when we're only dragging the side stage in on top of a main stage app
147+ var shouldMoveAway = priv.movedActive && model.stage === ApplicationInfoInterface.MainStage &&
148+ ApplicationManager.get(spreadView.nextInStack).stage === ApplicationInfoInterface.MainStage
149+
145 if (active) {
150 if (active) {
146 newTranslate -= root.width
151 newTranslate -= root.width
147−// print("nextZ", spreadView.nextZInStack, "this z", root.zIndex, index, root.animatedProgress)
152+ // Only do the hide animation for active apps in the mainstage, and not if we only drag the ss in
148− if (spreadView.phase == 0 && priv.movedActive) {
153+ if (spreadView.phase == 0 && shouldMoveAway) {
149 newTranslate += linearAnimation(0, spreadView.positionMarker2, 0, -units.gu(4), root.animatedProgress)
154 newTranslate += linearAnimation(0, spreadView.positionMarker2, 0, -units.gu(4), root.animatedProgress)
150 }
155 }
151 }
156 }
@@ -169,7 +174,6 @@ SpreadDelegate {
169 if (nextInStack) {
174 if (nextInStack) {
170 if (model.stage == ApplicationInfoInterface.MainStage) {
175 if (model.stage == ApplicationInfoInterface.MainStage) {
171 var startValue = -spreadView.sideStageWidth * spreadView.snapPosition + (spreadView.sideStageVisible ? -spreadView.sideStageWidth : 0)
176 var startValue = -spreadView.sideStageWidth * spreadView.snapPosition + (spreadView.sideStageVisible ? -spreadView.sideStageWidth : 0)
172−// var endValue = -spreadView.width + spreadView.width * root.zIndex / 6;
173 newTranslate += linearAnimation(spreadView.positionMarker2, spreadView.positionMarker4, startValue, priv.phase2StartTranslate, root.animatedProgress);
177 newTranslate += linearAnimation(spreadView.positionMarker2, spreadView.positionMarker4, startValue, priv.phase2StartTranslate, root.animatedProgress);
174 } else {
178 } else {
175 var endValue = -spreadView.width + spreadView.width * root.zIndex / 6;
179 var endValue = -spreadView.width + spreadView.width * root.zIndex / 6;
@@ -182,7 +186,7 @@ SpreadDelegate {
182 } else if (root.active) {
186 } else if (root.active) {
183 var startProgress = spreadView.positionMarker2 - (zIndex * spreadView.positionMarker2 / 2)
187 var startProgress = spreadView.positionMarker2 - (zIndex * spreadView.positionMarker2 / 2)
184 var endProgress = spreadView.positionMarker4 - (zIndex * spreadView.tileDistance / spreadView.width)
188 var endProgress = spreadView.positionMarker4 - (zIndex * spreadView.tileDistance / spreadView.width)
185− var startTranslate = -root.width + (priv.movedActive ? -units.gu(4) : 0)
189+ var startTranslate = -root.width + (shouldMoveAway ? -units.gu(4) : 0)
186 newTranslate = linearAnimation(startProgress, endProgress, startTranslate, priv.phase2StartTranslate, root.progress);
190 newTranslate = linearAnimation(startProgress, endProgress, startTranslate, priv.phase2StartTranslate, root.progress);
187 } else {
191 } else {
188 var startProgress = spreadView.positionMarker2 - (zIndex * spreadView.positionMarker2 / 2)
192 var startProgress = spreadView.positionMarker2 - (zIndex * spreadView.positionMarker2 / 2)
@@ -250,15 +254,20 @@ SpreadDelegate {
250 return linearAnimation(selectedProgress, negativeProgress, selectedAngle, 0, root.progress)
254 return linearAnimation(selectedProgress, negativeProgress, selectedAngle, 0, root.progress)
251 }
255 }
252
256
257+ // The tile should rotate a bit when another one comes on top, but not when only dragging the side stage in
258+ var shouldMoveAway = movedActive && (ApplicationManager.get(spreadView.nextInStack).stage === ApplicationInfoInterface.MainStage || model.stage == ApplicationInfoInterface.SideStage)
259+
253 if (spreadView.phase == 0) {
260 if (spreadView.phase == 0) {
254 if (nextInStack) {
261 if (nextInStack) {
255 if (model.stage == ApplicationInfoInterface.SideStage && !spreadView.sideStageVisible) {
262 if (model.stage == ApplicationInfoInterface.SideStage && !spreadView.sideStageVisible) {
256 return 0;
263 return 0;
257 } else {
264 } else {
258−// print("return angle for index", root.zIndex, linearAnimation(0, spreadView.positionMarker2, root.startAngle, root.startAngle * (1-spreadView.snapPosition), root.animatedProgress))
259 return linearAnimation(0, spreadView.positionMarker2, root.startAngle, root.startAngle * (1-spreadView.snapPosition), root.animatedProgress)
265 return linearAnimation(0, spreadView.positionMarker2, root.startAngle, root.startAngle * (1-spreadView.snapPosition), root.animatedProgress)
260 }
266 }
261 }
267 }
268+ if (shouldMoveAway) {
269+ return linearAnimation(0, spreadView.positionMarker2, 0, root.startAngle * (1-spreadView.snapPosition), root.animatedProgress)
270+ }
262 }
271 }
263 if (spreadView.phase == 1) {
272 if (spreadView.phase == 1) {
264 if (nextInStack) {
273 if (nextInStack) {
@@ -270,7 +279,8 @@ SpreadDelegate {
270 }
279 }
271 var startProgress = spreadView.positionMarker2 - (zIndex * spreadView.positionMarker2 / 2)
280 var startProgress = spreadView.positionMarker2 - (zIndex * spreadView.positionMarker2 / 2)
272 var endProgress = spreadView.positionMarker4 - (zIndex * spreadView.tileDistance / spreadView.width)
281 var endProgress = spreadView.positionMarker4 - (zIndex * spreadView.tileDistance / spreadView.width)
282+ var startAngle = shouldMoveAway ? root.startAngle * (1-spreadView.snapPosition) : 0
273− return linearAnimation(startProgress, endProgress, 0, priv.phase2StartAngle, root.progress)
283+ return linearAnimation(startProgress, endProgress, startAngle, priv.phase2StartAngle, root.progress)
274 }
284 }
275 if (spreadView.phase == 2) {
285 if (spreadView.phase == 2) {
276 return root.startAngle - easingCurve.value * (root.startAngle - root.endAngle);
286 return root.startAngle - easingCurve.value * (root.startAngle - root.endAngle);