summaryrefslogtreecommitdiff
path: root/modules/bar
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-07 15:13:09 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-07 15:13:09 +1000
commit5948d581fd25a28fdad42fb127383aabe2dde1ef (patch)
tree9ed0bba548648868b4b3742619258e5b2e18752e /modules/bar
parentbar: fix active workspace indicator anims (diff)
downloadcaelestia-shell-5948d581fd25a28fdad42fb127383aabe2dde1ef.tar.gz
caelestia-shell-5948d581fd25a28fdad42fb127383aabe2dde1ef.tar.bz2
caelestia-shell-5948d581fd25a28fdad42fb127383aabe2dde1ef.zip
bar: fix workspaces interactions
Fix clicking on workspaces not switching to them
Diffstat (limited to 'modules/bar')
-rw-r--r--modules/bar/Bar.qml16
-rw-r--r--modules/bar/components/workspaces/Workspaces.qml9
2 files changed, 15 insertions, 10 deletions
diff --git a/modules/bar/Bar.qml b/modules/bar/Bar.qml
index 914ee24..c851bbc 100644
--- a/modules/bar/Bar.qml
+++ b/modules/bar/Bar.qml
@@ -80,7 +80,7 @@ Item {
anchors.topMargin: Appearance.padding.large
}
- StyledClippingRect {
+ StyledRect {
id: workspaces
anchors.horizontalCenter: parent.horizontalCenter
@@ -93,6 +93,20 @@ Item {
implicitWidth: workspacesInner.implicitWidth + Appearance.padding.small * 2
implicitHeight: workspacesInner.implicitHeight + Appearance.padding.small * 2
+ MouseArea {
+ anchors.fill: parent
+ anchors.leftMargin: -BorderConfig.thickness
+ anchors.rightMargin: -BorderConfig.thickness
+
+ onWheel: event => {
+ 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`);
+ }
+ }
+
Workspaces {
id: workspacesInner
diff --git a/modules/bar/components/workspaces/Workspaces.qml b/modules/bar/components/workspaces/Workspaces.qml
index 8a1c49c..4f4c75b 100644
--- a/modules/bar/components/workspaces/Workspaces.qml
+++ b/modules/bar/components/workspaces/Workspaces.qml
@@ -65,20 +65,11 @@ Item {
MouseArea {
anchors.fill: parent
- anchors.leftMargin: -(Appearance.padding.small + BorderConfig.thickness)
- anchors.rightMargin: -(Appearance.padding.small + BorderConfig.thickness)
onPressed: event => {
const ws = layout.childAt(event.x, event.y).index + root.groupOffset + 1;
if (Hyprland.activeWsId !== ws)
Hyprland.dispatch(`workspace ${ws}`);
}
- onWheel: event => {
- 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`);
- }
}
}