mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
SessionMenu: remove lock & suspend option, add toggle in general tab to
decide if lockscreen is used or not
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -189,4 +189,28 @@ ColumnLayout {
|
||||
Layout.topMargin: Style.marginXL
|
||||
Layout.bottomMargin: Style.marginXL
|
||||
}
|
||||
|
||||
// Lock Screen
|
||||
ColumnLayout {
|
||||
spacing: Style.marginL
|
||||
Layout.fillWidth: true
|
||||
|
||||
NHeader {
|
||||
label: I18n.tr("settings.general.lockscreen.section.label")
|
||||
description: I18n.tr("settings.general.lockscreen.section.description")
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("settings.general.lockscreen.lock-on-suspend.label")
|
||||
description: I18n.tr("settings.general.lockscreen.lock-on-suspend.description")
|
||||
checked: Settings.data.general.lockOnSuspend
|
||||
onToggled: Settings.data.general.lockOnSuspend = checked
|
||||
}
|
||||
}
|
||||
|
||||
NDivider {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: Style.marginXL
|
||||
Layout.bottomMargin: Style.marginXL
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user