@@ -19,22 +19,23 @@ 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 Unity.Launcher 0.1
24+import Utils 0.1
2525import LightDM 0.1 as LightDM
2626import Powerd 0.1
2727import SessionBroadcast 0.1
28−import "Dash"
2928import "Greeter"
3029import "Launcher"
3130import "Panel"
3231import "Components"
3332import "Notifications"
33+import "Stages"
3434import Unity.Notifications 1.0 as NotificationBackend
3535import Unity.Session 0.1
36+import Unity.DashCommunicator 0.1
3637
37−FocusScope {
38+Item {
3839 id: shell
3940
4041 // this is only here to select the width / height of the window if not running fullscreen
@@ -47,22 +48,15 @@ FocusScope {
4748 property url background
4849 readonly property real panelHeight: panel.panelHeight
4950
50− property bool dashShown: dash.shown
51−
5251 property bool sideStageEnabled: shell.width >= units.gu(100)
5352 readonly property string focusedApplicationId: ApplicationManager.focusedApplicationId
5453
5554 function activateApplication(appId) {
5655 if (ApplicationManager.findApplication(appId)) {
5756 ApplicationManager.requestFocusApplication(appId);
58− stages.show(true);
59− if (stages.locked && ApplicationManager.focusedApplicationId == appId) {
60− applicationsDisplayLoader.item.select(appId);
61− }
6257 } else {
6358 var execFlags = shell.sideStageEnabled ? ApplicationManager.NoFlag : ApplicationManager.ForceMainStage;
6459 ApplicationManager.startApplication(appId, execFlags);
65− stages.show(false);
6660 }
6761 }
6862
@@ -89,105 +83,31 @@ FocusScope {
8983 id: volumeControl
9084 }
9185
92− Keys.onVolumeUpPressed: volumeControl.volumeUp()
93− Keys.onVolumeDownPressed: volumeControl.volumeDown()
94−
95− Item {
96− id: underlayClipper
97− anchors.fill: parent
98− anchors.rightMargin: stages.overlayWidth
99− clip: stages.overlayMode && !stages.painting
100−
101− InputFilterArea {
102− anchors.fill: parent
103− blockInput: parent.clip
104− }
105−
106− Item {
107− id: underlay
108− objectName: "underlay"
109− anchors.fill: parent
110− anchors.rightMargin: -parent.anchors.rightMargin
111−
112− // Whether the underlay is fully covered by opaque UI elements.
113− property bool fullyCovered: panel.indicators.fullyOpened && shell.width <= panel.indicators.width
114−
115− // Whether the user should see the topmost application surface (if there's one at all).
116− readonly property bool applicationSurfaceShouldBeSeen: stages.shown && !stages.painting && !stages.overlayMode
117−
118− // NB! Application surfaces are stacked behind the shell one. So they can only be seen by the user
119− // through the translucent parts of the shell surface.
120− visible: !fullyCovered && !applicationSurfaceShouldBeSeen
121−
122− Rectangle {
123− anchors.fill: parent
124− color: "black"
125− opacity: dash.disappearingAnimationProgress
126− }
127−
128− Image {
129− anchors.fill: dash
130− source: shell.width > shell.height ? "Dash/graphics/paper_landscape.png" : "Dash/graphics/paper_portrait.png"
131− fillMode: Image.PreserveAspectCrop
132− horizontalAlignment: Image.AlignRight
133− verticalAlignment: Image.AlignTop
134− }
135−
136− Dash {
137− id: dash
138− objectName: "dash"
139−
140− available: !LightDM.Greeter.active
141− hides: [stages, launcher, panel.indicators]
142− shown: disappearingAnimationProgress !== 1.0 && greeterWrapper.showProgress !== 1.0
143− enabled: disappearingAnimationProgress === 0.0 && greeterWrapper.showProgress === 0.0 && edgeDemo.dashEnabled
144−
145− anchors {
146− fill: parent
147− topMargin: panel.panelHeight
148− }
149−
150− contentScale: 1.0 - 0.2 * disappearingAnimationProgress
151− opacity: 1.0 - disappearingAnimationProgress
152− property real disappearingAnimationProgress: {
153− if (stages.overlayMode) {
154− return 0;
155− } else {
156− return stages.showProgress
157− }
158− }
159−
160− // FIXME: only necessary because stages.showProgress is not animated
161− Behavior on disappearingAnimationProgress { SmoothedAnimation { velocity: 5 }}
162− }
163− }
86+ DashCommunicator {
87+ id: dash
88+ objectName: "dashCommunicator"
16489 }
16590
166− EdgeDragArea {
167− id: stagesDragHandle
168− direction: Direction.Leftwards
169−
170− anchors { top: parent.top; right: parent.right; bottom: parent.bottom }
171− width: shell.edgeSize
91+ WindowKeysFilter {
92+ // Handle but do not filter out volume keys
93+ Keys.onVolumeUpPressed: { volumeControl.volumeUp(); event.accepted = false; }
94+ Keys.onVolumeDownPressed: { volumeControl.volumeDown(); event.accepted = false; }
17295
173− property real progress: stages.width
174−
175− onTouchXChanged: {
176− if (status == DirectionalDragArea.Recognized) {
177− if (ApplicationManager.count == 0) {
178− progress = Math.max(stages.width - stagesDragHandle.width + touchX, stages.width * .3)
179− } else {
180− progress = stages.width - stagesDragHandle.width + touchX
181− }
96+ Keys.onPressed: {
97+ if (event.key == Qt.Key_PowerOff || event.key == Qt.Key_PowerDown) {
98+ dialogs.onPowerKeyPressed();
99+ event.accepted = true;
100+ } else {
101+ event.accepted = false;
182102 }
183103 }
184104
185− onDraggingChanged: {
186− if (!dragging) {
187− if (ApplicationManager.count > 0 && progress < stages.width - units.gu(10)) {
188− stages.show(true)
189− }
190− stagesDragHandle.progress = stages.width;
105+ Keys.onReleased: {
106+ if (event.key == Qt.Key_PowerOff || event.key == Qt.Key_PowerDown) {
107+ dialogs.onPowerKeyReleased();
108+ event.accepted = true;
109+ } else {
110+ event.accepted = false;
191111 }
192112 }
193113 }
@@ -197,254 +117,36 @@ FocusScope {
197117 objectName: "stages"
198118 width: parent.width
199119 height: parent.height
200−
201− x: {
202− if (shown) {
203− if (overlayMode || locked || greeter.fakeActiveForApp !== "") {
204− return 0;
205− }
206− return launcher.progress
207− } else {
208− return stagesDragHandle.progress
209− }
210− }
211−
212− Behavior on x { SmoothedAnimation { velocity: 600; duration: UbuntuAnimation.FastDuration } }
213−
214− property bool shown: false
215−
216− property real showProgress: overlayMode ? 0 : MathUtils.clamp(1 - x / shell.width, 0, 1)
217−
218− property bool fullyShown: x == 0
219− property bool fullyHidden: x == width
220−
221− property bool painting: applicationsDisplayLoader.item ? applicationsDisplayLoader.item.painting : false
222− property bool fullscreen: applicationsDisplayLoader.item ? applicationsDisplayLoader.item.fullscreen : false
223− property bool overlayMode: applicationsDisplayLoader.item ? applicationsDisplayLoader.item.overlayMode : false
224− property int overlayWidth: applicationsDisplayLoader.item ? applicationsDisplayLoader.item.overlayWidth : false
225− property bool locked: applicationsDisplayLoader.item ? applicationsDisplayLoader.item.locked : false
226−
227− function show(focusApp) {
228− shown = true;
229− panel.indicators.hide();
230− edgeDemo.stopDemo();
231− greeter.hide();
232− if (!ApplicationManager.focusedApplicationId && ApplicationManager.count > 0 && focusApp) {
233− ApplicationManager.focusApplication(ApplicationManager.get(0).appId);
234− }
235− }
236−
237− function hide() {
238− shown = false;
239− if (ApplicationManager.focusedApplicationId) {
240− ApplicationManager.unfocusCurrentApplication();
241− }
242− }
120+ visible: !ApplicationManager.empty
243121
244122 Connections {
245123 target: ApplicationManager
246−
247124 onFocusRequested: {
248125 if (greeter.fakeActiveForApp !== "" && greeter.fakeActiveForApp !== appId) {
249126 lockscreen.show();
250127 }
251128 greeter.hide();
252− stages.show(true);
253129 }
254130
255131 onFocusedApplicationIdChanged: {
256132 if (greeter.fakeActiveForApp !== "" && greeter.fakeActiveForApp !== ApplicationManager.focusedApplicationId) {
257133 lockscreen.show();
258134 }
259− if (ApplicationManager.focusedApplicationId.length > 0) {
260− stages.show(false);
261− } else {
262− if (!stages.overlayMode) {
263− stages.hide();
264− }
265− }
135+ panel.indicators.hide();
266136 }
267137
268138 onApplicationAdded: {
269− stages.show(false);
270− }
271−
272− onApplicationRemoved: {
273− if (ApplicationManager.focusedApplicationId.length == 0) {
274− stages.hide();
275− }
276− }
277− }
278−
279− property bool dialogShown: false
280−
281− Component {
282− id: logoutDialog
283− Dialog {
284− id: dialogueLogout
285− title: "Logout"
286− text: "Are you sure that you want to logout?"
287− Button {
288− text: "Cancel"
289− onClicked: {
290− PopupUtils.close(dialogueLogout);
291− stages.dialogShown = false;
292− }
293− }
294− Button {
295− text: "Yes"
296− onClicked: {
297− DBusUnitySessionService.Logout();
298− PopupUtils.close(dialogueLogout);
299− stages.dialogShown = false;
300− }
301− }
302− }
303− }
304−
305− Component {
306− id: shutdownDialog
307− Dialog {
308− id: dialogueShutdown
309− title: "Shutdown"
310− text: "Are you sure that you want to shutdown?"
311− Button {
312− text: "Cancel"
313− onClicked: {
314− PopupUtils.close(dialogueShutdown);
315− stages.dialogShown = false;
316− }
317− }
318− Button {
319− text: "Yes"
320− onClicked: {
321− dBusUnitySessionServiceConnection.closeAllApps();
322− DBusUnitySessionService.Shutdown();
323− PopupUtils.close(dialogueShutdown);
324− stages.dialogShown = false;
325− }
326− }
327− }
328− }
329−
330− Component {
331− id: rebootDialog
332− Dialog {
333− id: dialogueReboot
334− title: "Reboot"
335− text: "Are you sure that you want to reboot?"
336− Button {
337− text: "Cancel"
338− onClicked: {
339− PopupUtils.close(dialogueReboot)
340− stages.dialogShown = false;
341− }
342− }
343− Button {
344− text: "Yes"
345− onClicked: {
346− dBusUnitySessionServiceConnection.closeAllApps();
347− DBusUnitySessionService.Reboot();
348− PopupUtils.close(dialogueReboot);
349− stages.dialogShown = false;
350− }
351− }
352− }
353− }
354−
355− Component {
356− id: powerDialog
357− Dialog {
358− id: dialoguePower
359− title: "Power"
360− text: i18n.tr("Are you sure you would like to turn power off?")
361− Button {
362− text: i18n.tr("Power off")
363− onClicked: {
364− dBusUnitySessionServiceConnection.closeAllApps();
365− PopupUtils.close(dialoguePower);
366− stages.dialogShown = false;
367− shutdownFadeOutRectangle.enabled = true;
368− shutdownFadeOutRectangle.visible = true;
369− shutdownFadeOut.start();
370− }
371− }
372− Button {
373− text: i18n.tr("Restart")
374− onClicked: {
375− dBusUnitySessionServiceConnection.closeAllApps();
376− DBusUnitySessionService.Reboot();
377− PopupUtils.close(dialoguePower);
378− stages.dialogShown = false;
379− }
380− }
381− Button {
382− text: i18n.tr("Cancel")
383− onClicked: {
384− PopupUtils.close(dialoguePower);
385− stages.dialogShown = false;
386− }
387− }
388− }
389− }
390−
391− function showPowerDialog() {
392− if (!stages.dialogShown) {
393− stages.dialogShown = true;
394− PopupUtils.open(powerDialog);
395− }
396− }
397−
398− Connections {
399− id: dBusUnitySessionServiceConnection
400− objectName: "dBusUnitySessionServiceConnection"
401− target: DBusUnitySessionService
402−
403− function closeAllApps() {
404− while (true) {
405− var app = ApplicationManager.get(0);
406− if (app === null) {
407− break;
408− }
409− ApplicationManager.stopApplication(app.appId);
410− }
411− }
412−
413− onLogoutRequested: {
414− // Display a dialog to ask the user to confirm.
415− if (!stages.dialogShown) {
416− stages.dialogShown = true;
417− PopupUtils.open(logoutDialog);
418− }
419− }
420−
421− onShutdownRequested: {
422− // Display a dialog to ask the user to confirm.
423− if (!stages.dialogShown) {
424− stages.dialogShown = true;
425− PopupUtils.open(shutdownDialog);
426− }
427− }
428−
429− onRebootRequested: {
430− // Display a dialog to ask the user to confirm.
431− if (!stages.dialogShown) {
432− stages.dialogShown = true;
433− PopupUtils.open(rebootDialog);
139+ if (greeter.shown && appId != "unity8-dash") {
140+ greeter.hide();
434141 }
435142 }
436−
437− onLogoutReady: {
438− closeAllApps();
439− Qt.quit();
440− }
441143 }
442144
443145 Loader {
444146 id: applicationsDisplayLoader
445147 anchors.fill: parent
446148
447− source: shell.sideStageEnabled ? "Stages/StageWithSideStage.qml" : "Stages/PhoneStage.qml"
149+ source: shell.sideStageEnabled ? "Stages/TabletStage.qml" : "Stages/PhoneStage.qml"
448150
449151 Binding {
450152 target: applicationsDisplayLoader.item
@@ -453,23 +155,56 @@ FocusScope {
453155 }
454156 Binding {
455157 target: applicationsDisplayLoader.item
456− property: "moving"
457− value: !stages.fullyShown
158+ property: "dragAreaWidth"
159+ value: shell.edgeSize
458160 }
459161 Binding {
460162 target: applicationsDisplayLoader.item
461− property: "shown"
462− value: stages.shown
163+ property: "maximizedAppTopMargin"
164+ // Not just using panel.panelHeight as that changes depending on the focused app.
165+ value: panel.indicators.panelHeight
463166 }
464167 Binding {
465168 target: applicationsDisplayLoader.item
466− property: "dragAreaWidth"
467− value: shell.edgeSize
169+ property: "interactive"
170+ value: edgeDemo.stagesEnabled && !greeter.shown && !lockscreen.shown && panel.indicators.fullyClosed && launcher.progress == 0
468171 }
469172 Binding {
470173 target: applicationsDisplayLoader.item
471174 property: "spreadEnabled"
472− value: greeter.fakeActiveForApp === "" // to support emergency dialer hack
175+ value: edgeDemo.stagesEnabled && greeter.fakeActiveForApp === "" // to support emergency dialer hack
176+ }
177+ Binding {
178+ target: applicationsDisplayLoader.item
179+ property: "inverseProgress"
180+ value: launcher.progress
181+ }
182+ }
183+ }
184+
185+ InputMethod {
186+ id: inputMethod
187+ objectName: "inputMethod"
188+ anchors { fill: parent; topMargin: panel.panelHeight }
189+ z: notifications.useModal || panel.indicators.shown ? overlay.z + 1 : overlay.z - 1
190+ }
191+
192+ Connections {
193+ target: SurfaceManager
194+ onSurfaceCreated: {
195+ if (surface.type == MirSurfaceItem.InputMethod) {
196+ inputMethod.surface = surface;
197+ }
198+ }
199+
200+ onSurfaceDestroyed: {
201+ if (inputMethod.surface == surface) {
202+ inputMethod.surface = null;
203+ surface.parent = null;
204+ }
205+ if (!surface.parent) {
206+ // there's no one displaying it. delete it right away
207+ surface.release();
473208 }
474209 }
475210 }
@@ -486,10 +221,11 @@ FocusScope {
486221 showAnimation: StandardAnimation { property: "opacity"; to: 1 }
487222 hideAnimation: StandardAnimation { property: "opacity"; to: 0 }
488223 y: panel.panelHeight
489− x: required ? 0 : - width
224+ visible: required
490225 width: parent.width
491226 height: parent.height - panel.panelHeight
492227 background: shell.background
228+ alphaNumeric: AccountsService.passwordDisplayHint === AccountsService.Keyboard
493229 minPinLength: 4
494230 maxPinLength: 4
495231
@@ -504,7 +240,7 @@ FocusScope {
504240 onShownChanged: if (shown) greeter.fakeActiveForApp = ""
505241
506242 Component.onCompleted: {
507− if (LightDM.Users.count == 1) {
243+ if (greeter.narrowMode) {
508244 LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole))
509245 }
510246 }
@@ -516,14 +252,17 @@ FocusScope {
516252 onShowGreeter: greeter.show()
517253
518254 onShowPrompt: {
519− if (LightDM.Users.count == 1) {
520− // TODO: There's no better way for now to determine if its a PIN or a passphrase.
521− if (text == "PIN") {
522− lockscreen.alphaNumeric = false
523− } else {
524− lockscreen.alphaNumeric = true
525− }
526− lockscreen.placeholderText = i18n.tr("Please enter %1").arg(text);
255+ if (greeter.narrowMode) {
256+ lockscreen.placeholderText = i18n.tr("Please enter %1").arg(text.toLowerCase());
257+ lockscreen.show();
258+ }
259+ }
260+
261+ onPromptlessChanged: {
262+ if (LightDM.Greeter.promptless) {
263+ lockscreen.hide()
264+ } else {
265+ lockscreen.reset();
527266 lockscreen.show();
528267 }
529268 }
@@ -537,6 +276,9 @@ FocusScope {
537276 greeter.login();
538277 } else {
539278 lockscreen.clear(true);
279+ if (greeter.narrowMode) {
280+ LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole))
281+ }
540282 }
541283 }
542284 }
@@ -566,6 +308,7 @@ FocusScope {
566308 StandardAnimation {}
567309 }
568310
311+ property bool fullyShown: showProgress === 1.0
569312 readonly property real showProgress: MathUtils.clamp((1 - x/width) + greeter.showProgress - 1, 0, 1)
570313 onShowProgressChanged: if (LightDM.Greeter.promptless && showProgress === 0) greeter.login()
571314
@@ -590,25 +333,24 @@ FocusScope {
590333
591334 function login() {
592335 enabled = false;
593− LightDM.Greeter.startSessionSync();
594− sessionStarted();
595− greeter.hide();
596− lockscreen.hide();
597− launcher.hide();
336+ if (LightDM.Greeter.startSessionSync()) {
337+ sessionStarted();
338+ greeter.hide();
339+ lockscreen.hide();
340+ launcher.hide();
341+ }
598342 enabled = true;
599343 }
600344
601345 onShownChanged: {
602346 if (shown) {
603− lockscreen.reset();
604− if (!LightDM.Greeter.promptless) {
605− lockscreen.show();
606− }
607− // If there is only one user, we start authenticating with that one here.
608− // If there are more users, the Greeter will handle that
609− if (LightDM.Users.count == 1) {
347+ if (greeter.narrowMode) {
610348 LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole));
611349 }
350+ if (!LightDM.Greeter.promptless) {
351+ lockscreen.reset();
352+ lockscreen.show();
353+ }
612354 greeter.fakeActiveForApp = "";
613355 greeter.forceActiveFocus();
614356 }
@@ -632,12 +374,6 @@ FocusScope {
632374 }
633375 }
634376
635− InputFilterArea {
636− anchors.fill: parent
637− blockInput: ApplicationManager.focusedApplicationId.length === 0 || greeter.shown || lockscreen.shown || launcher.shown
638− || panel.indicators.shown
639− }
640−
641377 Connections {
642378 id: powerConnection
643379 target: Powerd
@@ -645,7 +381,7 @@ FocusScope {
645381 onDisplayPowerStateChange: {
646382 // We ignore any display-off signals when the proximity sensor
647383 // is active. This usually indicates something like a phone call.
648− if (status == Powerd.Off && reason != Powerd.Proximity) {
384+ if (status == Powerd.Off && reason != Powerd.Proximity && !edgeDemo.running) {
649385 greeter.showNow();
650386 }
651387
@@ -672,29 +408,25 @@ FocusScope {
672408
673409 var animate = !LightDM.Greeter.active && !stages.shown
674410 dash.setCurrentScope("clickscope", animate, false)
675− stages.hide()
411+ ApplicationManager.requestFocusApplication("unity8-dash")
676412 }
677413
678414 function showDash() {
679415 if (LightDM.Greeter.active && !LightDM.Greeter.promptless) {
680416 return;
681417 }
682−
683− if (stages.shown && !stages.overlayMode && !stages.locked) {
684− stages.hide();
685− launcher.fadeOut();
686− } else {
687− launcher.switchToNextState("visible");
688− }
689−
690418 if (greeter.shown) {
691419 greeter.hideRight();
692420 launcher.fadeOut();
693421 }
422+
423+ ApplicationManager.requestFocusApplication("unity8-dash")
424+ launcher.fadeOut();
694425 }
695426
696427 Item {
697428 id: overlay
429+ z: 10
698430
699431 anchors.fill: parent
700432
@@ -709,29 +441,13 @@ FocusScope {
709441 width: parent.width > units.gu(60) ? units.gu(40) : parent.width
710442 panelHeight: units.gu(3)
711443 }
712− property string focusedAppId: ApplicationManager.focusedApplicationId
713− property var focusedApplication: ApplicationManager.findApplication(focusedAppId)
714− fullscreenMode: (focusedApplication && stages.fullscreen && !LightDM.Greeter.active) || greeter.fakeActiveForApp !== ""
715444
716− InputFilterArea {
717− anchors {
718− top: parent.top
719− left: parent.left
720− right: parent.right
721− }
722− height: (panel.fullscreenMode) ? shell.edgeSize : panel.panelHeight
723− blockInput: true
724− }
725− }
445+ property bool topmostApplicationIsFullscreen:
446+ ApplicationManager.focusedApplicationId &&
447+ ApplicationManager.findApplication(ApplicationManager.focusedApplicationId).fullscreen
726448
727− InputFilterArea {
728− blockInput: launcher.shown
729− anchors {
730− top: parent.top
731− bottom: parent.bottom
732− left: parent.left
733− }
734− width: launcher.width
449+ fullscreenMode: (topmostApplicationIsFullscreen && !LightDM.Greeter.active && launcher.progress == 0)
450+ || greeter.fakeActiveForApp !== ""
735451 }
736452
737453 Launcher {
@@ -748,7 +464,11 @@ FocusScope {
748464
749465 onShowDashHome: showHome()
750466 onDash: showDash()
751− onDashSwipeChanged: if (dashSwipe && stages.shown) dash.setCurrentScope("clickscope", false, true)
467+ onDashSwipeChanged: {
468+ if (dashSwipe && ApplicationManager.focusedApplicationId !== "unity8-dash") {
469+ dash.setCurrentScope("clickscope", false, true)
470+ }
471+ }
752472 onLauncherApplicationSelected: {
753473 if (greeter.fakeActiveForApp !== "") {
754474 lockscreen.show()
@@ -774,11 +494,6 @@ FocusScope {
774494 MouseArea {
775495 anchors.fill: parent
776496 }
777−
778− InputFilterArea {
779− anchors.fill: parent
780− blockInput: modalNotificationBackground.visible
781− }
782497 }
783498
784499 Notifications {
@@ -804,62 +519,31 @@ FocusScope {
804519 PropertyChanges { target: notifications; width: units.gu(38) }
805520 }
806521 ]
807−
808− InputFilterArea {
809− anchors { left: parent.left; right: parent.right }
810− height: parent.contentHeight
811− blockInput: height > 0
812− }
813522 }
814523 }
815524
816− focus: true
817− onFocusChanged: if (!focus) forceActiveFocus();
818−
819− InputFilterArea {
820− anchors {
821− top: parent.top
822− bottom: parent.bottom
823− left: parent.left
824− }
825− width: shell.edgeSize
826− blockInput: true
827− }
828−
829− InputFilterArea {
830− anchors {
831− top: parent.top
832− bottom: parent.bottom
833− right: parent.right
834− }
835− width: shell.edgeSize
836− blockInput: true
837− }
838−
839525 Binding {
840526 target: i18n
841527 property: "domain"
842528 value: "unity8"
843529 }
844530
845− OSKController {
846− anchors.topMargin: panel.panelHeight
847− anchors.fill: parent // as needs to know the geometry of the shell
848− }
849−
850− //FIXME: This should be handled in the input stack, keyboard shouldnt propagate
851− MouseArea {
852− anchors.bottom: parent.bottom
853− anchors.left: parent.left
854− anchors.right: parent.right
855− height: ApplicationManager.keyboardVisible ? ApplicationManager.keyboardHeight : 0
856−
857− enabled: ApplicationManager.keyboardVisible
531+ Dialogs {
532+ id: dialogs
533+ anchors.fill: parent
534+ z: overlay.z + 10
535+ onPowerOffClicked: {
536+ shutdownFadeOutRectangle.enabled = true;
537+ shutdownFadeOutRectangle.visible = true;
538+ shutdownFadeOut.start();
539+ }
858540 }
859541
860542 Label {
543+ id: alphaDisclaimerLabel
861544 anchors.centerIn: parent
862545 visible: ApplicationManager.fake ? ApplicationManager.fake : false
546+ z: dialogs.z + 10
863547 text: "EARLY ALPHA\nNOT READY FOR USE"
864548 color: "lightgrey"
865549 opacity: 0.2
@@ -873,11 +557,11 @@ FocusScope {
873557
874558 EdgeDemo {
875559 id: edgeDemo
560+ z: alphaDisclaimerLabel.z + 10
876561 greeter: greeter
877562 launcher: launcher
878− dash: dash
879563 indicators: panel.indicators
880− underlay: underlay
564+ stages: stages
881565 }
882566
883567 Connections {
@@ -885,35 +569,9 @@ FocusScope {
885569 onShowHome: showHome()
886570 }
887571
888− Keys.onPressed: {
889− if (event.key == Qt.Key_PowerOff || event.key == Qt.Key_PowerDown) {
890− if (!powerKeyTimer.running) {
891− powerKeyTimer.start();
892− }
893− event.accepted = true;
894− }
895− }
896−
897− Keys.onReleased: {
898− if (event.key == Qt.Key_PowerOff || event.key == Qt.Key_PowerDown) {
899− powerKeyTimer.stop();
900− event.accepted = true;
901− }
902− }
903−
904− Timer {
905− id: powerKeyTimer
906− interval: 2000
907− repeat: false
908− triggeredOnStart: false
909−
910− onTriggered: {
911− stages.showPowerDialog();
912− }
913− }
914−
915572 Rectangle {
916573 id: shutdownFadeOutRectangle
574+ z: edgeDemo.z + 10
917575 enabled: false
918576 visible: false
919577 color: "black"
@@ -930,4 +588,5 @@ FocusScope {
930588 }
931589 }
932590 }
591+
933592}