From df1a8f40666411cd9484c50b945db2aef726cdb8 Mon Sep 17 00:00:00 2001 From: Pi Home Server Date: Fri, 12 Dec 2025 16:45:00 +0000 Subject: [PATCH] Add lock screen layout settings (#981) * Add lock screen layout settings * Update translation keys --- quickshell/Common/SettingsData.qml | 6 +++ quickshell/Common/settings/SettingsSpec.js | 5 +++ quickshell/Modules/Lock/LockScreenContent.qml | 6 +++ quickshell/Modules/Settings/LockScreenTab.qml | 42 +++++++++++++++++-- 4 files changed, 56 insertions(+), 3 deletions(-) diff --git a/quickshell/Common/SettingsData.qml b/quickshell/Common/SettingsData.qml index 551d68f4..9a399f03 100644 --- a/quickshell/Common/SettingsData.qml +++ b/quickshell/Common/SettingsData.qml @@ -311,6 +311,12 @@ Singleton { property bool modalDarkenBackground: true property bool lockScreenShowPowerActions: true + property bool lockScreenShowSystemIcons: true + property bool lockScreenShowTime: true + property bool lockScreenShowDate: true + property bool lockScreenShowProfileImage: true + property bool lockScreenShowPasswordField: true + property bool enableFprint: false property int maxFprintTries: 15 property bool fprintdAvailable: false diff --git a/quickshell/Common/settings/SettingsSpec.js b/quickshell/Common/settings/SettingsSpec.js index 0c54b856..a45054d4 100644 --- a/quickshell/Common/settings/SettingsSpec.js +++ b/quickshell/Common/settings/SettingsSpec.js @@ -210,6 +210,11 @@ var SPEC = { modalDarkenBackground: { def: true }, lockScreenShowPowerActions: { def: true }, + lockScreenShowSystemIcons: { def: true }, + lockScreenShowTime: { def: true }, + lockScreenShowDate: { def: true }, + lockScreenShowProfileImage: { def: true }, + lockScreenShowPasswordField: { def: true }, enableFprint: { def: false }, maxFprintTries: { def: 15 }, fprintdAvailable: { def: false, persist: false }, diff --git a/quickshell/Modules/Lock/LockScreenContent.qml b/quickshell/Modules/Lock/LockScreenContent.qml index 8f60d3ba..b64bd3e7 100644 --- a/quickshell/Modules/Lock/LockScreenContent.qml +++ b/quickshell/Modules/Lock/LockScreenContent.qml @@ -216,6 +216,7 @@ Item { anchors.verticalCenterOffset: -100 width: parent.width height: 140 + visible: SettingsData.lockScreenShowTime Row { id: clockText @@ -331,6 +332,7 @@ Item { StyledText { anchors.centerIn: parent anchors.verticalCenterOffset: -25 + visible: SettingsData.lockScreenShowDate text: { if (SettingsData.lockDateFormat && SettingsData.lockDateFormat.length > 0) { return systemClock.date.toLocaleDateString(Qt.locale(), SettingsData.lockDateFormat); @@ -368,6 +370,7 @@ Item { return PortalService.profileImage; } fallbackIcon: "person" + visible: SettingsData.lockScreenShowProfileImage } Rectangle { @@ -379,6 +382,8 @@ Item { color: Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g, Theme.surfaceContainer.b, 0.9) border.color: passwordField.activeFocus ? Theme.primary : Qt.rgba(1, 1, 1, 0.3) border.width: passwordField.activeFocus ? 2 : 1 + visible: SettingsData.lockScreenShowPasswordField || root.passwordBuffer.length > 0 + Item { id: lockIconContainer @@ -797,6 +802,7 @@ Item { anchors.right: parent.right anchors.margins: Theme.spacingXL spacing: Theme.spacingL + visible: SettingsData.lockScreenShowSystemIcons Item { width: keyboardLayoutRow.width diff --git a/quickshell/Modules/Settings/LockScreenTab.qml b/quickshell/Modules/Settings/LockScreenTab.qml index 13a4e370..28e93d98 100644 --- a/quickshell/Modules/Settings/LockScreenTab.qml +++ b/quickshell/Modules/Settings/LockScreenTab.qml @@ -23,15 +23,51 @@ Item { SettingsCard { width: parent.width iconName: "lock" - title: I18n.tr("Lock Screen") + title: I18n.tr("Lock Screen layout") SettingsToggleRow { - text: I18n.tr("Show Power Actions") - description: I18n.tr("Show power, restart, and logout buttons on the lock screen") + text: I18n.tr("Show Power Actions", "Enable power action icon on the lock screen window") checked: SettingsData.lockScreenShowPowerActions onToggled: checked => SettingsData.set("lockScreenShowPowerActions", checked) } + SettingsToggleRow { + text: I18n.tr("Show System Icons", "Enable system status icons on the lock screen window") + checked: SettingsData.lockScreenShowSystemIcons + onToggled: checked => SettingsData.set("lockScreenShowSystemIcons", checked) + } + + SettingsToggleRow { + text: I18n.tr("Show System Time", "Enable system time display on the lock screen window") + checked: SettingsData.lockScreenShowTime + onToggled: checked => SettingsData.set("lockScreenShowTime", checked) + } + + SettingsToggleRow { + text: I18n.tr("Show System Date", "Enable system date display on the lock screen window") + checked: SettingsData.lockScreenShowDate + onToggled: checked => SettingsData.set("lockScreenShowDate", checked) + } + + SettingsToggleRow { + text: I18n.tr("Show Profile Image", "Enable profile image display on the lock screen window") + checked: SettingsData.lockScreenShowProfileImage + onToggled: checked => SettingsData.set("lockScreenShowProfileImage", checked) + } + + SettingsToggleRow { + text: I18n.tr("Show Password Field", "Enable password field display on the lock screen window") + description: I18n.tr("If the field is hidden, it will appear as soon as a key is pressed.") + checked: SettingsData.lockScreenShowPasswordField + onToggled: checked => SettingsData.set("lockScreenShowPasswordField", checked) + } + } + + SettingsCard { + width: parent.width + iconName: "lock" + title: I18n.tr("Lock Screen behaviour") + StyledText { text: I18n.tr("loginctl not available - lock integration requires DMS socket connection") font.pixelSize: Theme.fontSizeSmall