diff --git a/modules/IdleMonitors.qml b/modules/IdleMonitors.qml index 839cd6f6..417b0e8a 100644 --- a/modules/IdleMonitors.qml +++ b/modules/IdleMonitors.qml @@ -11,7 +11,7 @@ Scope { id: root required property Lock lock - readonly property bool enabled: !Config.general.idle.inhibitWhenAudio || !Players.list.some(p => p.isPlaying) + readonly property bool enabled: !GlobalConfig.general.idle.inhibitWhenAudio || !Players.list.some(p => p.isPlaying) function handleIdleAction(action: var): void { if (!action) @@ -29,7 +29,7 @@ Scope { LogindManager { onAboutToSleep: { - if (Config.general.idle.lockBeforeSleep) + if (GlobalConfig.general.idle.lockBeforeSleep) root.lock.lock.locked = true; } onLockRequested: root.lock.lock.locked = true @@ -37,7 +37,7 @@ Scope { } Variants { - model: Config.general.idle.timeouts + model: GlobalConfig.general.idle.timeouts IdleMonitor { required property var modelData diff --git a/modules/lock/LockSurface.qml b/modules/lock/LockSurface.qml index b269e1ea..70c754d6 100644 --- a/modules/lock/LockSurface.qml +++ b/modules/lock/LockSurface.qml @@ -159,72 +159,79 @@ WlSessionLockSurface { } } - ScreencopyView { - id: background + ConfigScope { + id: configScope anchors.fill: parent - captureSource: root.screen - opacity: 0 + screen: root.screen - layer.enabled: true - layer.effect: MultiEffect { - autoPaddingEnabled: false - blurEnabled: true - blur: 1 - blurMax: 64 - blurMultiplier: 1 - } - } - - Item { - id: lockContent - - readonly property int size: lockIcon.implicitHeight + Tokens.padding.large * 4 - readonly property int radius: size / 4 * Tokens.rounding.scale - - anchors.centerIn: parent - implicitWidth: size - implicitHeight: size - - rotation: 180 - scale: 0 - - StyledRect { - id: lockBg + ScreencopyView { + id: background anchors.fill: parent - color: Colours.palette.m3surface - radius: parent.radius - opacity: Colours.transparency.enabled ? Colours.transparency.base : 1 + captureSource: root.screen + opacity: 0 layer.enabled: true layer.effect: MultiEffect { - shadowEnabled: true - blurMax: 15 - shadowColor: Qt.alpha(Colours.palette.m3shadow, 0.7) + autoPaddingEnabled: false + blurEnabled: true + blur: 1 + blurMax: 64 + blurMultiplier: 1 } } - MaterialIcon { - id: lockIcon + Item { + id: lockContent + + readonly property int size: lockIcon.implicitHeight + Tokens.padding.large * 4 + readonly property int radius: size / 4 * Tokens.rounding.scale anchors.centerIn: parent - text: "lock" - font.pointSize: Tokens.font.size.extraLarge * 4 - font.bold: true + implicitWidth: size + implicitHeight: size + rotation: 180 - } - - Content { - id: content - - anchors.centerIn: parent - width: (root.screen?.height ?? 0) * Tokens.sizes.lock.heightMult * Tokens.sizes.lock.ratio - Tokens.padding.large * 2 - height: (root.screen?.height ?? 0) * Tokens.sizes.lock.heightMult - Tokens.padding.large * 2 - - lock: root - opacity: 0 scale: 0 + + StyledRect { + id: lockBg + + anchors.fill: parent + color: Colours.palette.m3surface + radius: parent.radius + opacity: Colours.transparency.enabled ? Colours.transparency.base : 1 + + layer.enabled: true + layer.effect: MultiEffect { + shadowEnabled: true + blurMax: 15 + shadowColor: Qt.alpha(Colours.palette.m3shadow, 0.7) + } + } + + MaterialIcon { + id: lockIcon + + anchors.centerIn: parent + text: "lock" + font.pointSize: Tokens.font.size.extraLarge * 4 + font.bold: true + rotation: 180 + } + + Content { + id: content + + anchors.centerIn: parent + width: (root.screen?.height ?? 0) * Tokens.sizes.lock.heightMult * Tokens.sizes.lock.ratio - Tokens.padding.large * 2 + height: (root.screen?.height ?? 0) * Tokens.sizes.lock.heightMult - Tokens.padding.large * 2 + + lock: root + opacity: 0 + scale: 0 + } } } } diff --git a/modules/lock/Pam.qml b/modules/lock/Pam.qml index 8f780ea0..94832b20 100644 --- a/modules/lock/Pam.qml +++ b/modules/lock/Pam.qml @@ -82,7 +82,7 @@ Scope { property int errorTries function checkAvail(): void { - if (!available || !Config.lock.enableFprint || !root.lock.secure) { + if (!available || !GlobalConfig.lock.enableFprint || !root.lock.secure) { abort(); return; } @@ -113,7 +113,7 @@ Scope { // Isn't actually the real max tries as pam only reports completed // when max tries is reached. tries++; - if (tries < Config.lock.maxFprintTries) { + if (tries < GlobalConfig.lock.maxFprintTries) { // Restart if not actually real max tries root.fprintState = "fail"; start(); @@ -188,6 +188,6 @@ Scope { fprint.checkAvail(); } - target: Config.lock + target: GlobalConfig.lock } } diff --git a/plugin/src/Caelestia/Config/lockconfig.hpp b/plugin/src/Caelestia/Config/lockconfig.hpp index 444b3051..0d8aa6ba 100644 --- a/plugin/src/Caelestia/Config/lockconfig.hpp +++ b/plugin/src/Caelestia/Config/lockconfig.hpp @@ -9,8 +9,8 @@ class LockConfig : public ConfigObject { QML_ANONYMOUS CONFIG_PROPERTY(bool, recolourLogo, false) - CONFIG_PROPERTY(bool, enableFprint, true) - CONFIG_PROPERTY(int, maxFprintTries, 3) + CONFIG_GLOBAL_PROPERTY(bool, enableFprint, true) + CONFIG_GLOBAL_PROPERTY(int, maxFprintTries, 3) CONFIG_PROPERTY(bool, hideNotifs, false) public: diff --git a/utils/Paths.qml b/utils/Paths.qml index aa967913..97f6448a 100644 --- a/utils/Paths.qml +++ b/utils/Paths.qml @@ -19,7 +19,7 @@ Singleton { readonly property string imagecache: `${cache}/imagecache` readonly property string notifimagecache: `${imagecache}/notifs` - readonly property string wallsdir: Quickshell.env("CAELESTIA_WALLPAPERS_DIR") || absolutePath(Config.paths.wallpaperDir) + readonly property string wallsdir: Quickshell.env("CAELESTIA_WALLPAPERS_DIR") || absolutePath(GlobalConfig.paths.wallpaperDir) readonly property string recsdir: Quickshell.env("CAELESTIA_RECORDINGS_DIR") || `${videos}/Recordings` readonly property string libdir: Quickshell.env("CAELESTIA_LIB_DIR") || "/usr/lib/caelestia"