bar: workspaces: back mouse button to toggle special

This commit is contained in:
end-4
2026-07-25 10:57:22 +07:00
parent 7e61a6a56a
commit 1a9ffb78f0
@@ -46,7 +46,7 @@ ButtonMouseArea {
}
// Interactions
acceptedButtons: Qt.LeftButton | Qt.RightButton
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.BackButton
hoverEnabled: true
property int hoverIndex: {
const position = root.vertical ? mouseY : mouseX;
@@ -56,11 +56,18 @@ ButtonMouseArea {
function switchWorkspaceToHovered() {
Hyprland.dispatch(`hl.dsp.focus({workspace = ${wsModel.getWorkspaceIdAt(hoverIndex)}})`);
}
function toggleSpecial() {
Hyprland.dispatch(`hl.dsp.workspace.toggle_special("special")`);
}
onPressed: mouse => {
if (mouse.button == Qt.LeftButton)
switchWorkspaceToHovered();
else if (mouse.button == Qt.RightButton)
GlobalStates.overviewOpen = !GlobalStates.overviewOpen;
else if (mouse.button == Qt.BackButton)
toggleSpecial()
}
onWheel: event => {
if (event.angleDelta.y < 0)