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:
@@ -32,6 +32,16 @@
|
||||
"reset": "Reset screen corners radius"
|
||||
}
|
||||
},
|
||||
"lockscreen": {
|
||||
"section": {
|
||||
"label": "Lock screen",
|
||||
"description": "Configure lock screen behavior."
|
||||
},
|
||||
"lock-on-suspend": {
|
||||
"label": "Lock on suspend",
|
||||
"description": "Automatically lock the screen when suspending the system."
|
||||
}
|
||||
},
|
||||
"fonts": {
|
||||
"reset-scaling": "Reset scaling",
|
||||
"section": {
|
||||
|
||||
@@ -65,7 +65,8 @@
|
||||
"screenRadiusRatio": 1,
|
||||
"animationSpeed": 1,
|
||||
"animationDisabled": false,
|
||||
"compactLockScreen": false
|
||||
"compactLockScreen": false,
|
||||
"lockOnSuspend": true
|
||||
},
|
||||
"location": {
|
||||
"name": "Tokyo",
|
||||
|
||||
@@ -191,6 +191,7 @@ Singleton {
|
||||
property real animationSpeed: 1.0
|
||||
property bool animationDisabled: false
|
||||
property bool compactLockScreen: false
|
||||
property bool lockOnSuspend: true
|
||||
}
|
||||
|
||||
// location
|
||||
|
||||
@@ -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