on xenial help sign in
Revert see-through-dash.
a9b1f3dMichał Sawicz
qml/Components/Showable.qml−8
@@ -107,9 +107,6 @@ Item {
107 if (!hideAnimation.running) {
107 if (!hideAnimation.running) {
108 hideAnimation.restart()
108 hideAnimation.restart()
109 }
109 }
110− if (__skipShowAnimation) {
111− hideAnimation.complete();
112− }
113 } else {
110 } else {
114 visible = false
111 visible = false
115 required = false
112 required = false
@@ -118,11 +115,6 @@ Item {
118 shown = false
115 shown = false
119 }
116 }
120
117
121− function hideNow() {
122− __skipShowAnimation = true;
123− hide();
124− }
125−
126 Connections {
118 Connections {
127 target: hideAnimation ? hideAnimation: null
119 target: hideAnimation ? hideAnimation: null
128 onRunningChanged: {
120 onRunningChanged: {
qml/Dash/DashFilterGrid.qml−2
@@ -31,8 +31,6 @@ DashRenderer {
31 property alias minimumHorizontalSpacing: filterGrid.minimumHorizontalSpacing
31 property alias minimumHorizontalSpacing: filterGrid.minimumHorizontalSpacing
32 property alias collapsedRowCount: filterGrid.collapsedRowCount
32 property alias collapsedRowCount: filterGrid.collapsedRowCount
33
33
34− property FilterGrid grid: filterGrid
35−
36 collapsedHeight: filterGrid.collapsedHeight
34 collapsedHeight: filterGrid.collapsedHeight
37 columns: filterGrid.columns
35 columns: filterGrid.columns
38 rows: filter ? filterGrid.collapsedRowCount : filterGrid.uncollapsedRowCount
36 rows: filter ? filterGrid.collapsedRowCount : filterGrid.uncollapsedRowCount
qml/Shell.qml+59−104
@@ -79,6 +79,8 @@ FocusScope {
79 applicationManager.unfocusCurrentApplication();
79 applicationManager.unfocusCurrentApplication();
80 }
80 }
81
81
82+ readonly property bool applicationFocused: !!applicationManager.mainStageFocusedApplication
83+ || !!applicationManager.sideStageFocusedApplication
82 // Used for autopilot testing.
84 // Used for autopilot testing.
83 readonly property string currentFocusedAppId: ApplicationManager.focusedApplicationId
85 readonly property string currentFocusedAppId: ApplicationManager.focusedApplicationId
84
86
@@ -143,94 +145,66 @@ FocusScope {
143 // Whether the underlay is fully covered by opaque UI elements.
145 // Whether the underlay is fully covered by opaque UI elements.
144 property bool fullyCovered: panel.indicators.fullyOpened && shell.width <= panel.indicatorsMenuWidth
146 property bool fullyCovered: panel.indicators.fullyOpened && shell.width <= panel.indicatorsMenuWidth
145
147
146− readonly property bool mainStageApplicationRunning: mainStage.applications && mainStage.applications.count > 0
148+ readonly property bool applicationRunning: ((mainStage.applications && mainStage.applications.count > 0)
147− readonly property bool sideStageApplicationRunning: sideStage.applications && sideStage.applications.count > 0
149+ || (sideStage.applications && sideStage.applications.count > 0))
148
150
149 // Whether the user should see the topmost application surface (if there's one at all).
151 // Whether the user should see the topmost application surface (if there's one at all).
150− readonly property bool mainStageApplicationShown: mainStageApplicationRunning && !stages.fullyHidden
152+ readonly property bool applicationSurfaceShouldBeSeen: applicationRunning && !stages.fullyHidden
151 && !mainStage.usingScreenshots // but want sideStage animating over app surface
153 && !mainStage.usingScreenshots // but want sideStage animating over app surface
152
154
153
155
154
156
155 // NB! Application surfaces are stacked behing the shell one. So they can only be seen by the user
157 // NB! Application surfaces are stacked behing the shell one. So they can only be seen by the user
156 // through the translucent parts of the shell surface.
158 // through the translucent parts of the shell surface.
157− visible: !fullyCovered && !mainStageApplicationShown
159+ visible: !fullyCovered && !applicationSurfaceShouldBeSeen
158−
159− Item {
160− id: underlayClipper
161− clip: !parent.mainStageApplicationShown && parent.sideStageApplicationRunning && stagesOuterContainer.showProgress > 0
162− width: {
163− if (clip) {
164− var w = parent.width - sideStage.width
165− w += stagesOuterContainer.x + stages.x + (sideStage.x - sideStageRevealer.openedValue)
166− return Math.min(w, parent.width);
167− } else {
168− return parent.width;
169− }
170− }
171− height: parent.height
172
160
173− Image {
161+ Rectangle {
174− anchors.fill: dash
162+ anchors.fill: parent
175− source: shell.width > shell.height ? "Dash/graphics/paper_landscape.png" : "Dash/graphics/paper_portrait.png"
163+ color: "black"
176− fillMode: Image.PreserveAspectCrop
177− horizontalAlignment: Image.AlignRight
178− verticalAlignment: Image.AlignTop
179− }
180−
181− Dash {
182− id: dash
183− objectName: "dash"
184−
185− available: !greeter.shown && !lockscreen.shown
186− hides: [stages, launcher, panel.indicators]
187− shown: disappearingAnimationProgress !== 1.0
164+ opacity: dash.disappearingAnimationProgress
188− enabled: disappearingAnimationProgress === 0.0 && edgeDemo.dashEnabled
189− // FIXME: unfocus all applications when going back to the dash
190− onEnabledChanged: {
191− if (enabled) {
192− shell.applicationManager.unfocusCurrentApplication()
193− }
194− }
165+ }
195
166
196− width: underlay.width
167+ Image {
197− height: underlay.height - y
168+ anchors.fill: dash
198− y: panel.panelHeight
169+ source: shell.width > shell.height ? "Dash/graphics/paper_landscape.png" : "Dash/graphics/paper_portrait.png"
199−
170+ fillMode: Image.PreserveAspectCrop
200− contentScale: 1.0 - 0.2 * disappearingAnimationProgress
171+ horizontalAlignment: Image.AlignRight
201− opacity: 1.0 - disappearingAnimationProgress
172+ verticalAlignment: Image.AlignTop
202− property real disappearingAnimationProgress: {
203− if (greeter.shown) {
204− return greeter.showProgress;
205− } else {
206− if (underlayClipper.clip)
207− return 0;
208− else
209− return stagesOuterContainer.showProgress;
210− }
211− }
173+ }
212
174
213− // FIXME: only necessary because stagesOuterContainer.showProgress and
175+ Dash {
214− // greeterRevealer.animatedProgress are not animated
176+ id: dash
215− Behavior on disappearingAnimationProgress { SmoothedAnimation { velocity: 5 }}
177+ objectName: "dash"
178+
179+ available: !greeter.shown && !lockscreen.shown
180+ hides: [stages, launcher, panel.indicators]
181+ shown: disappearingAnimationProgress !== 1.0
182+ enabled: disappearingAnimationProgress === 0.0 && edgeDemo.dashEnabled
183+ // FIXME: unfocus all applications when going back to the dash
184+ onEnabledChanged: {
185+ if (enabled) {
186+ shell.applicationManager.unfocusCurrentApplication()
187+ }
216 }
188 }
217
189
218− Rectangle {
190+ anchors {
219− width: underlay.width
191+ fill: parent
220− height: underlay.height
192+ topMargin: panel.panelHeight
221− color: "black"
222− opacity: 0.5 * ((sideStage.x - sideStageRevealer.closedValue) / (sideStageRevealer.openedValue - sideStageRevealer.closedValue))
223− visible: sideStageHideButton.enabled
224 }
193 }
225
194
226− AbstractButton {
195+ contentScale: 1.0 - 0.2 * disappearingAnimationProgress
227− id: sideStageHideButton
196+ opacity: 1.0 - disappearingAnimationProgress
228− enabled: mainStage.applications.count == 0 && sideStage.shown
197+ property real disappearingAnimationProgress: {
229− anchors.fill: parent
198+ if (greeter.shown) {
230− onClicked: {
199+ return greeter.showProgress;
231− sideStage.hide();
200+ } else {
201+ return stagesOuterContainer.showProgress;
232 }
202 }
233 }
203 }
204+
205+ // FIXME: only necessary because stagesOuterContainer.showProgress and
206+ // greeterRevealer.animatedProgress are not animated
207+ Behavior on disappearingAnimationProgress { SmoothedAnimation { velocity: 5 }}
234 }
208 }
235 }
209 }
236
210
@@ -239,7 +213,7 @@ FocusScope {
239
213
240 width: parent.width
214 width: parent.width
241 height: parent.height
215 height: parent.height
242− x: mainStage.applications.count > 0 ? launcher.progress : 0
216+ x: launcher.progress
243 Behavior on x {SmoothedAnimation{velocity: 600}}
217 Behavior on x {SmoothedAnimation{velocity: 600}}
244
218
245 property real showProgress:
219 property real showProgress:
@@ -251,16 +225,6 @@ FocusScope {
251
225
252 x: width
226 x: width
253
227
254− function doLauncherHide() {
255− if (mainStage.applications.count > 0) {
256− hide();
257− } else {
258− if (sideStage.shown) {
259− sideStage.hide();
260− }
261− }
262− }
263−
264 property bool fullyShown: shown && x == 0 && parent.x == 0
228 property bool fullyShown: shown && x == 0 && parent.x == 0
265 property bool fullyHidden: !shown && x == width
229 property bool fullyHidden: !shown && x == width
266 available: !greeter.shown
230 available: !greeter.shown
@@ -345,6 +309,11 @@ FocusScope {
345 rightEdgeDraggingAreaWidth: shell.edgeSize
309 rightEdgeDraggingAreaWidth: shell.edgeSize
346 normalApplicationY: shell.panelHeight
310 normalApplicationY: shell.panelHeight
347
311
312+ onShownChanged: {
313+ if (!shown && mainStage.applications.count == 0) {
314+ stages.hide();
315+ }
316+ }
348 // FIXME: when hiding the side stage, refocus the main stage
317 // FIXME: when hiding the side stage, refocus the main stage
349 // application so that it goes in front of the side stage
318 // application so that it goes in front of the side stage
350 // application and hides it
319 // application and hides it
@@ -373,16 +342,8 @@ FocusScope {
373 Connections {
342 Connections {
374 target: sideStage.applications
343 target: sideStage.applications
375 onCountChanged: {
344 onCountChanged: {
376− if (sideStage.applications.count == 0) {
377− if (sideStage.shown) { // if all SS app closed, hide side stage
345+ if (sideStage.applications.count == 0 && sideStage.shown) { // if all SS app closed, hide side stage
378− sideStage.hide();
346+ sideStage.hide();
379− } else {
380− // Sidestage is hidden and there is no main app, make sure the
381− // stages is totally hidden too
382− if (mainStage.applications.count == 0) {
383− stages.hideNow();
384− }
385− }
386 }
347 }
387 }
348 }
388 }
349 }
@@ -391,7 +352,7 @@ FocusScope {
391 Revealer {
352 Revealer {
392 id: sideStageRevealer
353 id: sideStageRevealer
393
354
394− enabled: sideStage.applications.count > 0
355+ enabled: mainStage.applications.count > 0 && sideStage.applications.count > 0
395 && sideStage.available
356 && sideStage.available
396 direction: Qt.RightToLeft
357 direction: Qt.RightToLeft
397 openedValue: parent.width - sideStage.width
358 openedValue: parent.width - sideStage.width
@@ -576,14 +537,8 @@ FocusScope {
576 }
537 }
577
538
578 InputFilterArea {
539 InputFilterArea {
579− width: {
540+ anchors.fill: parent
580− if (applicationManager.sideStageFocusedApplication && sideStage.shown)
581− return parent.width - sideStage.width;
582− else
583− return parent.width;
584− }
585− height: parent.height
586− blockInput: !applicationManager.mainStageFocusedApplication || greeter.shown || lockscreen.shown || launcher.shown
541+ blockInput: !applicationFocused || greeter.shown || lockscreen.shown || launcher.shown
587 || panel.indicators.shown || hud.shown
542 || panel.indicators.shown || hud.shown
588 }
543 }
589
544
@@ -685,7 +640,7 @@ FocusScope {
685 theHud: hud
640 theHud: hud
686 anchors.fill: parent
641 anchors.fill: parent
687 enabled: hud.available
642 enabled: hud.available
688− applicationIsOnForeground: (stages.shown && mainStage.applications.count > 0) || (stages.shown && sideStage.shown)
643+ applicationIsOnForeground: applicationFocused
689 }
644 }
690
645
691 InputFilterArea {
646 InputFilterArea {
@@ -717,7 +672,7 @@ FocusScope {
717 }
672 }
718 onDash: {
673 onDash: {
719 if (stages.shown) {
674 if (stages.shown) {
720− stages.doLauncherHide();
675+ stages.hide();
721 launcher.hide();
676 launcher.hide();
722 }
677 }
723 }
678 }
@@ -836,7 +791,7 @@ FocusScope {
836 launcher: launcher
791 launcher: launcher
837 dash: dash
792 dash: dash
838 indicators: panel.indicators
793 indicators: panel.indicators
839− underlay: underlayClipper
794+ underlay: underlay
840 }
795 }
841
796
842 Connections {
797 Connections {