on xenial help sign in
Ensure that windows in the spread stack perfectly on the left of the spread
56ea30aDaniel d'Andrada
qml/Stages/SpreadDelegate.qml+1
@@ -30,6 +30,7 @@ FocusScope {
30 signal clicked()
30 signal clicked()
31 signal closed()
31 signal closed()
32 readonly property alias appWindowOrientationAngle: appWindowWithShadow.orientationAngle
32 readonly property alias appWindowOrientationAngle: appWindowWithShadow.orientationAngle
33+ readonly property alias appWindowRotation: appWindowWithShadow.rotation
33 readonly property alias orientationChangesEnabled: appWindow.orientationChangesEnabled
34 readonly property alias orientationChangesEnabled: appWindow.orientationChangesEnabled
34
35
35 // to be set from outside
36 // to be set from outside
qml/Stages/TransformedSpreadDelegate.qml+62−4
@@ -298,7 +298,6 @@ SpreadDelegate {
298
298
299 return easingCurve.value;
299 return easingCurve.value;
300 }
300 }
301−
302 }
301 }
303
302
304 transform: [
303 transform: [
@@ -307,11 +306,70 @@ SpreadDelegate {
307 axis { x: 0; y: 1; z: 0 }
306 axis { x: 0; y: 1; z: 0 }
308 angle: priv.angle
307 angle: priv.angle
309 },
308 },
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+ },
310 Scale {
319 Scale {
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+ }
311− origin { x: 0; y: spreadView.height }
336+ y: spreadView.height
337+ }
338+
312− xScale: 1
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) {
313− yScale: fullscreen ? 1 - priv.topMarginProgress * maximizedAppTopMargin / spreadView.height : 1
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+ }
314 },
371 },
372+
315 Scale {
373 Scale {
316 origin { x: 0; y: spreadView.height / 2 }
374 origin { x: 0; y: spreadView.height / 2 }
317 xScale: priv.scale
375 xScale: priv.scale