mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-05-25 07:34:39 +00:00
SessionMenu: add lock & suspend option as requested in #301
This commit is contained in:
@@ -14,7 +14,7 @@ NPanel {
|
||||
id: root
|
||||
|
||||
preferredWidth: 440
|
||||
preferredHeight: 410
|
||||
preferredHeight: 480
|
||||
panelAnchorHorizontalCenter: true
|
||||
panelAnchorVerticalCenter: true
|
||||
panelKeyboardFocus: true
|
||||
@@ -32,6 +32,11 @@ NPanel {
|
||||
"icon": "lock",
|
||||
"title": I18n.tr("session-menu.lock"),
|
||||
"subtitle": I18n.tr("session-menu.lock-subtitle")
|
||||
}, {
|
||||
"action": "lockAndSuspend",
|
||||
"icon": "lock-pause",
|
||||
"title": I18n.tr("session-menu.lock-and-suspend"),
|
||||
"subtitle": I18n.tr("session-menu.lock-and-suspend-subtitle")
|
||||
}, {
|
||||
"action": "suspend",
|
||||
"icon": "suspend",
|
||||
@@ -97,6 +102,12 @@ NPanel {
|
||||
lockScreen.active = true
|
||||
}
|
||||
break
|
||||
case "lockAndSuspend":
|
||||
if (!lockScreen.active) {
|
||||
lockScreen.active = true
|
||||
}
|
||||
CompositorService.suspend()
|
||||
break
|
||||
case "suspend":
|
||||
CompositorService.suspend()
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user