SessionMenu: remove lock & suspend option, add toggle in general tab to

decide if lockscreen is used or not
This commit is contained in:
lysec
2025-10-18 14:08:51 +02:00
parent 5fa1481780
commit 6ba3b465de
5 changed files with 44 additions and 10 deletions
+7 -9
View File
@@ -14,7 +14,7 @@ NPanel {
id: root
preferredWidth: 320 * Style.uiScaleRatio
preferredHeight: 360 * Style.uiScaleRatio
preferredHeight: 280 * Style.uiScaleRatio
panelAnchorHorizontalCenter: true
panelAnchorVerticalCenter: true
panelKeyboardFocus: true
@@ -31,10 +31,6 @@ NPanel {
"action": "lock",
"icon": "lock",
"title": I18n.tr("session-menu.lock")
}, {
"action": "lockAndSuspend",
"icon": "lock-pause",
"title": I18n.tr("session-menu.lock-and-suspend")
}, {
"action": "suspend",
"icon": "suspend",
@@ -96,11 +92,13 @@ NPanel {
lockScreen.active = true
}
break
case "lockAndSuspend":
CompositorService.lockAndSuspend()
break
case "suspend":
CompositorService.suspend()
// Check if we should lock before suspending
if (Settings.data.general.lockOnSuspend) {
CompositorService.lockAndSuspend()
} else {
CompositorService.suspend()
}
break
case "reboot":
CompositorService.reboot()