forked from Shinonome/dots-hyprland
hefty: bar: ws: rmb for overview
This commit is contained in:
@@ -141,6 +141,7 @@ HBarWidgetContainer {
|
|||||||
z: 3
|
z: 3
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
property int hoverIndex: {
|
property int hoverIndex: {
|
||||||
const position = root.vertical ? mouseY : mouseX;
|
const position = root.vertical ? mouseY : mouseX;
|
||||||
@@ -150,8 +151,13 @@ HBarWidgetContainer {
|
|||||||
function switchWorkspaceToHovered() {
|
function switchWorkspaceToHovered() {
|
||||||
Hyprland.dispatch(`workspace ${wsModel.getWorkspaceIdAt(hoverIndex)}`)
|
Hyprland.dispatch(`workspace ${wsModel.getWorkspaceIdAt(hoverIndex)}`)
|
||||||
}
|
}
|
||||||
onPressed: switchWorkspaceToHovered()
|
onPressed: (mouse) => {
|
||||||
onWheel: event => {
|
if (mouse.button == Qt.LeftButton)
|
||||||
|
switchWorkspaceToHovered()
|
||||||
|
else if (mouse.button == Qt.RightButton)
|
||||||
|
GlobalStates.overviewOpen = !GlobalStates.overviewOpen;
|
||||||
|
}
|
||||||
|
onWheel: (event) => {
|
||||||
if (event.angleDelta.y < 0)
|
if (event.angleDelta.y < 0)
|
||||||
Hyprland.dispatch(`workspace r+1`);
|
Hyprland.dispatch(`workspace r+1`);
|
||||||
else if (event.angleDelta.y > 0)
|
else if (event.angleDelta.y > 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user