on xenial help sign in
Ensure that windows in the spread stack perfectly on the left of the spread
commit56ea30abafad845cf12618ebf1b4a9ef9bdcb1df authorDaniel d'Andrada <daniel.dandrada@canonical.com> dateWed 22 Apr 2015, 14:44 (11 years ago) parent338f354
2 files changed+63−4
qml/Stages/SpreadDelegate.qml+1 qml/Stages/TransformedSpreadDelegate.qml+62−4
qml/Stages/SpreadDelegate.qml+1
@@ -30,6 +30,7 @@ FocusScope {
3030 signal clicked()
3131 signal closed()
3232 readonly property alias appWindowOrientationAngle: appWindowWithShadow.orientationAngle
33+ readonly property alias appWindowRotation: appWindowWithShadow.rotation
3334 readonly property alias orientationChangesEnabled: appWindow.orientationChangesEnabled
3435
3536 // to be set from outside
qml/Stages/TransformedSpreadDelegate.qml+62−4
@@ -298,7 +298,6 @@ SpreadDelegate {
298298
299299 return easingCurve.value;
300300 }
301−
302301 }
303302
304303 transform: [
@@ -307,11 +306,70 @@ SpreadDelegate {
307306 axis { x: 0; y: 1; z: 0 }
308307 angle: priv.angle
309308 },
309+
310+ // The next two transformations are to ensure that fullscreen and rotated
311+ // windows all have the same size and position as an unrotated (0 degrees)
312+ // non-fullscreen window when they're stacked on top of each other on the
313+ // far left of the spread.
314+ Translate {
315+ y: !fullscreen && Math.abs(appWindowRotation) === 180
316+ ? priv.topMarginProgress * maximizedAppTopMargin
317+ : 0
318+ },
310319 Scale {
311− origin { x: 0; y: spreadView.height }
312− xScale: 1
313− yScale: fullscreen ? 1 - priv.topMarginProgress * maximizedAppTopMargin / spreadView.height : 1
320+ origin {
321+ x: {
322+ switch (appWindowRotation) {
323+ case 0:
324+ return 0;
325+ break;
326+ case 90:
327+ return 0;
328+ break;
329+ case 270:
330+ return spreadView.width;
331+ break;
332+ default: // 180
333+ return 0;
334+ }
335+ }
336+ y: spreadView.height
337+ }
338+
339+ xScale: {
340+ switch (appWindowRotation) {
341+ case 90:
342+ case 270:
343+ if (fullscreen) {
344+ return 1;
345+ } else {
346+ return 1 + priv.topMarginProgress * maximizedAppTopMargin / spreadView.width;
347+ }
348+ break;
349+ default:
350+ return 1;
351+ }
352+ }
353+
354+ yScale: {
355+ switch (appWindowRotation) {
356+ case 0:
357+ if (fullscreen) {
358+ return 1 - priv.topMarginProgress * maximizedAppTopMargin / spreadView.height;
359+ } else {
360+ return 1;
361+ }
362+ break;
363+ case 90:
364+ case 270:
365+ return 1 - priv.topMarginProgress * maximizedAppTopMargin / spreadView.height;
366+ break;
367+ default:
368+ return 1;
369+ }
370+ }
314371 },
372+
315373 Scale {
316374 origin { x: 0; y: spreadView.height / 2 }
317375 xScale: priv.scale