on xenial help sign in
fix scaling of fullscreen vs non-fullscreen apps in spread and their drop shadow
04b954cMichael Zanetti
qml/Stages/SpreadDelegate.qml+3−4
@@ -19,14 +19,15 @@
19import QtQuick 2.0
19import QtQuick 2.0
20import Mir.Application 0.1
20import Mir.Application 0.1
21import Ubuntu.Components 1.0
21import Ubuntu.Components 1.0
22+import "../Components"
22
23
23Item {
24Item {
24 id: root
25 id: root
25
26
26 signal clicked()
27 signal clicked()
27− property real topMarginProgress
28 property bool interactive: true
28 property bool interactive: true
29 property real maximizedAppTopMargin
29 property real maximizedAppTopMargin
30+ property bool isFullscreen: surface !== null && surface.anchors.topMargin == 0
30 property bool dropShadow: true
31 property bool dropShadow: true
31
32
32 // FIXME: This really should be invisible to QML code.
33 // FIXME: This really should be invisible to QML code.
@@ -112,7 +113,7 @@ Item {
112
113
113 BorderImage {
114 BorderImage {
114 id: dropShadowImage
115 id: dropShadowImage
115− anchors.fill: parent
116+ anchors.fill: surface
116 anchors.margins: -units.gu(2)
117 anchors.margins: -units.gu(2)
117 source: "graphics/dropshadow.png"
118 source: "graphics/dropshadow.png"
118 border { left: 50; right: 50; top: 50; bottom: 50 }
119 border { left: 50; right: 50; top: 50; bottom: 50 }
@@ -120,8 +121,6 @@ Item {
120 Behavior on opacity { UbuntuNumberAnimation {} }
121 Behavior on opacity { UbuntuNumberAnimation {} }
121 }
122 }
122
123
123− // This is used to get clicked events on the whole app. e.g. when in spreadView.
124− // It's only enabled when the surface is !interactive
125 MouseArea {
124 MouseArea {
126 anchors.fill: parent
125 anchors.fill: parent
127 z: 2
126 z: 2
qml/Stages/TransformedSpreadDelegate.qml+6−1
@@ -290,6 +290,7 @@ SpreadDelegate {
290
290
291 return easingCurve.value;
291 return easingCurve.value;
292 }
292 }
293+
293 }
294 }
294
295
295 transform: [
296 transform: [
@@ -303,12 +304,16 @@ SpreadDelegate {
303 xScale: priv.scale
304 xScale: priv.scale
304 yScale: xScale
305 yScale: xScale
305 },
306 },
307+ Scale {
308+ origin { x: 0; y: (spreadView.height * priv.scale) + maximizedAppTopMargin * 3 }
309+ xScale: 1
310+ yScale: isFullscreen? 1 - priv.topMarginProgress * maximizedAppTopMargin / spreadView.height : 1
311+ },
306 Translate {
312 Translate {
307 x: priv.xTranslate
313 x: priv.xTranslate
308 }
314 }
309 ]
315 ]
310 opacity: priv.opacity
316 opacity: priv.opacity
311− topMarginProgress: priv.topMarginProgress
312
317
313 EasingCurve {
318 EasingCurve {
314 id: easingCurve
319 id: easingCurve