1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 13:32:50 -05:00

Add lock screen layout settings (#981)

* Add lock screen layout settings

* Update translation keys
This commit is contained in:
Pi Home Server
2025-12-12 16:45:00 +00:00
committed by GitHub
parent 32e6c1660f
commit df1a8f4066
4 changed files with 56 additions and 3 deletions

View File

@@ -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

View File

@@ -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 },

View File

@@ -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

View File

@@ -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