diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-08-16 00:10:48 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-08-16 00:10:48 +1000 |
| commit | d8f7bac960e07504153c5d6123e4a50b4802343e (patch) | |
| tree | ef6b037ed68b8475f1080a08cb480363bfe150dc /modules/bar/components/workspaces/OccupiedBg.qml | |
| parent | internal: static bar width (diff) | |
| download | caelestia-shell-d8f7bac960e07504153c5d6123e4a50b4802343e.tar.gz caelestia-shell-d8f7bac960e07504153c5d6123e4a50b4802343e.tar.bz2 caelestia-shell-d8f7bac960e07504153c5d6123e4a50b4802343e.zip | |
bar/workspaces: refactor
Diffstat (limited to 'modules/bar/components/workspaces/OccupiedBg.qml')
| -rw-r--r-- | modules/bar/components/workspaces/OccupiedBg.qml | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/modules/bar/components/workspaces/OccupiedBg.qml b/modules/bar/components/workspaces/OccupiedBg.qml index bfdbbbd..37fe4c1 100644 --- a/modules/bar/components/workspaces/OccupiedBg.qml +++ b/modules/bar/components/workspaces/OccupiedBg.qml @@ -9,7 +9,7 @@ import QtQuick Item { id: root - required property list<Workspace> workspaces + required property Repeater workspaces required property var occupied required property int groupOffset @@ -48,18 +48,17 @@ Item { required property var modelData - readonly property Workspace start: root.workspaces[modelData.start - 1 - root.groupOffset] ?? null - readonly property Workspace end: root.workspaces[modelData.end - 1 - root.groupOffset] ?? null + readonly property Workspace start: root.workspaces.itemAt((modelData.start - 1) % Config.bar.workspaces.shown) ?? null + readonly property Workspace end: root.workspaces.itemAt((modelData.end - 1) % Config.bar.workspaces.shown) ?? null - color: Colours.tPalette.m3surfaceContainerHigh - radius: Config.bar.workspaces.rounded ? Appearance.rounding.full : 0 + anchors.horizontalCenter: root.horizontalCenter - x: start?.x ?? 0 - y: start?.y ?? 0 - implicitWidth: Config.bar.sizes.innerHeight - implicitHeight: end?.y + end?.height - start?.y + y: (start?.y ?? 0) - 1 + implicitWidth: Config.bar.sizes.innerWidth - Appearance.padding.small * 2 + 2 + implicitHeight: start && end ? end.y + end.size - start.y + 2 : 0 - anchors.horizontalCenter: parent.horizontalCenter + color: Colours.layer(Colours.palette.m3surfaceContainerHigh, 2) + radius: Appearance.rounding.full scale: 0 Component.onCompleted: scale = 1 @@ -70,11 +69,11 @@ Item { } } - Behavior on x { + Behavior on y { Anim {} } - Behavior on y { + Behavior on implicitHeight { Anim {} } } |