fix: add lock config scope
Also global lock settings And fix some accesses
This commit is contained in:
parent
bbba6e162d
commit
8883156dd9
5 changed files with 67 additions and 60 deletions
|
|
@ -11,7 +11,7 @@ Scope {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
required property Lock lock
|
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 {
|
function handleIdleAction(action: var): void {
|
||||||
if (!action)
|
if (!action)
|
||||||
|
|
@ -29,7 +29,7 @@ Scope {
|
||||||
|
|
||||||
LogindManager {
|
LogindManager {
|
||||||
onAboutToSleep: {
|
onAboutToSleep: {
|
||||||
if (Config.general.idle.lockBeforeSleep)
|
if (GlobalConfig.general.idle.lockBeforeSleep)
|
||||||
root.lock.lock.locked = true;
|
root.lock.lock.locked = true;
|
||||||
}
|
}
|
||||||
onLockRequested: root.lock.lock.locked = true
|
onLockRequested: root.lock.lock.locked = true
|
||||||
|
|
@ -37,7 +37,7 @@ Scope {
|
||||||
}
|
}
|
||||||
|
|
||||||
Variants {
|
Variants {
|
||||||
model: Config.general.idle.timeouts
|
model: GlobalConfig.general.idle.timeouts
|
||||||
|
|
||||||
IdleMonitor {
|
IdleMonitor {
|
||||||
required property var modelData
|
required property var modelData
|
||||||
|
|
|
||||||
|
|
@ -159,72 +159,79 @@ WlSessionLockSurface {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ScreencopyView {
|
ConfigScope {
|
||||||
id: background
|
id: configScope
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
captureSource: root.screen
|
screen: root.screen
|
||||||
opacity: 0
|
|
||||||
|
|
||||||
layer.enabled: true
|
ScreencopyView {
|
||||||
layer.effect: MultiEffect {
|
id: background
|
||||||
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
|
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: Colours.palette.m3surface
|
captureSource: root.screen
|
||||||
radius: parent.radius
|
opacity: 0
|
||||||
opacity: Colours.transparency.enabled ? Colours.transparency.base : 1
|
|
||||||
|
|
||||||
layer.enabled: true
|
layer.enabled: true
|
||||||
layer.effect: MultiEffect {
|
layer.effect: MultiEffect {
|
||||||
shadowEnabled: true
|
autoPaddingEnabled: false
|
||||||
blurMax: 15
|
blurEnabled: true
|
||||||
shadowColor: Qt.alpha(Colours.palette.m3shadow, 0.7)
|
blur: 1
|
||||||
|
blurMax: 64
|
||||||
|
blurMultiplier: 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MaterialIcon {
|
Item {
|
||||||
id: lockIcon
|
id: lockContent
|
||||||
|
|
||||||
|
readonly property int size: lockIcon.implicitHeight + Tokens.padding.large * 4
|
||||||
|
readonly property int radius: size / 4 * Tokens.rounding.scale
|
||||||
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
text: "lock"
|
implicitWidth: size
|
||||||
font.pointSize: Tokens.font.size.extraLarge * 4
|
implicitHeight: size
|
||||||
font.bold: true
|
|
||||||
rotation: 180
|
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
|
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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ Scope {
|
||||||
property int errorTries
|
property int errorTries
|
||||||
|
|
||||||
function checkAvail(): void {
|
function checkAvail(): void {
|
||||||
if (!available || !Config.lock.enableFprint || !root.lock.secure) {
|
if (!available || !GlobalConfig.lock.enableFprint || !root.lock.secure) {
|
||||||
abort();
|
abort();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -113,7 +113,7 @@ Scope {
|
||||||
// Isn't actually the real max tries as pam only reports completed
|
// Isn't actually the real max tries as pam only reports completed
|
||||||
// when max tries is reached.
|
// when max tries is reached.
|
||||||
tries++;
|
tries++;
|
||||||
if (tries < Config.lock.maxFprintTries) {
|
if (tries < GlobalConfig.lock.maxFprintTries) {
|
||||||
// Restart if not actually real max tries
|
// Restart if not actually real max tries
|
||||||
root.fprintState = "fail";
|
root.fprintState = "fail";
|
||||||
start();
|
start();
|
||||||
|
|
@ -188,6 +188,6 @@ Scope {
|
||||||
fprint.checkAvail();
|
fprint.checkAvail();
|
||||||
}
|
}
|
||||||
|
|
||||||
target: Config.lock
|
target: GlobalConfig.lock
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@ class LockConfig : public ConfigObject {
|
||||||
QML_ANONYMOUS
|
QML_ANONYMOUS
|
||||||
|
|
||||||
CONFIG_PROPERTY(bool, recolourLogo, false)
|
CONFIG_PROPERTY(bool, recolourLogo, false)
|
||||||
CONFIG_PROPERTY(bool, enableFprint, true)
|
CONFIG_GLOBAL_PROPERTY(bool, enableFprint, true)
|
||||||
CONFIG_PROPERTY(int, maxFprintTries, 3)
|
CONFIG_GLOBAL_PROPERTY(int, maxFprintTries, 3)
|
||||||
CONFIG_PROPERTY(bool, hideNotifs, false)
|
CONFIG_PROPERTY(bool, hideNotifs, false)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ Singleton {
|
||||||
|
|
||||||
readonly property string imagecache: `${cache}/imagecache`
|
readonly property string imagecache: `${cache}/imagecache`
|
||||||
readonly property string notifimagecache: `${imagecache}/notifs`
|
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 recsdir: Quickshell.env("CAELESTIA_RECORDINGS_DIR") || `${videos}/Recordings`
|
||||||
readonly property string libdir: Quickshell.env("CAELESTIA_LIB_DIR") || "/usr/lib/caelestia"
|
readonly property string libdir: Quickshell.env("CAELESTIA_LIB_DIR") || "/usr/lib/caelestia"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue