mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-08-04 23:13:05 +10:00
bar: workspaces: back mouse button to toggle special
This commit is contained in:
@@ -46,7 +46,7 @@ ButtonMouseArea {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Interactions
|
// Interactions
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.BackButton
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
property int hoverIndex: {
|
property int hoverIndex: {
|
||||||
const position = root.vertical ? mouseY : mouseX;
|
const position = root.vertical ? mouseY : mouseX;
|
||||||
@@ -56,11 +56,18 @@ ButtonMouseArea {
|
|||||||
function switchWorkspaceToHovered() {
|
function switchWorkspaceToHovered() {
|
||||||
Hyprland.dispatch(`hl.dsp.focus({workspace = ${wsModel.getWorkspaceIdAt(hoverIndex)}})`);
|
Hyprland.dispatch(`hl.dsp.focus({workspace = ${wsModel.getWorkspaceIdAt(hoverIndex)}})`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function toggleSpecial() {
|
||||||
|
Hyprland.dispatch(`hl.dsp.workspace.toggle_special("special")`);
|
||||||
|
}
|
||||||
|
|
||||||
onPressed: mouse => {
|
onPressed: mouse => {
|
||||||
if (mouse.button == Qt.LeftButton)
|
if (mouse.button == Qt.LeftButton)
|
||||||
switchWorkspaceToHovered();
|
switchWorkspaceToHovered();
|
||||||
else if (mouse.button == Qt.RightButton)
|
else if (mouse.button == Qt.RightButton)
|
||||||
GlobalStates.overviewOpen = !GlobalStates.overviewOpen;
|
GlobalStates.overviewOpen = !GlobalStates.overviewOpen;
|
||||||
|
else if (mouse.button == Qt.BackButton)
|
||||||
|
toggleSpecial()
|
||||||
}
|
}
|
||||||
onWheel: event => {
|
onWheel: event => {
|
||||||
if (event.angleDelta.y < 0)
|
if (event.angleDelta.y < 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user