on xenial help sign in
fix scaling of fullscreen vs non-fullscreen apps in spread and their drop shadow
commit04b954c90cfecca4d285aad428a52fd8a9dd4d2a authorMichael Zanetti <michael.zanetti@canonical.com> dateTue 24 Jun 2014, 15:31 (12 years ago) parent030cf62
2 files changed+9−5
qml/Stages/SpreadDelegate.qml+3−4 qml/Stages/TransformedSpreadDelegate.qml+6−1
qml/Stages/SpreadDelegate.qml+3−4
@@ -19,14 +19,15 @@
1919import QtQuick 2.0
2020import Mir.Application 0.1
2121import Ubuntu.Components 1.0
22+import "../Components"
2223
2324Item {
2425 id: root
2526
2627 signal clicked()
27− property real topMarginProgress
2828 property bool interactive: true
2929 property real maximizedAppTopMargin
30+ property bool isFullscreen: surface !== null && surface.anchors.topMargin == 0
3031 property bool dropShadow: true
3132
3233 // FIXME: This really should be invisible to QML code.
@@ -112,7 +113,7 @@ Item {
112113
113114 BorderImage {
114115 id: dropShadowImage
115− anchors.fill: parent
116+ anchors.fill: surface
116117 anchors.margins: -units.gu(2)
117118 source: "graphics/dropshadow.png"
118119 border { left: 50; right: 50; top: 50; bottom: 50 }
@@ -120,8 +121,6 @@ Item {
120121 Behavior on opacity { UbuntuNumberAnimation {} }
121122 }
122123
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
125124 MouseArea {
126125 anchors.fill: parent
127126 z: 2
qml/Stages/TransformedSpreadDelegate.qml+6−1
@@ -290,6 +290,7 @@ SpreadDelegate {
290290
291291 return easingCurve.value;
292292 }
293+
293294 }
294295
295296 transform: [
@@ -303,12 +304,16 @@ SpreadDelegate {
303304 xScale: priv.scale
304305 yScale: xScale
305306 },
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+ },
306312 Translate {
307313 x: priv.xTranslate
308314 }
309315 ]
310316 opacity: priv.opacity
311− topMarginProgress: priv.topMarginProgress
312317
313318 EasingCurve {
314319 id: easingCurve