From a649274a64efaffceffee52047164c5a2c34ee5d Mon Sep 17 00:00:00 2001 From: Thibault Martin Date: Sun, 15 Feb 2026 20:11:09 +0100 Subject: [PATCH] Option to display cute icons instead of just circles --- Assets/Translations/en.json | 2 ++ Assets/settings-default.json | 1 + Assets/settings-search-index.json | 9 +++++++++ Commons/Settings.qml | 1 + Modules/LockScreen/LockScreenPanel.qml | 17 ++++++++++++++--- .../Tabs/LockScreen/AppearanceSubTab.qml | 9 +++++++++ 6 files changed, 36 insertions(+), 3 deletions(-) diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index bb016966b..405cbf4e8 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -1280,6 +1280,8 @@ "lock-screen-tint-strength-description": "Applies a tint overlay to the lock screen wallpaper.", "lock-screen-tint-strength-label": "Lock screen tint strength", "monitors-desc": "Show lock screen on specific monitors. Defaults to all if none are chosen.", + "password-chars-description": "Cute icons used to hide your password.", + "password-chars-label": "Hidden password icons", "show-hibernate-description": "Show the option 'hibernate' in the power controls.", "show-hibernate-label": "Show hibernate", "show-session-buttons-description": "Allow access to power settings from the lock screen.", diff --git a/Assets/settings-default.json b/Assets/settings-default.json index 26ea4dd43..56272448f 100644 --- a/Assets/settings-default.json +++ b/Assets/settings-default.json @@ -98,6 +98,7 @@ "allowPasswordWithFprintd": false, "clockStyle": "custom", "clockFormat": "hh\\nmm", + "passwordChars": false, "lockScreenMonitors": [], "lockScreenBlur": 0, "lockScreenTint": 0, diff --git a/Assets/settings-search-index.json b/Assets/settings-search-index.json index 34891bac4..c365ee435 100644 --- a/Assets/settings-search-index.json +++ b/Assets/settings-search-index.json @@ -1053,6 +1053,15 @@ "subTab": 0, "subTabLabel": "common.appearance" }, + { + "labelKey": "panels.lock-screen.password-chars-label", + "descriptionKey": "panels.lock-screen.password-chars-description", + "widget": "NToggle", + "tab": 11, + "tabLabel": "panels.lock-screen.title", + "subTab": 0, + "subTabLabel": "common.appearance" + }, { "labelKey": "panels.lock-screen.lock-on-suspend-label", "descriptionKey": "panels.lock-screen.lock-on-suspend-description", diff --git a/Commons/Settings.qml b/Commons/Settings.qml index 20642b5db..3c4412ad7 100644 --- a/Commons/Settings.qml +++ b/Commons/Settings.qml @@ -287,6 +287,7 @@ Singleton { property bool allowPasswordWithFprintd: false property string clockStyle: "custom" property string clockFormat: "hh\\nmm" + property bool passwordChars: false property list lockScreenMonitors: [] // holds lock screen visibility per monitor property real lockScreenBlur: 0.0 property real lockScreenTint: 0.0 diff --git a/Modules/LockScreen/LockScreenPanel.qml b/Modules/LockScreen/LockScreenPanel.qml index 427d2c1a6..df9a78ad1 100644 --- a/Modules/LockScreen/LockScreenPanel.qml +++ b/Modules/LockScreen/LockScreenPanel.qml @@ -585,17 +585,26 @@ Item { anchors.verticalCenter: parent.verticalCenter Repeater { + id: iconRepeater model: ScriptModel { values: Array(passwordInput.text.length) } + property list passwordChars: ["circle-filled", "pentagon-filled", "michelin-star-filled", "square-rounded-filled", "guitar-pick-filled", "blob-filled", "triangle-filled"] + NIcon { id: icon - icon: "circle-filled" + + required property int index + // This will be called with index = -1 when the TextInput is deleted + // So we make sur index is positive to avoid warning on array accesses + property bool drawCustomChar: index >= 0 && Settings.data.general.passwordChars + + icon: drawCustomChar ? iconRepeater.passwordChars[index % iconRepeater.passwordChars.length] : "circle-filled" pointSize: Style.fontSizeL color: Color.mPrimary opacity: 1.0 - scale: 0.5 + scale: animationsEnabled ? 0.5 : 1 ParallelAnimation { id: iconAnim NumberAnimation { @@ -608,7 +617,9 @@ Item { } } Component.onCompleted: { - iconAnim.start(); + if (animationsEnabled) { + iconAnim.start(); + } } } } diff --git a/Modules/Panels/Settings/Tabs/LockScreen/AppearanceSubTab.qml b/Modules/Panels/Settings/Tabs/LockScreen/AppearanceSubTab.qml index 10a65d96a..35168ddcc 100644 --- a/Modules/Panels/Settings/Tabs/LockScreen/AppearanceSubTab.qml +++ b/Modules/Panels/Settings/Tabs/LockScreen/AppearanceSubTab.qml @@ -60,6 +60,15 @@ ColumnLayout { onTokenClicked: token => root.insertToken(token) } + NToggle { + label: I18n.tr("panels.lock-screen.password-chars-label") + description: I18n.tr("panels.lock-screen.password-chars-description") + checked: Settings.data.general.passwordChars + onToggled: checked => Settings.data.general.passwordChars = checked + defaultValue: Settings.getDefaultValue("general.passwordChars") + z: 10 + } + NToggle { label: I18n.tr("panels.lock-screen.lock-on-suspend-label") description: I18n.tr("panels.lock-screen.lock-on-suspend-description")