From ccefa20ae859bf4ee6f0006be4e54f368ea9aed8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kre=C5=A1imir=20=C4=8Cohar?= Date: Thu, 14 Feb 2019 13:33:26 +0100 Subject: [PATCH] [sddm-theme] Add buttons to username prompt to make it a full-fledged login screen alternative Summary: This patch adds the buttons Suspend, Restart, and Shut Down to the username prompt screen that appears once the Type User button is clicked so the user is able to suspend/restart/shut down from that screen without having to return to the initial login screen. It also replaces the "Back" button with "List Users" (and an appropriate icon) on account of the latter being a more accurate description of what the screen goes back to once the button is clicked (and in case of future improvements, enables it to become a standalone login screen as well). Test Plan: Before: {F6605023} After: {F6605026} Reviewers: #vdg, #plasma, filipf, davidedmundson, ngraham Reviewed By: #vdg, #plasma, filipf, davidedmundson, ngraham Subscribers: abetts, davidedmundson, ngraham, filipf, plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D18893 --- sddm-theme/Main.qml | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/sddm-theme/Main.qml b/sddm-theme/Main.qml index 4cdf69c7b..d838b8874 100644 --- a/sddm-theme/Main.qml +++ b/sddm-theme/Main.qml @@ -347,9 +347,31 @@ PlasmaCore.ColorScope { actionItems: [ ActionButton { - iconSource: "go-previous" - text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Back") + iconSource: "system-suspend" + text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Suspend") + onClicked: sddm.suspend() + enabled: sddm.canSuspend + visible: !inputPanel.keyboardActive + }, + ActionButton { + iconSource: "system-reboot" + text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Restart") + onClicked: sddm.reboot() + enabled: sddm.canReboot + visible: !inputPanel.keyboardActive + }, + ActionButton { + iconSource: "system-shutdown" + text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Shut Down") + onClicked: sddm.powerOff() + enabled: sddm.canPowerOff + visible: !inputPanel.keyboardActive + }, + ActionButton { + iconSource: "system-switch-user" + text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","List Users") onClicked: mainStack.pop() + visible: !inputPanel.keyboardActive } ] }