@@ -19,9 +19,9 @@ 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
@@ -31,10 +31,11 @@ import "Launcher"
3131import "Panel"
3232import "Components"
3333import "Notifications"
34+import "Stages"
3435import Unity.Notifications 1.0 as NotificationBackend
3536import Unity.Session 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,7 +48,7 @@ FocusScope {
4748 property url background
4849 readonly property real panelHeight: panel.panelHeight
4950
50− property bool dashShown: dash.shown
51+ property bool dashShown: dash.shown && dash.available && underlay.visible
5152
5253 property bool sideStageEnabled: shell.width >= units.gu(100)
5354 readonly property string focusedApplicationId: ApplicationManager.focusedApplicationId
@@ -55,14 +56,10 @@ FocusScope {
5556 function activateApplication(appId) {
5657 if (ApplicationManager.findApplication(appId)) {
5758 ApplicationManager.requestFocusApplication(appId);
58− stages.show(true);
59− if (stages.locked && ApplicationManager.focusedApplicationId == appId) {
60− applicationsDisplayLoader.item.select(appId);
61− }
6259 } else {
6360 var execFlags = shell.sideStageEnabled ? ApplicationManager.NoFlag : ApplicationManager.ForceMainStage;
6461 ApplicationManager.startApplication(appId, execFlags);
65− stages.show(false);
62+ stages.show();
6663 }
6764 }
6865
@@ -89,82 +86,74 @@ FocusScope {
8986 id: volumeControl
9087 }
9188
92− Keys.onVolumeUpPressed: volumeControl.volumeUp()
93− Keys.onVolumeDownPressed: volumeControl.volumeDown()
89+ WindowKeysFilter {
90+ // Handle but do not filter out volume keys
91+ Keys.onVolumeUpPressed: { volumeControl.volumeUp(); event.accepted = false; }
92+ Keys.onVolumeDownPressed: { volumeControl.volumeDown(); event.accepted = false; }
9493
95− Item {
96− id: underlayClipper
97− anchors.fill: parent
98− anchors.rightMargin: stages.overlayWidth
99− clip: stages.overlayMode && !stages.painting
94+ Keys.onPressed: {
95+ if (event.key == Qt.Key_PowerOff || event.key == Qt.Key_PowerDown) {
96+ dialogs.onPowerKeyPressed();
97+ event.accepted = true;
98+ } else {
99+ event.accepted = false;
100+ }
101+ }
100102
101− InputFilterArea {
102− anchors.fill: parent
103− blockInput: parent.clip
103+ Keys.onReleased: {
104+ if (event.key == Qt.Key_PowerOff || event.key == Qt.Key_PowerDown) {
105+ dialogs.onPowerKeyReleased();
106+ event.accepted = true;
107+ } else {
108+ event.accepted = false;
109+ }
104110 }
111+ }
105112
106− Item {
107− id: underlay
108− objectName: "underlay"
109− anchors.fill: parent
110− anchors.rightMargin: -parent.anchors.rightMargin
113+ Item {
114+ id: underlay
115+ objectName: "underlay"
116+ anchors.fill: parent
111117
112− // Whether the underlay is fully covered by opaque UI elements.
113− property bool fullyCovered: panel.indicators.fullyOpened && shell.width <= panel.indicators.width
118+ // Whether the underlay is fully covered by opaque UI elements.
119+ property bool fullyCovered: (panel.indicators.fullyOpened && shell.width <= panel.indicatorsMenuWidth)
120+ || stages.fullyShown || greeterWrapper.fullyShown
121+ visible: !fullyCovered
114122
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
123+ Image {
124+ anchors.fill: dash
125+ source: shell.width > shell.height ? "Dash/graphics/paper_landscape.png" : "Dash/graphics/paper_portrait.png"
126+ fillMode: Image.PreserveAspectCrop
127+ horizontalAlignment: Image.AlignRight
128+ verticalAlignment: Image.AlignTop
129+ }
117130
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
131+ Dash {
132+ id: dash
133+ objectName: "dash"
121134
122− Rectangle {
123− anchors.fill: parent
124− color: "black"
125− opacity: dash.disappearingAnimationProgress
126− }
135+ available: !LightDM.Greeter.active
136+ hides: [stages, launcher, panel.indicators]
137+ shown: disappearingAnimationProgress !== 1.0 && greeterWrapper.showProgress !== 1.0 &&
138+ !(panel.indicators.fullyOpened && !sideStageEnabled)
139+ enabled: disappearingAnimationProgress === 0.0 && greeterWrapper.showProgress === 0.0 && edgeDemo.dashEnabled
127140
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
141+ anchors {
142+ fill: parent
143+ topMargin: panel.panelHeight
134144 }
135145
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
146+ contentScale: 1.0 - 0.2 * disappearingAnimationProgress
147+ opacity: 1.0 - disappearingAnimationProgress
148+ property real disappearingAnimationProgress: stages.showProgress
144149
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− }
150+ // FIXME: only necessary because stages.showProgress is not animated
151+ Behavior on disappearingAnimationProgress { SmoothedAnimation { velocity: 5 }}
163152 }
164153 }
165154
166155 EdgeDragArea {
167− id: stagesDragHandle
156+ id: stagesDragArea
168157 direction: Direction.Leftwards
169158
170159 anchors { top: parent.top; right: parent.right; bottom: parent.bottom }
@@ -174,20 +163,20 @@ FocusScope {
174163
175164 onTouchXChanged: {
176165 if (status == DirectionalDragArea.Recognized) {
177− if (ApplicationManager.count == 0) {
178− progress = Math.max(stages.width - stagesDragHandle.width + touchX, stages.width * .3)
166+ if (ApplicationManager.empty) {
167+ progress = Math.max(stages.width - stagesDragArea.width + touchX, stages.width * .3);
179168 } else {
180− progress = stages.width - stagesDragHandle.width + touchX
169+ progress = stages.width - stagesDragArea.width + touchX;
181170 }
182171 }
183172 }
184173
185174 onDraggingChanged: {
186175 if (!dragging) {
187− if (ApplicationManager.count > 0 && progress < stages.width - units.gu(10)) {
188− stages.show(true)
176+ if (!ApplicationManager.empty && progress < stages.width - units.gu(10)) {
177+ stages.show();
189178 }
190− stagesDragHandle.progress = stages.width;
179+ stagesDragArea.progress = Qt.binding(function () { return stages.width; });
191180 }
192181 }
193182 }
@@ -198,253 +187,93 @@ FocusScope {
198187 width: parent.width
199188 height: parent.height
200189
190+ visible: !fullyHidden && !ApplicationManager.empty
191+
201192 x: {
202193 if (shown) {
203− if (overlayMode || locked || greeter.fakeActiveForApp !== "") {
194+ if (locked || greeter.fakeActiveForApp !== "") {
204195 return 0;
205196 }
206− return launcher.progress
197+ return launcher.progress;
207198 } else {
208− return stagesDragHandle.progress
199+ return stagesDragArea.progress
209200 }
210201 }
211−
212202 Behavior on x { SmoothedAnimation { velocity: 600; duration: UbuntuAnimation.FastDuration } }
213203
214204 property bool shown: false
205+ onShownChanged: {
206+ if (shown) {
207+ if (ApplicationManager.count > 0) {
208+ ApplicationManager.focusApplication(ApplicationManager.get(0).appId);
209+ }
210+ } else {
211+ if (ApplicationManager.focusedApplicationId) {
212+ ApplicationManager.updateScreenshot(ApplicationManager.focusedApplicationId);
213+ ApplicationManager.unfocusCurrentApplication();
214+ }
215+ }
216+ }
215217
216− property real showProgress: overlayMode ? 0 : MathUtils.clamp(1 - x / shell.width, 0, 1)
218+ // Avoid a silent "divide by zero -> NaN" situation during init as shell.width will be
219+ // zero. That breaks the property binding and the function won't be reevaluated once
220+ // shell.width is set, with the NaN result staying there for good.
221+ property real showProgress: shell.width ? MathUtils.clamp(1 - x / shell.width, 0, 1) : 0
217222
218223 property bool fullyShown: x == 0
219224 property bool fullyHidden: x == width
220225
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
225226 property bool locked: applicationsDisplayLoader.item ? applicationsDisplayLoader.item.locked : false
226227
227− function show(focusApp) {
228+ // It might technically not be fullyShown but visually it just looks so.
229+ property bool roughlyFullyShown: x >= 0 && x <= units.gu(1)
230+
231+ function show() {
228232 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− }
235233 }
236234
237235 function hide() {
238236 shown = false;
239− if (ApplicationManager.focusedApplicationId) {
240− ApplicationManager.unfocusCurrentApplication();
241− }
242237 }
243238
244239 Connections {
245240 target: ApplicationManager
246−
247241 onFocusRequested: {
248242 if (greeter.fakeActiveForApp !== "" && greeter.fakeActiveForApp !== appId) {
249243 lockscreen.show();
250244 }
251245 greeter.hide();
252− stages.show(true);
246+ stages.show();
253247 }
254248
255249 onFocusedApplicationIdChanged: {
256250 if (greeter.fakeActiveForApp !== "" && greeter.fakeActiveForApp !== ApplicationManager.focusedApplicationId) {
257251 lockscreen.show();
258252 }
259− if (ApplicationManager.focusedApplicationId.length > 0) {
260− stages.show(false);
261− } else {
262− if (!stages.overlayMode) {
263− stages.hide();
264− }
265− }
253+ panel.indicators.hide();
266254 }
267255
268256 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);
257+ if (greeter.shown) {
258+ greeter.hide();
410259 }
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);
260+ if (!stages.shown) {
261+ stages.show();
418262 }
419263 }
420264
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);
265+ onEmptyChanged: {
266+ if (ApplicationManager.empty) {
267+ stages.hide();
434268 }
435269 }
436−
437− onLogoutReady: {
438− closeAllApps();
439− Qt.quit();
440− }
441270 }
442271
443272 Loader {
444273 id: applicationsDisplayLoader
445274 anchors.fill: parent
446275
447− source: shell.sideStageEnabled ? "Stages/StageWithSideStage.qml" : "Stages/PhoneStage.qml"
276+ source: shell.sideStageEnabled ? "Stages/TabletStage.qml" : "Stages/PhoneStage.qml"
448277
449278 Binding {
450279 target: applicationsDisplayLoader.item
@@ -453,18 +282,20 @@ FocusScope {
453282 }
454283 Binding {
455284 target: applicationsDisplayLoader.item
456− property: "moving"
457− value: !stages.fullyShown
285+ property: "dragAreaWidth"
286+ value: shell.edgeSize
458287 }
459288 Binding {
460289 target: applicationsDisplayLoader.item
461− property: "shown"
462− value: stages.shown
290+ property: "maximizedAppTopMargin"
291+ // Not just using panel.panelHeight as that changes depending on the focused app.
292+ value: panel.indicators.panelHeight
463293 }
464294 Binding {
465295 target: applicationsDisplayLoader.item
466− property: "dragAreaWidth"
467− value: shell.edgeSize
296+ property: "interactive"
297+ value: stages.roughlyFullyShown && !greeter.shown && !lockscreen.shown
298+ && panel.indicators.fullyClosed
468299 }
469300 Binding {
470301 target: applicationsDisplayLoader.item
@@ -474,6 +305,33 @@ FocusScope {
474305 }
475306 }
476307
308+ InputMethod {
309+ id: inputMethod
310+ objectName: "inputMethod"
311+ anchors { fill: parent; topMargin: panel.panelHeight }
312+ z: notifications.useModal || panel.indicators.shown ? overlay.z + 1 : overlay.z - 1
313+ }
314+
315+ Connections {
316+ target: SurfaceManager
317+ onSurfaceCreated: {
318+ if (surface.type == MirSurfaceItem.InputMethod) {
319+ inputMethod.surface = surface;
320+ }
321+ }
322+
323+ onSurfaceDestroyed: {
324+ if (inputMethod.surface == surface) {
325+ inputMethod.surface = null;
326+ surface.parent = null;
327+ }
328+ if (!surface.parent) {
329+ // there's no one displaying it. delete it right away
330+ surface.release();
331+ }
332+ }
333+ }
334+
477335 Lockscreen {
478336 id: lockscreen
479337 objectName: "lockscreen"
@@ -486,7 +344,7 @@ FocusScope {
486344 showAnimation: StandardAnimation { property: "opacity"; to: 1 }
487345 hideAnimation: StandardAnimation { property: "opacity"; to: 0 }
488346 y: panel.panelHeight
489− x: required ? 0 : - width
347+ visible: required
490348 width: parent.width
491349 height: parent.height - panel.panelHeight
492350 background: shell.background
@@ -566,6 +424,7 @@ FocusScope {
566424 StandardAnimation {}
567425 }
568426
427+ property bool fullyShown: showProgress === 1.0
569428 readonly property real showProgress: MathUtils.clamp((1 - x/width) + greeter.showProgress - 1, 0, 1)
570429 onShowProgressChanged: if (LightDM.Greeter.promptless && showProgress === 0) greeter.login()
571430
@@ -632,12 +491,6 @@ FocusScope {
632491 }
633492 }
634493
635− InputFilterArea {
636− anchors.fill: parent
637− blockInput: ApplicationManager.focusedApplicationId.length === 0 || greeter.shown || lockscreen.shown || launcher.shown
638− || panel.indicators.shown
639− }
640−
641494 Connections {
642495 id: powerConnection
643496 target: Powerd
@@ -680,7 +533,7 @@ FocusScope {
680533 return;
681534 }
682535
683− if (stages.shown && !stages.overlayMode && !stages.locked) {
536+ if (!stages.locked) {
684537 stages.hide();
685538 launcher.fadeOut();
686539 } else {
@@ -695,6 +548,7 @@ FocusScope {
695548
696549 Item {
697550 id: overlay
551+ z: 10
698552
699553 anchors.fill: parent
700554
@@ -709,29 +563,13 @@ FocusScope {
709563 width: parent.width > units.gu(60) ? units.gu(40) : parent.width
710564 panelHeight: units.gu(3)
711565 }
712− property string focusedAppId: ApplicationManager.focusedApplicationId
713− property var focusedApplication: ApplicationManager.findApplication(focusedAppId)
714− fullscreenMode: (focusedApplication && stages.fullscreen && !LightDM.Greeter.active) || greeter.fakeActiveForApp !== ""
715566
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− }
567+ property bool topmostApplicationIsFullscreen:
568+ ApplicationManager.focusedApplicationId &&
569+ ApplicationManager.findApplication(ApplicationManager.focusedApplicationId).fullscreen
726570
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
571+ fullscreenMode: (stages.roughlyFullyShown && topmostApplicationIsFullscreen
572+ && !LightDM.Greeter.active) || greeter.fakeActiveForApp !== ""
735573 }
736574
737575 Launcher {
@@ -774,11 +612,6 @@ FocusScope {
774612 MouseArea {
775613 anchors.fill: parent
776614 }
777−
778− InputFilterArea {
779− anchors.fill: parent
780− blockInput: modalNotificationBackground.visible
781− }
782615 }
783616
784617 Notifications {
@@ -804,36 +637,7 @@ FocusScope {
804637 PropertyChanges { target: notifications; width: units.gu(38) }
805638 }
806639 ]
807−
808− InputFilterArea {
809− anchors { left: parent.left; right: parent.right }
810− height: parent.contentHeight
811− blockInput: height > 0
812− }
813− }
814− }
815−
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
834640 }
835− width: shell.edgeSize
836− blockInput: true
837641 }
838642
839643 Binding {
@@ -842,24 +646,22 @@ FocusScope {
842646 value: "unity8"
843647 }
844648
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
649+ Dialogs {
650+ id: dialogs
651+ anchors.fill: parent
652+ z: overlay.z + 10
653+ onPowerOffClicked: {
654+ shutdownFadeOutRectangle.enabled = true;
655+ shutdownFadeOutRectangle.visible = true;
656+ shutdownFadeOut.start();
657+ }
858658 }
859659
860660 Label {
661+ id: alphaDisclaimerLabel
861662 anchors.centerIn: parent
862663 visible: ApplicationManager.fake ? ApplicationManager.fake : false
664+ z: dialogs.z + 10
863665 text: "EARLY ALPHA\nNOT READY FOR USE"
864666 color: "lightgrey"
865667 opacity: 0.2
@@ -873,6 +675,7 @@ FocusScope {
873675
874676 EdgeDemo {
875677 id: edgeDemo
678+ z: alphaDisclaimerLabel.z + 10
876679 greeter: greeter
877680 launcher: launcher
878681 dash: dash
@@ -885,35 +688,9 @@ FocusScope {
885688 onShowHome: showHome()
886689 }
887690
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−
915691 Rectangle {
916692 id: shutdownFadeOutRectangle
693+ z: edgeDemo.z + 10
917694 enabled: false
918695 visible: false
919696 color: "black"
@@ -930,4 +707,5 @@ FocusScope {
930707 }
931708 }
932709 }
710+
933711}