diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index b4cb0aaa8..43502f72f 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -1207,6 +1207,10 @@ "lock-on-suspend-label": "Lock on suspend", "lock-screen-animations-description": "Enable or disable lockscreen animations", "lock-screen-animations-label": "Lockscreen animations", + "lock-screen-blur-strength-description": "Applies a blur effect to the lock screen wallpaper.", + "lock-screen-blur-strength-label": "Lock screen blur strength", + "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.", "show-hibernate-description": "Show the option 'hibernate' in the power controls.", "show-hibernate-label": "Show hibernate", @@ -1925,4 +1929,4 @@ "poor": "Poor" } } -} +} \ No newline at end of file diff --git a/Assets/settings-default.json b/Assets/settings-default.json index 457ca39bb..641b74c55 100644 --- a/Assets/settings-default.json +++ b/Assets/settings-default.json @@ -99,6 +99,8 @@ "clockStyle": "custom", "clockFormat": "hh\\nmm", "lockScreenMonitors": [], + "lockScreenBlur": 0.0, + "lockScreenTint": 0.0, "keybinds": { "keyUp": "Up", "keyDown": "Down", diff --git a/Assets/settings-search-index.json b/Assets/settings-search-index.json index b0358266e..47a6317a9 100644 --- a/Assets/settings-search-index.json +++ b/Assets/settings-search-index.json @@ -1009,6 +1009,24 @@ "subTab": 0, "subTabLabel": "common.appearance" }, + { + "labelKey": "panels.lock-screen.lock-screen-blur-strength-label", + "descriptionKey": "panels.lock-screen.lock-screen-blur-strength-description", + "widget": "NValueSlider", + "tab": 11, + "tabLabel": "panels.lock-screen.title", + "subTab": 0, + "subTabLabel": "common.appearance" + }, + { + "labelKey": "panels.lock-screen.lock-screen-tint-strength-label", + "descriptionKey": "panels.lock-screen.lock-screen-tint-strength-description", + "widget": "NValueSlider", + "tab": 11, + "tabLabel": "panels.lock-screen.title", + "subTab": 0, + "subTabLabel": "common.appearance" + }, { "labelKey": "actions.enable-wifi", "descriptionKey": "panels.network.wifi-description", diff --git a/Commons/Settings.qml b/Commons/Settings.qml index 8be9e4d7e..30f541d95 100644 --- a/Commons/Settings.qml +++ b/Commons/Settings.qml @@ -288,6 +288,8 @@ Singleton { property string clockStyle: "custom" property string clockFormat: "hh\\nmm" property list lockScreenMonitors: [] // holds lock screen visibility per monitor + property real lockScreenBlur: 0.0 + property real lockScreenTint: 0.0 property JsonObject keybinds: JsonObject { property string keyUp: "Up" property string keyDown: "Down" diff --git a/Modules/LockScreen/LockScreenBackground.qml b/Modules/LockScreen/LockScreenBackground.qml index 2f67167ef..8494a34f8 100644 --- a/Modules/LockScreen/LockScreenBackground.qml +++ b/Modules/LockScreen/LockScreenBackground.qml @@ -1,7 +1,9 @@ import QtQuick +import QtQuick.Effects import Quickshell import qs.Commons import qs.Services.Compositor +import qs.Services.Power import qs.Services.UI Item { @@ -10,6 +12,7 @@ Item { // Cached wallpaper path - exposed for parent components property string resolvedWallpaperPath: "" + property color tintColor: Settings.data.colorSchemes.darkMode ? Color.mSurface : Color.mOnSurface required property var screen @@ -116,6 +119,21 @@ Item { smooth: true mipmap: false antialiasing: true + + layer.enabled: true + layer.smooth: false + layer.effect: MultiEffect { + blurEnabled: !PowerProfileService.noctaliaPerformanceMode && (Settings.data.general.lockScreenBlur > 0) + blur: Settings.data.general.lockScreenBlur + blurMax: 48 + } + + // Tint overlay + Rectangle { + anchors.fill: parent + color: root.tintColor + opacity: Settings.data.general.lockScreenTint + } } Rectangle { diff --git a/Modules/Panels/Settings/Tabs/LockScreen/AppearanceSubTab.qml b/Modules/Panels/Settings/Tabs/LockScreen/AppearanceSubTab.qml index a833f23c2..10a65d96a 100644 --- a/Modules/Panels/Settings/Tabs/LockScreen/AppearanceSubTab.qml +++ b/Modules/Panels/Settings/Tabs/LockScreen/AppearanceSubTab.qml @@ -139,4 +139,34 @@ ColumnLayout { text: Math.round(Settings.data.general.lockScreenCountdownDuration / 1000) + "s" defaultValue: Settings.getDefaultValue("general.lockScreenCountdownDuration") } + + NDivider { + Layout.fillWidth: true + } + + NValueSlider { + Layout.fillWidth: true + label: I18n.tr("panels.lock-screen.lock-screen-blur-strength-label") + description: I18n.tr("panels.lock-screen.lock-screen-blur-strength-description") + from: 0.0 + to: 1.0 + stepSize: 0.01 + value: Settings.data.general.lockScreenBlur + onMoved: value => Settings.data.general.lockScreenBlur = value + text: ((Settings.data.general.lockScreenBlur) * 100).toFixed(0) + "%" + defaultValue: Settings.getDefaultValue("general.lockScreenBlur") + } + + NValueSlider { + Layout.fillWidth: true + label: I18n.tr("panels.lock-screen.lock-screen-tint-strength-label") + description: I18n.tr("panels.lock-screen.lock-screen-tint-strength-description") + from: 0.0 + to: 1.0 + stepSize: 0.01 + value: Settings.data.general.lockScreenTint + onMoved: value => Settings.data.general.lockScreenTint = value + text: ((Settings.data.general.lockScreenTint) * 100).toFixed(0) + "%" + defaultValue: Settings.getDefaultValue("general.lockScreenTint") + } }