From 5948d581fd25a28fdad42fb127383aabe2dde1ef Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Sat, 7 Jun 2025 15:13:09 +1000 Subject: bar: fix workspaces interactions Fix clicking on workspaces not switching to them --- modules/bar/Bar.qml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'modules/bar/Bar.qml') 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 -- cgit v1.2.3-freya