on xenial help sign in
panel dropdown shadow for maximized unfocused windows
commit12ef56fbbb632b8345244760016f89d4fd1b1a43 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateThu 5 Nov 2015, 19:35 (11 years ago) parent3bd082f
3 files changed+18−12
qml/Components/PanelState/PanelState.qml+1 qml/Panel/Panel.qml+1−12 qml/Stages/DesktopStage.qml+16
qml/Components/PanelState/PanelState.qml+1
@@ -22,6 +22,7 @@ QtObject {
2222
2323 property string title: ""
2424 property bool buttonsVisible: false
25+ property bool dropShadow: false
2526
2627 signal close()
2728 signal minimize()
qml/Panel/Panel.qml+1−12
@@ -68,22 +68,11 @@ Item {
6868
6969 BorderImage {
7070 id: dropShadow
71− anchors {
72− fill: indicators
73− leftMargin: -units.gu(1)
74− bottomMargin: -units.gu(1)
75− }
76− visible: !indicators.fullyClosed
77− source: "graphics/rectangular_dropshadow.sci"
78− }
79−
80− BorderImage {
81− id: dropShadow2
8271 anchors {
8372 fill: indicatorAreaBackground
8473 bottomMargin: -units.gu(1)
8574 }
86− visible: true // FIXME only for an unfocused maximized window
75+ visible: PanelState.dropShadow && !callHint.visible
8776 source: "graphics/rectangular_dropshadow.sci"
8877 }
8978
qml/Stages/DesktopStage.qml+16
@@ -167,6 +167,16 @@ Rectangle {
167167 }
168168 }
169169 }
170+
171+ function isAnyMaximized() {
172+ for (var i = 0; i < appRepeater.count; i++) {
173+ var appDelegate = appRepeater.itemAt(i);
174+ if (appDelegate && appDelegate.maximized) {
175+ return true;
176+ }
177+ }
178+ return false;
179+ }
170180 }
171181
172182 Connections {
@@ -200,6 +210,12 @@ Rectangle {
200210 when: priv.focusedAppDelegate
201211 }
202212
213+ Binding {
214+ target: PanelState
215+ property: "dropShadow"
216+ value: priv.focusedAppDelegate && !priv.focusedAppDelegate.maximized && priv.isAnyMaximized()
217+ }
218+
203219 Component.onDestruction: PanelState.buttonsVisible = false;
204220
205221 FocusScope {