@@ -19,10 +19,10 @@ import AccountsService 0.1
1919import GSettings 1.0
2020import Unity.Application 0.1
2121import Ubuntu.Components 0.1
22−import Ubuntu.Components.Popups 0.1
2322import Ubuntu.Gestures 0.1
2423import Ubuntu.SystemImage 0.1
2524import Unity.Launcher 0.1
25+import Utils 0.1
2626import LightDM 0.1 as LightDM
2727import Powerd 0.1
2828import SessionBroadcast 0.1
@@ -32,10 +32,11 @@ import "Launcher"
3232import "Panel"
3333import "Components"
3434import "Notifications"
35+import "Stages"
3536import Unity.Notifications 1.0 as NotificationBackend
3637import Unity.Session 0.1
3738
38−FocusScope {
39+Item {
3940 id: shell
4041
4142 // this is only here to select the width / height of the window if not running fullscreen
@@ -48,7 +49,7 @@ FocusScope {
4849 property url background
4950 readonly property real panelHeight: panel.panelHeight
5051
51− property bool dashShown: dash.shown
52+ property bool dashShown: dash.shown && dash.available && underlay.visible
5253
5354 property bool sideStageEnabled: shell.width >= units.gu(100)
5455 readonly property string focusedApplicationId: ApplicationManager.focusedApplicationId
@@ -58,14 +59,10 @@ FocusScope {
5859 function activateApplication(appId) {
5960 if (ApplicationManager.findApplication(appId)) {
6061 ApplicationManager.requestFocusApplication(appId);
61− stages.show(true);
62− if (stages.locked && ApplicationManager.focusedApplicationId == appId) {
63− applicationsDisplayLoader.item.select(appId);
64− }
6562 } else {
6663 var execFlags = shell.sideStageEnabled ? ApplicationManager.NoFlag : ApplicationManager.ForceMainStage;
6764 ApplicationManager.startApplication(appId, execFlags);
68− stages.show(false);
65+ stages.show();
6966 }
7067 }
7168
@@ -92,82 +89,74 @@ FocusScope {
9289 id: volumeControl
9390 }
9491
95− Keys.onVolumeUpPressed: volumeControl.volumeUp()
96− Keys.onVolumeDownPressed: volumeControl.volumeDown()
92+ WindowKeysFilter {
93+ // Handle but do not filter out volume keys
94+ Keys.onVolumeUpPressed: { volumeControl.volumeUp(); event.accepted = false; }
95+ Keys.onVolumeDownPressed: { volumeControl.volumeDown(); event.accepted = false; }
9796
98− Item {
99− id: underlayClipper
100− anchors.fill: parent
101− anchors.rightMargin: stages.overlayWidth
102− clip: stages.overlayMode && !stages.painting
97+ Keys.onPressed: {
98+ if (event.key == Qt.Key_PowerOff || event.key == Qt.Key_PowerDown) {
99+ dialogs.onPowerKeyPressed();
100+ event.accepted = true;
101+ } else {
102+ event.accepted = false;
103+ }
104+ }
103105
104− InputFilterArea {
105− anchors.fill: parent
106− blockInput: parent.clip
106+ Keys.onReleased: {
107+ if (event.key == Qt.Key_PowerOff || event.key == Qt.Key_PowerDown) {
108+ dialogs.onPowerKeyReleased();
109+ event.accepted = true;
110+ } else {
111+ event.accepted = false;
112+ }
107113 }
114+ }
108115
109− Item {
110− id: underlay
111− objectName: "underlay"
112− anchors.fill: parent
113− anchors.rightMargin: -parent.anchors.rightMargin
116+ Item {
117+ id: underlay
118+ objectName: "underlay"
119+ anchors.fill: parent
114120
115− // Whether the underlay is fully covered by opaque UI elements.
116− property bool fullyCovered: panel.indicators.fullyOpened && shell.width <= panel.indicators.width
121+ // Whether the underlay is fully covered by opaque UI elements.
122+ property bool fullyCovered: (panel.indicators.fullyOpened && shell.width <= panel.indicatorsMenuWidth)
123+ || stages.fullyShown || greeterWrapper.fullyShown
124+ visible: !fullyCovered
117125
118− // Whether the user should see the topmost application surface (if there's one at all).
119− readonly property bool applicationSurfaceShouldBeSeen: stages.shown && !stages.painting && !stages.overlayMode
126+ Image {
127+ anchors.fill: dash
128+ source: shell.width > shell.height ? "Dash/graphics/paper_landscape.png" : "Dash/graphics/paper_portrait.png"
129+ fillMode: Image.PreserveAspectCrop
130+ horizontalAlignment: Image.AlignRight
131+ verticalAlignment: Image.AlignTop
132+ }
120133
121− // NB! Application surfaces are stacked behind the shell one. So they can only be seen by the user
122− // through the translucent parts of the shell surface.
123− visible: !fullyCovered && !applicationSurfaceShouldBeSeen
134+ Dash {
135+ id: dash
136+ objectName: "dash"
124137
125− Rectangle {
126− anchors.fill: parent
127− color: "black"
128− opacity: dash.disappearingAnimationProgress
129− }
138+ available: !LightDM.Greeter.active
139+ hides: [stages, launcher, panel.indicators]
140+ shown: disappearingAnimationProgress !== 1.0 && greeterWrapper.showProgress !== 1.0 &&
141+ !(panel.indicators.fullyOpened && !sideStageEnabled)
142+ enabled: disappearingAnimationProgress === 0.0 && greeterWrapper.showProgress === 0.0 && edgeDemo.dashEnabled
130143
131− Image {
132− anchors.fill: dash
133− source: shell.width > shell.height ? "Dash/graphics/paper_landscape.png" : "Dash/graphics/paper_portrait.png"
134− fillMode: Image.PreserveAspectCrop
135− horizontalAlignment: Image.AlignRight
136− verticalAlignment: Image.AlignTop
144+ anchors {
145+ fill: parent
146+ topMargin: panel.panelHeight
137147 }
138148
139− Dash {
140− id: dash
141− objectName: "dash"
149+ contentScale: 1.0 - 0.2 * disappearingAnimationProgress
150+ opacity: 1.0 - disappearingAnimationProgress
151+ property real disappearingAnimationProgress: stages.showProgress
142152
143− available: !LightDM.Greeter.active
144− hides: [stages, launcher, panel.indicators]
145− shown: disappearingAnimationProgress !== 1.0 && greeterWrapper.showProgress !== 1.0
146− enabled: disappearingAnimationProgress === 0.0 && greeterWrapper.showProgress === 0.0 && edgeDemo.dashEnabled
147−
148− anchors {
149− fill: parent
150− topMargin: panel.panelHeight
151− }
152−
153− contentScale: 1.0 - 0.2 * disappearingAnimationProgress
154− opacity: 1.0 - disappearingAnimationProgress
155− property real disappearingAnimationProgress: {
156− if (stages.overlayMode) {
157− return 0;
158− } else {
159− return stages.showProgress
160− }
161− }
162−
163− // FIXME: only necessary because stages.showProgress is not animated
164− Behavior on disappearingAnimationProgress { SmoothedAnimation { velocity: 5 }}
165− }
153+ // FIXME: only necessary because stages.showProgress is not animated
154+ Behavior on disappearingAnimationProgress { SmoothedAnimation { velocity: 5 }}
166155 }
167156 }
168157
169158 EdgeDragArea {
170− id: stagesDragHandle
159+ id: stagesDragArea
171160 direction: Direction.Leftwards
172161
173162 anchors { top: parent.top; right: parent.right; bottom: parent.bottom }
@@ -177,20 +166,20 @@ FocusScope {
177166
178167 onTouchXChanged: {
179168 if (status == DirectionalDragArea.Recognized) {
180− if (ApplicationManager.count == 0) {
181− progress = Math.max(stages.width - stagesDragHandle.width + touchX, stages.width * .3)
169+ if (ApplicationManager.empty) {
170+ progress = Math.max(stages.width - stagesDragArea.width + touchX, stages.width * .3);
182171 } else {
183− progress = stages.width - stagesDragHandle.width + touchX
172+ progress = stages.width - stagesDragArea.width + touchX;
184173 }
185174 }
186175 }
187176
188177 onDraggingChanged: {
189178 if (!dragging) {
190− if (ApplicationManager.count > 0 && progress < stages.width - units.gu(10)) {
191− stages.show(true)
179+ if (!ApplicationManager.empty && progress < stages.width - units.gu(10)) {
180+ stages.show();
192181 }
193− stagesDragHandle.progress = stages.width;
182+ stagesDragArea.progress = Qt.binding(function () { return stages.width; });
194183 }
195184 }
196185 }
@@ -201,253 +190,93 @@ FocusScope {
201190 width: parent.width
202191 height: parent.height
203192
193+ visible: !fullyHidden && !ApplicationManager.empty
194+
204195 x: {
205196 if (shown) {
206− if (overlayMode || locked || greeter.fakeActiveForApp !== "") {
197+ if (locked || greeter.fakeActiveForApp !== "") {
207198 return 0;
208199 }
209− return launcher.progress
200+ return launcher.progress;
210201 } else {
211− return stagesDragHandle.progress
202+ return stagesDragArea.progress
212203 }
213204 }
214−
215205 Behavior on x { SmoothedAnimation { velocity: 600; duration: UbuntuAnimation.FastDuration } }
216206
217207 property bool shown: false
208+ onShownChanged: {
209+ if (shown) {
210+ if (ApplicationManager.count > 0) {
211+ ApplicationManager.focusApplication(ApplicationManager.get(0).appId);
212+ }
213+ } else {
214+ if (ApplicationManager.focusedApplicationId) {
215+ ApplicationManager.updateScreenshot(ApplicationManager.focusedApplicationId);
216+ ApplicationManager.unfocusCurrentApplication();
217+ }
218+ }
219+ }
218220
219− property real showProgress: overlayMode ? 0 : MathUtils.clamp(1 - x / shell.width, 0, 1)
221+ // Avoid a silent "divide by zero -> NaN" situation during init as shell.width will be
222+ // zero. That breaks the property binding and the function won't be reevaluated once
223+ // shell.width is set, with the NaN result staying there for good.
224+ property real showProgress: shell.width ? MathUtils.clamp(1 - x / shell.width, 0, 1) : 0
220225
221226 property bool fullyShown: x == 0
222227 property bool fullyHidden: x == width
223228
224− property bool painting: applicationsDisplayLoader.item ? applicationsDisplayLoader.item.painting : false
225− property bool fullscreen: applicationsDisplayLoader.item ? applicationsDisplayLoader.item.fullscreen : false
226− property bool overlayMode: applicationsDisplayLoader.item ? applicationsDisplayLoader.item.overlayMode : false
227− property int overlayWidth: applicationsDisplayLoader.item ? applicationsDisplayLoader.item.overlayWidth : false
228229 property bool locked: applicationsDisplayLoader.item ? applicationsDisplayLoader.item.locked : false
229230
230− function show(focusApp) {
231+ // It might technically not be fullyShown but visually it just looks so.
232+ property bool roughlyFullyShown: x >= 0 && x <= units.gu(1)
233+
234+ function show() {
231235 shown = true;
232− panel.indicators.hide();
233− edgeDemo.stopDemo();
234− greeter.hide();
235− if (!ApplicationManager.focusedApplicationId && ApplicationManager.count > 0 && focusApp) {
236− ApplicationManager.focusApplication(ApplicationManager.get(0).appId);
237− }
238236 }
239237
240238 function hide() {
241239 shown = false;
242− if (ApplicationManager.focusedApplicationId) {
243− ApplicationManager.unfocusCurrentApplication();
244− }
245240 }
246241
247242 Connections {
248243 target: ApplicationManager
249−
250244 onFocusRequested: {
251245 if (greeter.fakeActiveForApp !== "" && greeter.fakeActiveForApp !== appId) {
252246 lockscreen.show();
253247 }
254248 greeter.hide();
255− stages.show(true);
249+ stages.show();
256250 }
257251
258252 onFocusedApplicationIdChanged: {
259253 if (greeter.fakeActiveForApp !== "" && greeter.fakeActiveForApp !== ApplicationManager.focusedApplicationId) {
260254 lockscreen.show();
261255 }
262− if (ApplicationManager.focusedApplicationId.length > 0) {
263− stages.show(false);
264− } else {
265− if (!stages.overlayMode) {
266− stages.hide();
267− }
268− }
256+ panel.indicators.hide();
269257 }
270258
271259 onApplicationAdded: {
272− stages.show(false);
273− }
274−
275− onApplicationRemoved: {
276− if (ApplicationManager.focusedApplicationId.length == 0) {
277− stages.hide();
278− }
279− }
280− }
281−
282− property bool dialogShown: false
283−
284− Component {
285− id: logoutDialog
286− Dialog {
287− id: dialogueLogout
288− title: "Logout"
289− text: "Are you sure that you want to logout?"
290− Button {
291− text: "Cancel"
292− onClicked: {
293− PopupUtils.close(dialogueLogout);
294− stages.dialogShown = false;
295− }
296− }
297− Button {
298− text: "Yes"
299− onClicked: {
300− DBusUnitySessionService.Logout();
301− PopupUtils.close(dialogueLogout);
302− stages.dialogShown = false;
303− }
304− }
305− }
306− }
307−
308− Component {
309− id: shutdownDialog
310− Dialog {
311− id: dialogueShutdown
312− title: "Shutdown"
313− text: "Are you sure that you want to shutdown?"
314− Button {
315− text: "Cancel"
316− onClicked: {
317− PopupUtils.close(dialogueShutdown);
318− stages.dialogShown = false;
319− }
320− }
321− Button {
322− text: "Yes"
323− onClicked: {
324− dBusUnitySessionServiceConnection.closeAllApps();
325− DBusUnitySessionService.Shutdown();
326− PopupUtils.close(dialogueShutdown);
327− stages.dialogShown = false;
328− }
329− }
330− }
331− }
332−
333− Component {
334− id: rebootDialog
335− Dialog {
336− id: dialogueReboot
337− title: "Reboot"
338− text: "Are you sure that you want to reboot?"
339− Button {
340− text: "Cancel"
341− onClicked: {
342− PopupUtils.close(dialogueReboot)
343− stages.dialogShown = false;
344− }
345− }
346− Button {
347− text: "Yes"
348− onClicked: {
349− dBusUnitySessionServiceConnection.closeAllApps();
350− DBusUnitySessionService.Reboot();
351− PopupUtils.close(dialogueReboot);
352− stages.dialogShown = false;
353− }
354− }
355− }
356− }
357−
358− Component {
359− id: powerDialog
360− Dialog {
361− id: dialoguePower
362− title: "Power"
363− text: i18n.tr("Are you sure you would like to turn power off?")
364− Button {
365− text: i18n.tr("Power off")
366− onClicked: {
367− dBusUnitySessionServiceConnection.closeAllApps();
368− PopupUtils.close(dialoguePower);
369− stages.dialogShown = false;
370− shutdownFadeOutRectangle.enabled = true;
371− shutdownFadeOutRectangle.visible = true;
372− shutdownFadeOut.start();
373− }
374− }
375− Button {
376− text: i18n.tr("Restart")
377− onClicked: {
378− dBusUnitySessionServiceConnection.closeAllApps();
379− DBusUnitySessionService.Reboot();
380− PopupUtils.close(dialoguePower);
381− stages.dialogShown = false;
382− }
383− }
384− Button {
385− text: i18n.tr("Cancel")
386− onClicked: {
387− PopupUtils.close(dialoguePower);
388− stages.dialogShown = false;
389− }
390− }
391− }
392− }
393−
394− function showPowerDialog() {
395− if (!stages.dialogShown) {
396− stages.dialogShown = true;
397− PopupUtils.open(powerDialog);
398− }
399− }
400−
401− Connections {
402− id: dBusUnitySessionServiceConnection
403− objectName: "dBusUnitySessionServiceConnection"
404− target: DBusUnitySessionService
405−
406− function closeAllApps() {
407− while (true) {
408− var app = ApplicationManager.get(0);
409− if (app === null) {
410− break;
411− }
412− ApplicationManager.stopApplication(app.appId);
413− }
414− }
415−
416− onLogoutRequested: {
417− // Display a dialog to ask the user to confirm.
418− if (!stages.dialogShown) {
419− stages.dialogShown = true;
420− PopupUtils.open(logoutDialog);
260+ if (greeter.shown) {
261+ greeter.hide();
421262 }
422− }
423−
424− onShutdownRequested: {
425− // Display a dialog to ask the user to confirm.
426− if (!stages.dialogShown) {
427− stages.dialogShown = true;
428− PopupUtils.open(shutdownDialog);
263+ if (!stages.shown) {
264+ stages.show();
429265 }
430266 }
431267
432− onRebootRequested: {
433− // Display a dialog to ask the user to confirm.
434− if (!stages.dialogShown) {
435− stages.dialogShown = true;
436− PopupUtils.open(rebootDialog);
268+ onEmptyChanged: {
269+ if (ApplicationManager.empty) {
270+ stages.hide();
437271 }
438272 }
439−
440− onLogoutReady: {
441− closeAllApps();
442− Qt.quit();
443− }
444273 }
445274
446275 Loader {
447276 id: applicationsDisplayLoader
448277 anchors.fill: parent
449278
450− source: shell.sideStageEnabled ? "Stages/StageWithSideStage.qml" : "Stages/PhoneStage.qml"
279+ source: shell.sideStageEnabled ? "Stages/TabletStage.qml" : "Stages/PhoneStage.qml"
451280
452281 Binding {
453282 target: applicationsDisplayLoader.item
@@ -456,18 +285,20 @@ FocusScope {
456285 }
457286 Binding {
458287 target: applicationsDisplayLoader.item
459− property: "moving"
460− value: !stages.fullyShown
288+ property: "dragAreaWidth"
289+ value: shell.edgeSize
461290 }
462291 Binding {
463292 target: applicationsDisplayLoader.item
464− property: "shown"
465− value: stages.shown
293+ property: "maximizedAppTopMargin"
294+ // Not just using panel.panelHeight as that changes depending on the focused app.
295+ value: panel.indicators.panelHeight
466296 }
467297 Binding {
468298 target: applicationsDisplayLoader.item
469− property: "dragAreaWidth"
470− value: shell.edgeSize
299+ property: "interactive"
300+ value: stages.roughlyFullyShown && !greeter.shown && !lockscreen.shown
301+ && panel.indicators.fullyClosed
471302 }
472303 Binding {
473304 target: applicationsDisplayLoader.item
@@ -477,6 +308,33 @@ FocusScope {
477308 }
478309 }
479310
311+ InputMethod {
312+ id: inputMethod
313+ objectName: "inputMethod"
314+ anchors { fill: parent; topMargin: panel.panelHeight }
315+ z: notifications.useModal || panel.indicators.shown ? overlay.z + 1 : overlay.z - 1
316+ }
317+
318+ Connections {
319+ target: SurfaceManager
320+ onSurfaceCreated: {
321+ if (surface.type == MirSurfaceItem.InputMethod) {
322+ inputMethod.surface = surface;
323+ }
324+ }
325+
326+ onSurfaceDestroyed: {
327+ if (inputMethod.surface == surface) {
328+ inputMethod.surface = null;
329+ surface.parent = null;
330+ }
331+ if (!surface.parent) {
332+ // there's no one displaying it. delete it right away
333+ surface.release();
334+ }
335+ }
336+ }
337+
480338 Lockscreen {
481339 id: lockscreen
482340 objectName: "lockscreen"
@@ -489,7 +347,7 @@ FocusScope {
489347 showAnimation: StandardAnimation { property: "opacity"; to: 1 }
490348 hideAnimation: StandardAnimation { property: "opacity"; to: 0 }
491349 y: panel.panelHeight
492− x: required ? 0 : - width
350+ visible: required
493351 width: parent.width
494352 height: parent.height - panel.panelHeight
495353 background: shell.background
@@ -535,7 +393,7 @@ FocusScope {
535393 }
536394
537395 onPromptlessChanged: {
538− if (LightDM.Greeter.promptless) {
396+ if (LightDM.Greeter.promptless && LightDM.Greeter.authenticated) {
539397 lockscreen.hide()
540398 } else {
541399 lockscreen.reset();
@@ -601,8 +459,9 @@ FocusScope {
601459 StandardAnimation {}
602460 }
603461
462+ property bool fullyShown: showProgress === 1.0
604463 readonly property real showProgress: MathUtils.clamp((1 - x/width) + greeter.showProgress - 1, 0, 1)
605− onShowProgressChanged: if (LightDM.Greeter.promptless && showProgress === 0) greeter.login()
464+ onShowProgressChanged: if (LightDM.Greeter.authenticated && showProgress === 0) greeter.login()
606465
607466 Greeter {
608467 id: greeter
@@ -639,7 +498,7 @@ FocusScope {
639498 if (greeter.narrowMode) {
640499 LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole));
641500 }
642− if (!LightDM.Greeter.promptless) {
501+ if (!LightDM.Greeter.authenticated) {
643502 lockscreen.reset();
644503 lockscreen.show();
645504 }
@@ -666,12 +525,6 @@ FocusScope {
666525 }
667526 }
668527
669− InputFilterArea {
670− anchors.fill: parent
671− blockInput: ApplicationManager.focusedApplicationId.length === 0 || greeter.shown || lockscreen.shown || launcher.shown
672− || panel.indicators.shown
673− }
674−
675528 Connections {
676529 id: powerConnection
677530 target: Powerd
@@ -698,7 +551,7 @@ FocusScope {
698551 }
699552
700553 if (LightDM.Greeter.active) {
701− if (!LightDM.Greeter.promptless) {
554+ if (!LightDM.Greeter.authenticated) {
702555 lockscreen.show()
703556 }
704557 greeter.hide()
@@ -710,11 +563,11 @@ FocusScope {
710563 }
711564
712565 function showDash() {
713− if (LightDM.Greeter.active && !LightDM.Greeter.promptless) {
566+ if (LightDM.Greeter.active && !LightDM.Greeter.authenticated) {
714567 return;
715568 }
716569
717− if (stages.shown && !stages.overlayMode && !stages.locked) {
570+ if (!stages.locked) {
718571 stages.hide();
719572 launcher.fadeOut();
720573 } else {
@@ -729,6 +582,7 @@ FocusScope {
729582
730583 Item {
731584 id: overlay
585+ z: 10
732586
733587 anchors.fill: parent
734588
@@ -743,29 +597,13 @@ FocusScope {
743597 width: parent.width > units.gu(60) ? units.gu(40) : parent.width
744598 panelHeight: units.gu(3)
745599 }
746− property string focusedAppId: ApplicationManager.focusedApplicationId
747− property var focusedApplication: ApplicationManager.findApplication(focusedAppId)
748− fullscreenMode: (focusedApplication && stages.fullscreen && !LightDM.Greeter.active) || greeter.fakeActiveForApp !== ""
749600
750− InputFilterArea {
751− anchors {
752− top: parent.top
753− left: parent.left
754− right: parent.right
755− }
756− height: (panel.fullscreenMode) ? shell.edgeSize : panel.panelHeight
757− blockInput: true
758− }
759− }
601+ property bool topmostApplicationIsFullscreen:
602+ ApplicationManager.focusedApplicationId &&
603+ ApplicationManager.findApplication(ApplicationManager.focusedApplicationId).fullscreen
760604
761− InputFilterArea {
762− blockInput: launcher.shown
763− anchors {
764− top: parent.top
765− bottom: parent.bottom
766− left: parent.left
767− }
768− width: launcher.width
605+ fullscreenMode: (stages.roughlyFullyShown && topmostApplicationIsFullscreen
606+ && !LightDM.Greeter.active) || greeter.fakeActiveForApp !== ""
769607 }
770608
771609 Launcher {
@@ -808,11 +646,6 @@ FocusScope {
808646 MouseArea {
809647 anchors.fill: parent
810648 }
811−
812− InputFilterArea {
813− anchors.fill: parent
814− blockInput: modalNotificationBackground.visible
815− }
816649 }
817650
818651 Notifications {
@@ -838,36 +671,7 @@ FocusScope {
838671 PropertyChanges { target: notifications; width: units.gu(38) }
839672 }
840673 ]
841−
842− InputFilterArea {
843− anchors { left: parent.left; right: parent.right }
844− height: parent.contentHeight
845− blockInput: height > 0
846− }
847− }
848− }
849−
850− focus: true
851− onFocusChanged: if (!focus) forceActiveFocus();
852−
853− InputFilterArea {
854− anchors {
855− top: parent.top
856− bottom: parent.bottom
857− left: parent.left
858− }
859− width: shell.edgeSize
860− blockInput: true
861− }
862−
863− InputFilterArea {
864− anchors {
865− top: parent.top
866− bottom: parent.bottom
867− right: parent.right
868674 }
869− width: shell.edgeSize
870− blockInput: true
871675 }
872676
873677 Binding {
@@ -876,24 +680,22 @@ FocusScope {
876680 value: "unity8"
877681 }
878682
879− OSKController {
880− anchors.topMargin: panel.panelHeight
881− anchors.fill: parent // as needs to know the geometry of the shell
882− }
883−
884− //FIXME: This should be handled in the input stack, keyboard shouldnt propagate
885− MouseArea {
886− anchors.bottom: parent.bottom
887− anchors.left: parent.left
888− anchors.right: parent.right
889− height: ApplicationManager.keyboardVisible ? ApplicationManager.keyboardHeight : 0
890−
891− enabled: ApplicationManager.keyboardVisible
683+ Dialogs {
684+ id: dialogs
685+ anchors.fill: parent
686+ z: overlay.z + 10
687+ onPowerOffClicked: {
688+ shutdownFadeOutRectangle.enabled = true;
689+ shutdownFadeOutRectangle.visible = true;
690+ shutdownFadeOut.start();
691+ }
892692 }
893693
894694 Label {
695+ id: alphaDisclaimerLabel
895696 anchors.centerIn: parent
896697 visible: ApplicationManager.fake ? ApplicationManager.fake : false
698+ z: dialogs.z + 10
897699 text: "EARLY ALPHA\nNOT READY FOR USE"
898700 color: "lightgrey"
899701 opacity: 0.2
@@ -907,6 +709,7 @@ FocusScope {
907709
908710 EdgeDemo {
909711 id: edgeDemo
712+ z: alphaDisclaimerLabel.z + 10
910713 greeter: greeter
911714 launcher: launcher
912715 dash: dash
@@ -919,35 +722,9 @@ FocusScope {
919722 onShowHome: showHome()
920723 }
921724
922− Keys.onPressed: {
923− if (event.key == Qt.Key_PowerOff || event.key == Qt.Key_PowerDown) {
924− if (!powerKeyTimer.running) {
925− powerKeyTimer.start();
926− }
927− event.accepted = true;
928− }
929− }
930−
931− Keys.onReleased: {
932− if (event.key == Qt.Key_PowerOff || event.key == Qt.Key_PowerDown) {
933− powerKeyTimer.stop();
934− event.accepted = true;
935− }
936− }
937−
938− Timer {
939− id: powerKeyTimer
940− interval: 2000
941− repeat: false
942− triggeredOnStart: false
943−
944− onTriggered: {
945− stages.showPowerDialog();
946− }
947− }
948−
949725 Rectangle {
950726 id: shutdownFadeOutRectangle
727+ z: edgeDemo.z + 10
951728 enabled: false
952729 visible: false
953730 color: "black"
@@ -964,4 +741,5 @@ FocusScope {
964741 }
965742 }
966743 }
744+
967745}