on xenial help sign in
Revert see-through-dash.
commita9b1f3d0ba435078b328123bf03fc7a4bd4b03a6 authorMichał Sawicz <michal.sawicz@canonical.com> dateWed 5 Mar 2014, 14:59 (13 years ago) parent00b6d21
3 files changed+59−114
qml/Components/Showable.qml−8 qml/Dash/DashFilterGrid.qml−2 qml/Shell.qml+59−104
qml/Components/Showable.qml−8
@@ -107,9 +107,6 @@ Item {
107107 if (!hideAnimation.running) {
108108 hideAnimation.restart()
109109 }
110− if (__skipShowAnimation) {
111− hideAnimation.complete();
112− }
113110 } else {
114111 visible = false
115112 required = false
@@ -118,11 +115,6 @@ Item {
118115 shown = false
119116 }
120117
121− function hideNow() {
122− __skipShowAnimation = true;
123− hide();
124− }
125−
126118 Connections {
127119 target: hideAnimation ? hideAnimation: null
128120 onRunningChanged: {
qml/Dash/DashFilterGrid.qml−2
@@ -31,8 +31,6 @@ DashRenderer {
3131 property alias minimumHorizontalSpacing: filterGrid.minimumHorizontalSpacing
3232 property alias collapsedRowCount: filterGrid.collapsedRowCount
3333
34− property FilterGrid grid: filterGrid
35−
3634 collapsedHeight: filterGrid.collapsedHeight
3735 columns: filterGrid.columns
3836 rows: filter ? filterGrid.collapsedRowCount : filterGrid.uncollapsedRowCount
qml/Shell.qml+59−104
@@ -79,6 +79,8 @@ FocusScope {
7979 applicationManager.unfocusCurrentApplication();
8080 }
8181
82+ readonly property bool applicationFocused: !!applicationManager.mainStageFocusedApplication
83+ || !!applicationManager.sideStageFocusedApplication
8284 // Used for autopilot testing.
8385 readonly property string currentFocusedAppId: ApplicationManager.focusedApplicationId
8486
@@ -143,94 +145,66 @@ FocusScope {
143145 // Whether the underlay is fully covered by opaque UI elements.
144146 property bool fullyCovered: panel.indicators.fullyOpened && shell.width <= panel.indicatorsMenuWidth
145147
146− readonly property bool mainStageApplicationRunning: mainStage.applications && mainStage.applications.count > 0
147− readonly property bool sideStageApplicationRunning: sideStage.applications && sideStage.applications.count > 0
148+ readonly property bool applicationRunning: ((mainStage.applications && mainStage.applications.count > 0)
149+ || (sideStage.applications && sideStage.applications.count > 0))
148150
149151 // 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
151153 && !mainStage.usingScreenshots // but want sideStage animating over app surface
152154
153155
154156
155157 // NB! Application surfaces are stacked behing the shell one. So they can only be seen by the user
156158 // through the translucent parts of the shell surface.
157− visible: !fullyCovered && !mainStageApplicationShown
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
159+ visible: !fullyCovered && !applicationSurfaceShouldBeSeen
172160
173− Image {
174− anchors.fill: dash
175− source: shell.width > shell.height ? "Dash/graphics/paper_landscape.png" : "Dash/graphics/paper_portrait.png"
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
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− }
161+ Rectangle {
162+ anchors.fill: parent
163+ color: "black"
164+ opacity: dash.disappearingAnimationProgress
165+ }
195166
196− width: underlay.width
197− height: underlay.height - y
198− y: panel.panelHeight
199−
200− contentScale: 1.0 - 0.2 * disappearingAnimationProgress
201− opacity: 1.0 - disappearingAnimationProgress
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− }
167+ Image {
168+ anchors.fill: dash
169+ source: shell.width > shell.height ? "Dash/graphics/paper_landscape.png" : "Dash/graphics/paper_portrait.png"
170+ fillMode: Image.PreserveAspectCrop
171+ horizontalAlignment: Image.AlignRight
172+ verticalAlignment: Image.AlignTop
173+ }
212174
213− // FIXME: only necessary because stagesOuterContainer.showProgress and
214− // greeterRevealer.animatedProgress are not animated
215− Behavior on disappearingAnimationProgress { SmoothedAnimation { velocity: 5 }}
175+ Dash {
176+ id: dash
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+ }
216188 }
217189
218− Rectangle {
219− width: underlay.width
220− height: underlay.height
221− color: "black"
222− opacity: 0.5 * ((sideStage.x - sideStageRevealer.closedValue) / (sideStageRevealer.openedValue - sideStageRevealer.closedValue))
223− visible: sideStageHideButton.enabled
190+ anchors {
191+ fill: parent
192+ topMargin: panel.panelHeight
224193 }
225194
226− AbstractButton {
227− id: sideStageHideButton
228− enabled: mainStage.applications.count == 0 && sideStage.shown
229− anchors.fill: parent
230− onClicked: {
231− sideStage.hide();
195+ contentScale: 1.0 - 0.2 * disappearingAnimationProgress
196+ opacity: 1.0 - disappearingAnimationProgress
197+ property real disappearingAnimationProgress: {
198+ if (greeter.shown) {
199+ return greeter.showProgress;
200+ } else {
201+ return stagesOuterContainer.showProgress;
232202 }
233203 }
204+
205+ // FIXME: only necessary because stagesOuterContainer.showProgress and
206+ // greeterRevealer.animatedProgress are not animated
207+ Behavior on disappearingAnimationProgress { SmoothedAnimation { velocity: 5 }}
234208 }
235209 }
236210
@@ -239,7 +213,7 @@ FocusScope {
239213
240214 width: parent.width
241215 height: parent.height
242− x: mainStage.applications.count > 0 ? launcher.progress : 0
216+ x: launcher.progress
243217 Behavior on x {SmoothedAnimation{velocity: 600}}
244218
245219 property real showProgress:
@@ -251,16 +225,6 @@ FocusScope {
251225
252226 x: width
253227
254− function doLauncherHide() {
255− if (mainStage.applications.count > 0) {
256− hide();
257− } else {
258− if (sideStage.shown) {
259− sideStage.hide();
260− }
261− }
262− }
263−
264228 property bool fullyShown: shown && x == 0 && parent.x == 0
265229 property bool fullyHidden: !shown && x == width
266230 available: !greeter.shown
@@ -345,6 +309,11 @@ FocusScope {
345309 rightEdgeDraggingAreaWidth: shell.edgeSize
346310 normalApplicationY: shell.panelHeight
347311
312+ onShownChanged: {
313+ if (!shown && mainStage.applications.count == 0) {
314+ stages.hide();
315+ }
316+ }
348317 // FIXME: when hiding the side stage, refocus the main stage
349318 // application so that it goes in front of the side stage
350319 // application and hides it
@@ -373,16 +342,8 @@ FocusScope {
373342 Connections {
374343 target: sideStage.applications
375344 onCountChanged: {
376− if (sideStage.applications.count == 0) {
377− if (sideStage.shown) { // if all SS app closed, hide side stage
378− 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− }
345+ if (sideStage.applications.count == 0 && sideStage.shown) { // if all SS app closed, hide side stage
346+ sideStage.hide();
386347 }
387348 }
388349 }
@@ -391,7 +352,7 @@ FocusScope {
391352 Revealer {
392353 id: sideStageRevealer
393354
394− enabled: sideStage.applications.count > 0
355+ enabled: mainStage.applications.count > 0 && sideStage.applications.count > 0
395356 && sideStage.available
396357 direction: Qt.RightToLeft
397358 openedValue: parent.width - sideStage.width
@@ -576,14 +537,8 @@ FocusScope {
576537 }
577538
578539 InputFilterArea {
579− width: {
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
540+ anchors.fill: parent
541+ blockInput: !applicationFocused || greeter.shown || lockscreen.shown || launcher.shown
587542 || panel.indicators.shown || hud.shown
588543 }
589544
@@ -685,7 +640,7 @@ FocusScope {
685640 theHud: hud
686641 anchors.fill: parent
687642 enabled: hud.available
688− applicationIsOnForeground: (stages.shown && mainStage.applications.count > 0) || (stages.shown && sideStage.shown)
643+ applicationIsOnForeground: applicationFocused
689644 }
690645
691646 InputFilterArea {
@@ -717,7 +672,7 @@ FocusScope {
717672 }
718673 onDash: {
719674 if (stages.shown) {
720− stages.doLauncherHide();
675+ stages.hide();
721676 launcher.hide();
722677 }
723678 }
@@ -836,7 +791,7 @@ FocusScope {
836791 launcher: launcher
837792 dash: dash
838793 indicators: panel.indicators
839− underlay: underlayClipper
794+ underlay: underlay
840795 }
841796
842797 Connections {