summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/bar/Workspaces.qml12
-rw-r--r--widgets/BoxLayout.qml4
2 files changed, 16 insertions, 0 deletions
diff --git a/modules/bar/Workspaces.qml b/modules/bar/Workspaces.qml
index 699185a..97a1934 100644
--- a/modules/bar/Workspaces.qml
+++ b/modules/bar/Workspaces.qml
@@ -41,6 +41,18 @@ Item {
}
}
+ MouseArea {
+ anchors.fill: parent
+
+ onPressed: event => Hyprland.dispatch(`workspace ${layout.childAt(event.x, event.y).index + 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`);
+ }
+ }
+
Rectangle {
id: active
diff --git a/widgets/BoxLayout.qml b/widgets/BoxLayout.qml
index da68409..2540c72 100644
--- a/widgets/BoxLayout.qml
+++ b/widgets/BoxLayout.qml
@@ -47,6 +47,10 @@ Rectangle {
return pad;
}
+ function childAt(x: real, y: real): Item {
+ return layout.childAt(x, y);
+ }
+
color: "transparent"
implicitWidth: layout.implicitWidth + paddingX