on xenial help sign in
panel dropdown shadow for maximized unfocused windows
12ef56fLukáš Tinkl
qml/Components/PanelState/PanelState.qml+1
@@ -22,6 +22,7 @@ QtObject {
22
22
23 property string title: ""
23 property string title: ""
24 property bool buttonsVisible: false
24 property bool buttonsVisible: false
25+ property bool dropShadow: false
25
26
26 signal close()
27 signal close()
27 signal minimize()
28 signal minimize()
qml/Panel/Panel.qml+1−12
@@ -68,22 +68,11 @@ Item {
68
68
69 BorderImage {
69 BorderImage {
70 id: dropShadow
70 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
82 anchors {
71 anchors {
83 fill: indicatorAreaBackground
72 fill: indicatorAreaBackground
84 bottomMargin: -units.gu(1)
73 bottomMargin: -units.gu(1)
85 }
74 }
86− visible: true // FIXME only for an unfocused maximized window
75+ visible: PanelState.dropShadow && !callHint.visible
87 source: "graphics/rectangular_dropshadow.sci"
76 source: "graphics/rectangular_dropshadow.sci"
88 }
77 }
89
78
qml/Stages/DesktopStage.qml+16
@@ -167,6 +167,16 @@ Rectangle {
167 }
167 }
168 }
168 }
169 }
169 }
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+ }
170 }
180 }
171
181
172 Connections {
182 Connections {
@@ -200,6 +210,12 @@ Rectangle {
200 when: priv.focusedAppDelegate
210 when: priv.focusedAppDelegate
201 }
211 }
202
212
213+ Binding {
214+ target: PanelState
215+ property: "dropShadow"
216+ value: priv.focusedAppDelegate && !priv.focusedAppDelegate.maximized && priv.isAnyMaximized()
217+ }
218+
203 Component.onDestruction: PanelState.buttonsVisible = false;
219 Component.onDestruction: PanelState.buttonsVisible = false;
204
220
205 FocusScope {
221 FocusScope {