on xenial help sign in
hide dropshadow when not in spread
commit8a0809da424e197c63f27582907899991290dcc9 authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 5 Jun 2014, 14:46 (12 years ago) parent247b1c9
3 files changed+9−3
qml/Stages/PhoneStage.qml+1 qml/Stages/SpreadDelegate.qml+5−2 qml/Stages/TabletStage.qml+3−1
qml/Stages/PhoneStage.qml+1
@@ -243,6 +243,7 @@ Rectangle {
243243 otherSelected: spreadView.selectedIndex >= 0 && !selected
244244 interactive: !spreadView.interactive
245245 maximizedAppTopMargin: root.maximizedAppTopMargin
246+ dropShadow: spreadView.shiftedContentX > 0 || spreadDragArea.status == DirectionalDragArea.Undecided
246247
247248 z: index
248249 x: index == 0 ? 0 : spreadView.width + (index - 1) * spreadView.tileDistance
qml/Stages/SpreadDelegate.qml+5−2
@@ -18,6 +18,7 @@
1818
1919import QtQuick 2.0
2020import Mir.Application 0.1
21+import Ubuntu.Components 1.0
2122
2223Item {
2324 id: root
@@ -27,6 +28,7 @@ Item {
2728 property bool interactive: true
2829 property real maximizedAppTopMargin
2930 property var application: ApplicationManager.get(index)
31+ property bool dropShadow: true
3032
3133 // FIXME: This really should be invisible to QML code.
3234 // e.g. Create a SurfaceItem {} in C++ which we just use without any imperative hacks.
@@ -82,12 +84,13 @@ Item {
8284 ]
8385
8486 BorderImage {
85− id: dropShadow
87+ id: dropShadowImage
8688 anchors.fill: surface
8789 anchors.margins: -units.gu(2)
8890 source: "graphics/dropshadow.png"
89− opacity: .4
9091 border { left: 50; right: 50; top: 50; bottom: 50 }
92+ opacity: root.dropShadow ? .4 : 0
93+ Behavior on opacity { UbuntuNumberAnimation {} }
9194 }
9295
9396 // 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 {
347347 isInSideStage: priv.sideStageAppId == model.appId
348348 interactive: !spreadView.interactive
349349 maximizedAppTopMargin: root.maximizedAppTopMargin
350+ dropShadow: spreadView.contentX > 0 || spreadDragArea.status == DirectionalDragArea.Undecided
350351
351352 progress: {
352353 var tileProgress = (spreadView.contentX - zIndex * spreadView.tileDistance) / spreadView.width;
@@ -423,9 +424,10 @@ Item {
423424 MouseArea {
424425 id: sideStageDragHandleMouseArea
425426 anchors.fill: parent
427+ enabled: spreadView.contentX == 0
426428 property int startX
427429 property var gesturePoints: new Array()
428− enabled: spreadView.contentX == 0
430+
429431 onPressed: {
430432 gesturePoints = [];
431433 startX = mouseX;