@@ -355,9 +355,11 @@ FocusScope {
355355 text: i18n.tr("Power off")
356356 onClicked: {
357357 dBusUnitySessionServiceConnection.closeAllApps();
358− DBusUnitySessionService.Shutdown();
359358 PopupUtils.close(dialoguePower);
360359 stages.dialogShown = false;
360+ shutdownFadeOutRectangle.enabled = true;
361+ shutdownFadeOutRectangle.visible = true;
362+ shutdownFadeOut.start();
361363 }
362364 }
363365 Button {
@@ -821,7 +823,7 @@ FocusScope {
821823 }
822824
823825 Keys.onPressed: {
824− if (event.key == Qt.Key_PowerOff || event.key == Qt.Key_PowerDown) {
826+ if (event.key == Qt.Key_PowerOff || event.key == Qt.Key_PowerDown || event.key == Qt.Key_A) {
825827 if (!powerKeyTimer.running) {
826828 powerKeyTimer.start();
827829 }
@@ -846,4 +848,23 @@ FocusScope {
846848 stages.showPowerDialog();
847849 }
848850 }
851+
852+ Rectangle {
853+ id: shutdownFadeOutRectangle
854+ enabled: false
855+ visible: false
856+ color: "black"
857+ anchors.fill: parent
858+ opacity: 0.0
859+ NumberAnimation on opacity {
860+ id: shutdownFadeOut
861+ from: 0.0
862+ to: 1.0
863+ onStopped: {
864+ if (shutdownFadeOutRectangle.enabled && shutdownFadeOutRectangle.visible) {
865+ DBusUnitySessionService.Shutdown();
866+ }
867+ }
868+ }
869+ }
849870}