fix: even more non global access

This commit is contained in:
2 * r + 2 * t 2026-04-13 15:53:43 +10:00
parent 6a91535677
commit 8106aca173
21 changed files with 48 additions and 49 deletions

View file

@ -27,7 +27,7 @@ Shape {
fillColor: "transparent"
strokeColor: root.bgColour
strokeWidth: root.strokeWidth
capStyle: Tokens.rounding.scale === 0 ? ShapePath.SquareCap : ShapePath.RoundCap
capStyle: root.Tokens.rounding.scale === 0 ? ShapePath.SquareCap : ShapePath.RoundCap
PathAngleArc {
startAngle: root.startAngle + 360 * root.vValue + root.gapAngle
@ -49,7 +49,7 @@ Shape {
fillColor: "transparent"
strokeColor: root.fgColour
strokeWidth: root.strokeWidth
capStyle: Tokens.rounding.scale === 0 ? ShapePath.SquareCap : ShapePath.RoundCap
capStyle: root.Tokens.rounding.scale === 0 ? ShapePath.SquareCap : ShapePath.RoundCap
PathAngleArc {
startAngle: root.startAngle

View file

@ -88,10 +88,10 @@ Switch {
asynchronous: true
ShapePath {
strokeWidth: Tokens.font.size.larger * 0.15
strokeWidth: root.Tokens.font.size.larger * 0.15
strokeColor: root.checked ? Colours.palette.m3primary : Colours.palette.m3surfaceContainerHighest
fillColor: "transparent"
capStyle: Tokens.rounding.scale === 0 ? ShapePath.SquareCap : ShapePath.RoundCap
capStyle: root.Tokens.rounding.scale === 0 ? ShapePath.SquareCap : ShapePath.RoundCap
startX: icon.start1.x
startY: icon.start1.y

View file

@ -7,7 +7,7 @@ import Caelestia.Config
Scope {
id: root
readonly property list<var> warnLevels: [...Config.general.battery.warnLevels].sort((a, b) => b.level - a.level)
readonly property list<var> warnLevels: [...GlobalConfig.general.battery.warnLevels].sort((a, b) => b.level - a.level)
Connections {
function onOnBatteryChanged(): void {
@ -38,7 +38,7 @@ Scope {
}
}
if (!hibernateTimer.running && p <= Config.general.battery.criticalLevel) {
if (!hibernateTimer.running && p <= GlobalConfig.general.battery.criticalLevel) {
Toaster.toast(qsTr("Hibernating in 5 seconds"), qsTr("Hibernating to prevent data loss"), "battery_android_alert", Toast.Error);
hibernateTimer.start();
}

View file

@ -8,7 +8,7 @@ import qs.components.containers
import qs.services
Variants {
model: Config.background.enabled ? Screens.screens : []
model: Screens.screens.filter(s => GlobalConfig.forScreen(s.name).background.enabled)
StyledWindow {
id: win
@ -18,8 +18,8 @@ Variants {
screen: modelData
name: "background"
WlrLayershell.exclusionMode: ExclusionMode.Ignore
WlrLayershell.layer: Config.background.wallpaperEnabled ? WlrLayer.Background : WlrLayer.Bottom
color: Config.background.wallpaperEnabled ? "black" : "transparent"
WlrLayershell.layer: contentItem.Config.background.wallpaperEnabled ? WlrLayer.Background : WlrLayer.Bottom
color: contentItem.Config.background.wallpaperEnabled ? "black" : "transparent"
surfaceFormat.opaque: false
anchors.top: true

View file

@ -152,7 +152,7 @@ StackView {
font.family: label.font.family
elide: Text.ElideRight
elideWidth: Tokens.sizes.bar.trayMenuWidth - (icon.active ? icon.implicitWidth + label.anchors.leftMargin : 0) - (expand.active ? expand.implicitWidth + Tokens.spacing.normal : 0)
elideWidth: root.Tokens.sizes.bar.trayMenuWidth - (icon.active ? icon.implicitWidth + label.anchors.leftMargin : 0) - (expand.active ? expand.implicitWidth + root.Tokens.spacing.normal : 0)
}
Loader {

View file

@ -22,8 +22,8 @@ Item {
// General Settings
property bool enabled: Config.dashboard.enabled ?? true
property bool showOnHover: Config.dashboard.showOnHover ?? true
property int mediaUpdateInterval: Config.dashboard.mediaUpdateInterval ?? 1000
property int resourceUpdateInterval: Config.dashboard.resourceUpdateInterval ?? 1000
property int mediaUpdateInterval: GlobalConfig.dashboard.mediaUpdateInterval ?? 1000
property int resourceUpdateInterval: GlobalConfig.dashboard.resourceUpdateInterval ?? 1000
property int dragThreshold: Config.dashboard.dragThreshold ?? 50
// Dashboard Tabs

View file

@ -67,7 +67,7 @@ Item {
Timer {
running: Players.active?.isPlaying ?? false
interval: Config.dashboard.mediaUpdateInterval
interval: GlobalConfig.dashboard.mediaUpdateInterval
triggeredOnStart: true
repeat: true
onTriggered: {
@ -132,12 +132,12 @@ Item {
readonly property real value: Math.max(1e-3, Math.min(1, Audio.cava.values[modelData]))
readonly property real angle: modelData * 2 * Math.PI / GlobalConfig.services.visualiserBars
readonly property real magnitude: value * Tokens.sizes.dashboard.mediaVisualiserSize
readonly property real magnitude: value * root.Tokens.sizes.dashboard.mediaVisualiserSize
readonly property real cos: Math.cos(angle)
readonly property real sin: Math.sin(angle)
capStyle: Tokens.rounding.scale === 0 ? ShapePath.SquareCap : ShapePath.RoundCap
strokeWidth: 360 / GlobalConfig.services.visualiserBars - Tokens.spacing.small / 4
capStyle: root.Tokens.rounding.scale === 0 ? ShapePath.SquareCap : ShapePath.RoundCap
strokeWidth: 360 / GlobalConfig.services.visualiserBars - root.Tokens.spacing.small / 4
strokeColor: Colours.palette.m3primary
startX: visualiser.centerX + (visualiser.innerX + strokeWidth / 2) * cos

View file

@ -705,7 +705,7 @@ Item {
property: "slideProgress"
from: 0
to: 1
duration: Config.dashboard.resourceUpdateInterval
duration: GlobalConfig.dashboard.resourceUpdateInterval
}
Behavior on smoothMax {

View file

@ -26,7 +26,7 @@ Item {
Timer {
running: Players.active?.isPlaying ?? false
interval: Config.dashboard.mediaUpdateInterval
interval: GlobalConfig.dashboard.mediaUpdateInterval
triggeredOnStart: true
repeat: true
onTriggered: Players.active?.positionChanged()
@ -42,16 +42,16 @@ Item {
ShapePath {
fillColor: "transparent"
strokeColor: Colours.layer(Colours.palette.m3surfaceContainerHigh, 2)
strokeWidth: Tokens.sizes.dashboard.mediaProgressThickness
capStyle: Tokens.rounding.scale === 0 ? ShapePath.SquareCap : ShapePath.RoundCap
strokeWidth: root.Tokens.sizes.dashboard.mediaProgressThickness
capStyle: root.Tokens.rounding.scale === 0 ? ShapePath.SquareCap : ShapePath.RoundCap
PathAngleArc {
centerX: cover.x + cover.width / 2
centerY: cover.y + cover.height / 2
radiusX: (cover.width + Tokens.sizes.dashboard.mediaProgressThickness) / 2 + Tokens.spacing.small
radiusY: (cover.height + Tokens.sizes.dashboard.mediaProgressThickness) / 2 + Tokens.spacing.small
startAngle: -90 - Tokens.sizes.dashboard.mediaProgressSweep / 2
sweepAngle: Tokens.sizes.dashboard.mediaProgressSweep
radiusX: (cover.width + root.Tokens.sizes.dashboard.mediaProgressThickness) / 2 + root.Tokens.spacing.small
radiusY: (cover.height + root.Tokens.sizes.dashboard.mediaProgressThickness) / 2 + root.Tokens.spacing.small
startAngle: -90 - root.Tokens.sizes.dashboard.mediaProgressSweep / 2
sweepAngle: root.Tokens.sizes.dashboard.mediaProgressSweep
}
Behavior on strokeColor {
@ -62,16 +62,16 @@ Item {
ShapePath {
fillColor: "transparent"
strokeColor: Colours.palette.m3primary
strokeWidth: Tokens.sizes.dashboard.mediaProgressThickness
capStyle: Tokens.rounding.scale === 0 ? ShapePath.SquareCap : ShapePath.RoundCap
strokeWidth: root.Tokens.sizes.dashboard.mediaProgressThickness
capStyle: root.Tokens.rounding.scale === 0 ? ShapePath.SquareCap : ShapePath.RoundCap
PathAngleArc {
centerX: cover.x + cover.width / 2
centerY: cover.y + cover.height / 2
radiusX: (cover.width + Tokens.sizes.dashboard.mediaProgressThickness) / 2 + Tokens.spacing.small
radiusY: (cover.height + Tokens.sizes.dashboard.mediaProgressThickness) / 2 + Tokens.spacing.small
startAngle: -90 - Tokens.sizes.dashboard.mediaProgressSweep / 2
sweepAngle: Tokens.sizes.dashboard.mediaProgressSweep * root.playerProgress
radiusX: (cover.width + root.Tokens.sizes.dashboard.mediaProgressThickness) / 2 + root.Tokens.spacing.small
radiusY: (cover.height + root.Tokens.sizes.dashboard.mediaProgressThickness) / 2 + root.Tokens.spacing.small
startAngle: -90 - root.Tokens.sizes.dashboard.mediaProgressSweep / 2
sweepAngle: root.Tokens.sizes.dashboard.mediaProgressSweep * root.playerProgress
}
Behavior on strokeColor {

View file

@ -95,7 +95,7 @@ StyledWindow {
HyprlandFocusGrab {
id: focusGrab
active: (visibilities.launcher && Config.launcher.enabled) || (visibilities.session && Config.session.enabled) || (visibilities.sidebar && Config.sidebar.enabled) || (!Config.dashboard.showOnHover && visibilities.dashboard && Config.dashboard.enabled) || (panels.popouts.currentName.startsWith("traymenu") && (panels.popouts.current as StackView)?.depth > 1)
active: (visibilities.launcher && root.contentItem.Config.launcher.enabled) || (visibilities.session && root.contentItem.Config.session.enabled) || (visibilities.sidebar && root.contentItem.Config.sidebar.enabled) || (!root.contentItem.Config.dashboard.showOnHover && visibilities.dashboard && root.contentItem.Config.dashboard.enabled) || (panels.popouts.currentName.startsWith("traymenu") && (panels.popouts.current as StackView)?.depth > 1)
windows: [root]
onCleared: {
visibilities.launcher = false;

View file

@ -16,7 +16,6 @@ Variants {
Exclusions {
screen: scope.modelData
bar: content.bar
borderThickness: Config.border.thickness
}
ContentWindow {

View file

@ -2,6 +2,7 @@ pragma ComponentBehavior: Bound
import QtQuick
import Quickshell
import Caelestia.Config
import qs.components.containers
import qs.modules.bar as Bar
@ -10,7 +11,6 @@ Scope {
required property ShellScreen screen
required property Bar.BarWrapper bar
required property real borderThickness
ExclusionZone {
anchors.left: true
@ -32,7 +32,7 @@ Scope {
component ExclusionZone: StyledWindow {
screen: root.screen
name: "border-exclusion"
exclusiveZone: root.borderThickness
exclusiveZone: contentItem.Config.border.thickness
mask: Region {}
implicitWidth: 1
implicitHeight: 1

View file

@ -160,13 +160,13 @@ ColumnLayout {
anchors.centerIn: parent
animate: true
text: {
if (root.lock.pam.fprint.tries >= Config.lock.maxFprintTries)
if (root.lock.pam.fprint.tries >= GlobalConfig.lock.maxFprintTries)
return "fingerprint_off";
if (root.lock.pam.fprint.active)
return "fingerprint";
return "lock";
}
color: root.lock.pam.fprint.tries >= Config.lock.maxFprintTries ? Colours.palette.m3error : Colours.palette.m3onSurface
color: root.lock.pam.fprint.tries >= GlobalConfig.lock.maxFprintTries ? Colours.palette.m3error : Colours.palette.m3onSurface
opacity: root.lock.pam.passwd.active ? 0 : 1
Behavior on opacity {

View file

@ -142,19 +142,19 @@ WlSessionLockSurface {
Anim {
target: lockBg
property: "radius"
to: Tokens.rounding.large * 1.5
to: lockContent.Tokens.rounding.large * 1.5
}
Anim {
target: lockContent
property: "implicitWidth"
to: (root.screen?.height ?? 0) * Tokens.sizes.lock.heightMult * Tokens.sizes.lock.ratio
to: (root.screen?.height ?? 0) * lockContent.Tokens.sizes.lock.heightMult * lockContent.Tokens.sizes.lock.ratio
duration: Tokens.anim.durations.expressiveDefaultSpatial
easing: Tokens.anim.expressiveDefaultSpatial
}
Anim {
target: lockContent
property: "implicitHeight"
to: (root.screen?.height ?? 0) * Tokens.sizes.lock.heightMult
to: (root.screen?.height ?? 0) * lockContent.Tokens.sizes.lock.heightMult
duration: Tokens.anim.durations.expressiveDefaultSpatial
easing: Tokens.anim.expressiveDefaultSpatial
}

View file

@ -219,7 +219,7 @@ StyledRect {
Repeater {
model: ScriptModel {
values: root.notifs.slice(0, Config.notifs.groupPreviewNum)
values: root.notifs.slice(0, root.Config.notifs.groupPreviewNum)
}
NotifLine {
@ -282,7 +282,7 @@ StyledRect {
sourceComponent: ColumnLayout {
Repeater {
model: ScriptModel {
values: root.notifs.slice(Config.notifs.groupPreviewNum)
values: root.notifs.slice(root.Config.notifs.groupPreviewNum)
}
NotifLine {}

View file

@ -207,9 +207,9 @@ StyledRect {
PathAngleArc {
id: progressArc
radiusX: progressIndicator.width / 2 - Tokens.padding.small / 2
radiusX: progressIndicator.width / 2 - root.Tokens.padding.small / 2
centerX: progressIndicator.width / 2
radiusY: progressIndicator.height / 2 - Tokens.padding.small / 2
radiusY: progressIndicator.height / 2 - root.Tokens.padding.small / 2
centerY: progressIndicator.height / 2
startAngle: -90

View file

@ -87,7 +87,7 @@ Item {
Timer {
id: timer
interval: Config.osd.hideDelay
interval: root.Config.osd.hideDelay
onTriggered: {
if (!root.hovered)
root.visibilities.osd = false;

View file

@ -42,7 +42,7 @@ LazyListView {
let count = 0;
let i = 0;
const previewNum = Config.notifs.groupPreviewNum;
const previewNum = root.Config.notifs.groupPreviewNum;
while (i < root.notifs.length && count < previewNum) {
if (!(root.notifs[i]?.closed ?? true))
count++;

View file

@ -30,8 +30,8 @@ class DashboardConfig : public ConfigObject {
CONFIG_PROPERTY(bool, showMedia, true)
CONFIG_PROPERTY(bool, showPerformance, true)
CONFIG_PROPERTY(bool, showWeather, true)
CONFIG_PROPERTY(int, mediaUpdateInterval, 500)
CONFIG_PROPERTY(int, resourceUpdateInterval, 1000)
CONFIG_GLOBAL_PROPERTY(int, mediaUpdateInterval, 500)
CONFIG_GLOBAL_PROPERTY(int, resourceUpdateInterval, 1000)
CONFIG_PROPERTY(int, dragThreshold, 50)
CONFIG_SUBOBJECT(DashboardPerformance, performance)

View file

@ -155,7 +155,7 @@ Singleton {
}
Timer {
interval: Config.dashboard.resourceUpdateInterval
interval: GlobalConfig.dashboard.resourceUpdateInterval
running: root.refCount > 0
repeat: true
triggeredOnStart: true

View file

@ -80,7 +80,7 @@ Singleton {
Timer {
running: root.refCount > 0
interval: Config.dashboard.resourceUpdateInterval
interval: GlobalConfig.dashboard.resourceUpdateInterval
repeat: true
triggeredOnStart: true
onTriggered: {