bar: workspaces events

This commit is contained in:
2 * r + 2 * t 2025-04-28 18:31:00 +10:00
parent 123676bd42
commit 41600c94dd
2 changed files with 16 additions and 0 deletions

View file

@ -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

View file

@ -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