on xenial help sign in
improve dropshadow in the stack
commite13e7870eeee6095652ccacf0b6cb77d5e9feeb5 authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 11 Jun 2015, 11:50 (11 years ago) parent22b5fad
3 files changed+11−2
qml/Stages/DecoratedWindow.qml+2−2 qml/Stages/DesktopStage.qml+1 qml/Stages/SpreadMaths.qml+8
qml/Stages/DecoratedWindow.qml+2−2
@@ -29,6 +29,7 @@ FocusScope {
2929
3030 property bool decorationShown: true
3131 property bool highlightShown: false
32+ property real shadowOpacity: 1
3233
3334 property int windowWidth: width
3435 property int windowHeight: height
@@ -67,8 +68,7 @@ FocusScope {
6768 margins: -units.gu(2)
6869 }
6970 source: "graphics/dropshadow2gu.sci"
70− opacity: .3
71− Behavior on opacity { UbuntuNumberAnimation {} }
71+ opacity: root.shadowOpacity * .3
7272 }
7373
7474 Rectangle {
qml/Stages/DesktopStage.qml+1
@@ -194,6 +194,7 @@ Rectangle {
194194 state: "transformed"
195195 width: spreadMaths.spreadHeight
196196 height: spreadMaths.spreadHeight
197+ shadowOpacity: spreadMaths.shadowOpacity
197198 }
198199 PropertyChanges {
199200 target: tileInfo
qml/Stages/SpreadMaths.qml+8
@@ -123,6 +123,14 @@ Item {
123123 : 1
124124
125125 readonly property bool itemVisible: itemIndex == totalItems - 1 ? true : leftFoldingAreaProgress < 5 && rightFoldingAreaProgress < 5
126+ readonly property real shadowOpacity: itemIndex == totalItems -1 ?
127+ 1
128+ : leftFoldingAreaProgress > 3 ?
129+ linearAnimation(3, 3.5, 1, 0, leftFoldingAreaProgress)
130+ : rightFoldingAreaProgress > 3 ?
131+ linearAnimation(3, 3.5, 1, 0, rightFoldingAreaProgress)
132+ : 1
133+
126134
127135 // Helpers
128136 function linearAnimation(startProgress, endProgress, startValue, endValue, progress) {