mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
LockScreen: add blur & tint option
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -99,6 +99,8 @@
|
||||
"clockStyle": "custom",
|
||||
"clockFormat": "hh\\nmm",
|
||||
"lockScreenMonitors": [],
|
||||
"lockScreenBlur": 0.0,
|
||||
"lockScreenTint": 0.0,
|
||||
"keybinds": {
|
||||
"keyUp": "Up",
|
||||
"keyDown": "Down",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -288,6 +288,8 @@ Singleton {
|
||||
property string clockStyle: "custom"
|
||||
property string clockFormat: "hh\\nmm"
|
||||
property list<string> 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"
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user