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