Expose sleep and hibernate actions in the lock screen

kscreenlocker implements sleep and hibernate requests, but they aren't
wired anywhere in. Besides that, it can be useful to have a quick way to
suspend or hibernate computer from lockscreen.
wilder-5.24
Vlad Zahorodnii 4 years ago
parent 0bf22ff9b7
commit c78d50fb5c
  1. 10
      lookandfeel/contents/lockscreen/LockScreen.qml
  2. 14
      lookandfeel/contents/lockscreen/LockScreenUi.qml

@ -12,12 +12,20 @@ import "../components"
Item {
id: root
property bool viewVisible: false
property bool debug: false
property string notification
property int interfaceVersion: org_kde_plasma_screenlocker_greeter_interfaceVersion ? org_kde_plasma_screenlocker_greeter_interfaceVersion : 0
signal clearPassword()
// These are magical properties that kscreenlocker looks for
property bool viewVisible: false
property bool suspendToRamSupported: false
property bool suspendToDiskSupported: false
// These are magical signals that kscreenlocker looks for
signal suspendToDisk()
signal suspendToRam()
LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft
LayoutMirroring.childrenInherit: true

@ -255,6 +255,20 @@ PlasmaCore.ColorScope {
}
actionItems: [
ActionButton {
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Sleep")
iconSource: "system-suspend"
onClicked: root.suspendToRam()
visible: root.suspendToRamSupported
anchors.verticalCenter: parent.top
},
ActionButton {
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Hibernate")
iconSource: "system-suspend-hibernate"
onClicked: root.suspendToDisk()
visible: root.suspendToDiskSupported
anchors.verticalCenter: parent.top
},
ActionButton {
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Switch User")
iconSource: "system-switch-user"

Loading…
Cancel
Save