on xenial help sign in
hide dropshadow when not in spread
8a0809dMichael Zanetti
qml/Stages/PhoneStage.qml+1
@@ -243,6 +243,7 @@ Rectangle {
243 otherSelected: spreadView.selectedIndex >= 0 && !selected
243 otherSelected: spreadView.selectedIndex >= 0 && !selected
244 interactive: !spreadView.interactive
244 interactive: !spreadView.interactive
245 maximizedAppTopMargin: root.maximizedAppTopMargin
245 maximizedAppTopMargin: root.maximizedAppTopMargin
246+ dropShadow: spreadView.shiftedContentX > 0 || spreadDragArea.status == DirectionalDragArea.Undecided
246
247
247 z: index
248 z: index
248 x: index == 0 ? 0 : spreadView.width + (index - 1) * spreadView.tileDistance
249 x: index == 0 ? 0 : spreadView.width + (index - 1) * spreadView.tileDistance
qml/Stages/SpreadDelegate.qml+5−2
@@ -18,6 +18,7 @@
18
18
19import QtQuick 2.0
19import QtQuick 2.0
20import Mir.Application 0.1
20import Mir.Application 0.1
21+import Ubuntu.Components 1.0
21
22
22Item {
23Item {
23 id: root
24 id: root
@@ -27,6 +28,7 @@ Item {
27 property bool interactive: true
28 property bool interactive: true
28 property real maximizedAppTopMargin
29 property real maximizedAppTopMargin
29 property var application: ApplicationManager.get(index)
30 property var application: ApplicationManager.get(index)
31+ property bool dropShadow: true
30
32
31 // FIXME: This really should be invisible to QML code.
33 // FIXME: This really should be invisible to QML code.
32 // e.g. Create a SurfaceItem {} in C++ which we just use without any imperative hacks.
34 // e.g. Create a SurfaceItem {} in C++ which we just use without any imperative hacks.
@@ -82,12 +84,13 @@ Item {
82 ]
84 ]
83
85
84 BorderImage {
86 BorderImage {
85− id: dropShadow
87+ id: dropShadowImage
86 anchors.fill: surface
88 anchors.fill: surface
87 anchors.margins: -units.gu(2)
89 anchors.margins: -units.gu(2)
88 source: "graphics/dropshadow.png"
90 source: "graphics/dropshadow.png"
89− opacity: .4
90 border { left: 50; right: 50; top: 50; bottom: 50 }
91 border { left: 50; right: 50; top: 50; bottom: 50 }
92+ opacity: root.dropShadow ? .4 : 0
93+ Behavior on opacity { UbuntuNumberAnimation {} }
91 }
94 }
92
95
93 // This is used to get clicked events on the whole app. e.g. when in spreadView.
96 // This is used to get clicked events on the whole app. e.g. when in spreadView.
qml/Stages/TabletStage.qml+3−1
@@ -347,6 +347,7 @@ Item {
347 isInSideStage: priv.sideStageAppId == model.appId
347 isInSideStage: priv.sideStageAppId == model.appId
348 interactive: !spreadView.interactive
348 interactive: !spreadView.interactive
349 maximizedAppTopMargin: root.maximizedAppTopMargin
349 maximizedAppTopMargin: root.maximizedAppTopMargin
350+ dropShadow: spreadView.contentX > 0 || spreadDragArea.status == DirectionalDragArea.Undecided
350
351
351 progress: {
352 progress: {
352 var tileProgress = (spreadView.contentX - zIndex * spreadView.tileDistance) / spreadView.width;
353 var tileProgress = (spreadView.contentX - zIndex * spreadView.tileDistance) / spreadView.width;
@@ -423,9 +424,10 @@ Item {
423 MouseArea {
424 MouseArea {
424 id: sideStageDragHandleMouseArea
425 id: sideStageDragHandleMouseArea
425 anchors.fill: parent
426 anchors.fill: parent
427+ enabled: spreadView.contentX == 0
426 property int startX
428 property int startX
427 property var gesturePoints: new Array()
429 property var gesturePoints: new Array()
428− enabled: spreadView.contentX == 0
430+
429 onPressed: {
431 onPressed: {
430 gesturePoints = [];
432 gesturePoints = [];
431 startX = mouseX;
433 startX = mouseX;