summaryrefslogtreecommitdiff
path: root/modules/bar/components/workspaces
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-01 12:54:00 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-01 12:54:00 +1000
commita38de28e72e49c7a50073db23447ba5741e51eef (patch)
tree8ecf9e35e4919481cc4985819331421008c97294 /modules/bar/components/workspaces
parentbar: make power actually red (diff)
downloadcaelestia-shell-a38de28e72e49c7a50073db23447ba5741e51eef.tar.gz
caelestia-shell-a38de28e72e49c7a50073db23447ba5741e51eef.tar.bz2
caelestia-shell-a38de28e72e49c7a50073db23447ba5741e51eef.zip
bar: workspaces scroll specialws
Same behaviour as astal workspaces scroll Fix more undef errors Also increase by more when transparent dark layer
Diffstat (limited to 'modules/bar/components/workspaces')
-rw-r--r--modules/bar/components/workspaces/ActiveIndicator.qml6
-rw-r--r--modules/bar/components/workspaces/Workspaces.qml9
2 files changed, 8 insertions, 7 deletions
diff --git a/modules/bar/components/workspaces/ActiveIndicator.qml b/modules/bar/components/workspaces/ActiveIndicator.qml
index 2d33e20..5eb446e 100644
--- a/modules/bar/components/workspaces/ActiveIndicator.qml
+++ b/modules/bar/components/workspaces/ActiveIndicator.qml
@@ -15,9 +15,9 @@ Rectangle {
required property int groupOffset
property int currentIdx: Hyprland.activeWsId - 1 - groupOffset
- property real leading: workspaces[currentIdx][vertical ? "y" : "x"]
- property real trailing: workspaces[currentIdx][vertical ? "y" : "x"]
- property real currentSize: workspaces[currentIdx].size
+ property real leading: (vertical ? workspaces[currentIdx]?.y : workspaces[currentIdx]?.x) ?? 0
+ property real trailing: (vertical ? workspaces[currentIdx]?.y : workspaces[currentIdx]?.x) ?? 0
+ property real currentSize: (workspaces[currentIdx]?.size) ?? 0
property real size: Math.abs(leading - trailing) + currentSize
property real offset: Math.min(leading, trailing)
diff --git a/modules/bar/components/workspaces/Workspaces.qml b/modules/bar/components/workspaces/Workspaces.qml
index a94928b..35cc2b0 100644
--- a/modules/bar/components/workspaces/Workspaces.qml
+++ b/modules/bar/components/workspaces/Workspaces.qml
@@ -57,10 +57,11 @@ Item {
onPressed: event => Hyprland.dispatch(`workspace ${layout.childAt(event.x, event.y).index + root.groupOffset + 1}`)
onWheel: event => {
- if (event.angleDelta.y < 0)
- Hyprland.dispatch(`workspace r+1`);
- else if (event.angleDelta.y > 0 && Hyprland.activeWorkspace.id > 1)
- Hyprland.dispatch(`workspace r-1`);
+ const activeWs = Hyprland.activeClient?.workspace?.name;
+ if (activeWs?.startsWith("special:"))
+ Hyprland.dispatch(`togglespecialworkspace ${activeWs.slice(8)}`);
+ else if (event.angleDelta.y < 0 || Hyprland.activeWsId > 1)
+ Hyprland.dispatch(`workspace r${event.angleDelta.y > 0 ? "-" : "+"}1`);
}
}
}