@@ -143,66 +143,95 @@ FocusScope {
143143 // Whether the underlay is fully covered by opaque UI elements.
144144 property bool fullyCovered: panel.indicators.fullyOpened && shell.width <= panel.indicatorsMenuWidth
145145
146− readonly property bool applicationRunning: ((mainStage.applications && mainStage.applications.count > 0)
147− || (sideStage.applications && sideStage.applications.count > 0))
146+ readonly property bool mainStageApplicationRunning: mainStage.applications && mainStage.applications.count > 0
147+ readonly property bool sideStageApplicationRunning: sideStage.applications && sideStage.applications.count > 0
148148
149149 // Whether the user should see the topmost application surface (if there's one at all).
150− readonly property bool applicationSurfaceShouldBeSeen: applicationRunning && !stages.fullyHidden
150+ readonly property bool mainStageApplicationShown: mainStageApplicationRunning && !stages.fullyHidden
151151 && !mainStage.usingScreenshots // but want sideStage animating over app surface
152152
153153
154154
155155 // NB! Application surfaces are stacked behing the shell one. So they can only be seen by the user
156156 // through the translucent parts of the shell surface.
157− visible: !fullyCovered && !applicationSurfaceShouldBeSeen
158−
159− Rectangle {
160− anchors.fill: parent
161− color: "black"
162− opacity: dash.disappearingAnimationProgress
163− }
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+ console.log("UCW", stagesOuterContainer.x, stages.x, "\n");
166+ w += stagesOuterContainer.x + stages.x
167+ return Math.min(w, parent.width);
168+ } else {
169+ return parent.width;
170+ }
171+ }
172+ height: parent.height
164173
165− Image {
166− anchors.fill: dash
167− source: shell.width > shell.height ? "Dash/graphics/paper_landscape.png" : "Dash/graphics/paper_portrait.png"
168− fillMode: Image.PreserveAspectCrop
169− horizontalAlignment: Image.AlignRight
170− verticalAlignment: Image.AlignTop
171− }
174+ Rectangle {
175+ width: underlay.width
176+ height: underlay.height
177+ color: "black"
178+ opacity: dash.disappearingAnimationProgress
179+ }
180+
181+ Image {
182+ anchors.fill: dash
183+ source: shell.width > shell.height ? "Dash/graphics/paper_landscape.png" : "Dash/graphics/paper_portrait.png"
184+ fillMode: Image.PreserveAspectCrop
185+ horizontalAlignment: Image.AlignRight
186+ verticalAlignment: Image.AlignTop
187+ }
188+
189+ Dash {
190+ id: dash
191+ objectName: "dash"
192+
193+ available: !greeter.shown && !lockscreen.shown
194+ hides: [stages, launcher, panel.indicators]
195+ shown: disappearingAnimationProgress !== 1.0
196+ enabled: disappearingAnimationProgress === 0.0 && edgeDemo.dashEnabled
197+ // FIXME: unfocus all applications when going back to the dash
198+ onEnabledChanged: {
199+ if (enabled) {
200+ shell.applicationManager.unfocusCurrentApplication()
201+ }
202+ }
172203
173− Dash {
174− id: dash
175− objectName: "dash"
176−
177− available: !greeter.shown && !lockscreen.shown
178− hides: [stages, launcher, panel.indicators]
179− shown: disappearingAnimationProgress !== 1.0
180− enabled: disappearingAnimationProgress === 0.0 && edgeDemo.dashEnabled
181− // FIXME: unfocus all applications when going back to the dash
182− onEnabledChanged: {
183− if (enabled) {
184− shell.applicationManager.unfocusCurrentApplication()
204+ width: underlay.width
205+ height: underlay.height - y
206+ y: panel.panelHeight
207+
208+ contentScale: 1.0 - 0.2 * disappearingAnimationProgress
209+ opacity: 1.0 - disappearingAnimationProgress
210+ property real disappearingAnimationProgress: {
211+ if (greeter.shown) {
212+ return greeter.showProgress;
213+ } else {
214+ if (underlayClipper.clip)
215+ return stagesOuterContainer.showProgress * 0.5;
216+ else
217+ return stagesOuterContainer.showProgress;
218+ }
185219 }
186− }
187220
188− anchors {
189− fill: parent
190− topMargin: panel.panelHeight
221+ // FIXME: only necessary because stagesOuterContainer.showProgress and
222+ // greeterRevealer.animatedProgress are not animated
223+ Behavior on disappearingAnimationProgress { SmoothedAnimation { velocity: 5 }}
191224 }
192225
193− contentScale: 1.0 - 0.2 * disappearingAnimationProgress
194− opacity: 1.0 - disappearingAnimationProgress
195− property real disappearingAnimationProgress: {
196− if (greeter.shown) {
197− return greeter.showProgress;
198− } else {
199− return stagesOuterContainer.showProgress;
226+ AbstractButton {
227+ enabled: stagesOuterContainer.showProgress == 1
228+ onEnabledChanged: console.log("AbstractButton enabled", enabled, "\n");
229+ anchors.fill: parent
230+ onClicked: {
231+ console.log("CLICKED\n");
232+ stages.hide()
200233 }
201234 }
202−
203− // FIXME: only necessary because stagesOuterContainer.showProgress and
204− // greeterRevealer.animatedProgress are not animated
205− Behavior on disappearingAnimationProgress { SmoothedAnimation { velocity: 5 }}
206235 }
207236 }
208237
@@ -548,8 +577,14 @@ FocusScope {
548577 }
549578
550579 InputFilterArea {
551− anchors.fill: parent
552− blockInput: !applicationFocused || greeter.shown || lockscreen.shown || launcher.shown
580+ width: {
581+ if (applicationManager.sideStageFocusedApplication)
582+ return parent.width - sideStage.width;
583+ else
584+ return parent.width;
585+ }
586+ height: parent.height
587+ blockInput: !applicationManager.mainStageFocusedApplication || greeter.shown || lockscreen.shown || launcher.shown
553588 || panel.indicators.shown || hud.shown
554589 }
555590