lock: rename bg blur config option, no blur by default

This commit is contained in:
end-4 2025-09-17 23:39:56 +02:00
parent b984d6794e
commit c41364fb16
2 changed files with 12 additions and 9 deletions

View file

@ -57,7 +57,7 @@ Variants {
property real clockX: (modelData.width / 2)
property real clockY: (modelData.height / 2)
property var textHorizontalAlignment: {
if (Config.options.background.blur.enable && Config.options.background.blur.centerClock && GlobalStates.screenLocked)
if (Config.options.background.lockBlur.enable && Config.options.background.lockBlur.centerClock && GlobalStates.screenLocked)
return Text.AlignHCenter;
if (clockX < screen.width / 3)
return Text.AlignLeft;
@ -66,10 +66,13 @@ Variants {
return Text.AlignHCenter;
}
// Colors
property bool shouldBlur: (GlobalStates.screenLocked && Config.options.background.lockBlur.enable)
property color dominantColor: Appearance.colors.colPrimary
property bool dominantColorIsDark: dominantColor.hslLightness < 0.5
property color colText: CF.ColorUtils.colorWithLightness(Appearance.colors.colPrimary, (dominantColorIsDark ? 0.8 : 0.12))
property bool shouldBlur: (GlobalStates.screenLocked && Config.options.background.blur.enable)
property color colText: (GlobalStates.screenLocked && shouldBlur) ? Appearance.colors.colSecondary : CF.ColorUtils.colorWithLightness(Appearance.colors.colPrimary, (dominantColorIsDark ? 0.8 : 0.12))
Behavior on colText {
animation: Appearance.animation.elementMoveFast.colorAnimation.createObject(this)
}
// Layer props
screen: modelData
@ -227,9 +230,9 @@ Variants {
Loader {
id: blurLoader
active: Config.options.background.blur.enable && (GlobalStates.screenLocked || scaleAnim.running)
active: Config.options.background.lockBlur.enable && (GlobalStates.screenLocked || scaleAnim.running)
anchors.fill: wallpaper
scale: GlobalStates.screenLocked ? Config.options.background.blur.extraZoom : 1
scale: GlobalStates.screenLocked ? Config.options.background.lockBlur.extraZoom : 1
Behavior on scale {
NumberAnimation {
id: scaleAnim
@ -240,7 +243,7 @@ Variants {
}
sourceComponent: GaussianBlur {
source: wallpaper
radius: GlobalStates.screenLocked ? Config.options.background.blur.radius : 0
radius: GlobalStates.screenLocked ? Config.options.background.lockBlur.radius : 0
samples: radius * 2 + 1
Rectangle {
@ -355,7 +358,7 @@ Variants {
leftMargin: -5
rightMargin: -5
}
opacity: GlobalStates.screenLocked && (!Config.options.background.blur.enable || Config.options.background.blur.showLockedText) ? 1 : 0
opacity: GlobalStates.screenLocked && (!Config.options.background.lockBlur.enable || Config.options.background.lockBlur.showLockedText) ? 1 : 0
visible: opacity > 0
Behavior on opacity {
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)

View file

@ -135,8 +135,8 @@ Singleton {
property real workspaceZoom: 1.07 // Relative to your screen, not wallpaper size
property bool enableSidebar: true
}
property JsonObject blur: JsonObject {
property bool enable: true
property JsonObject lockBlur: JsonObject {
property bool enable: false
property int radius: 100
property bool centerClock: true
property bool showLockedText: true