forked from Shinonome/dots-hyprland
groupbutton: press and hold for alt action
This commit is contained in:
@@ -93,13 +93,23 @@ Button {
|
|||||||
root.down = false
|
root.down = false
|
||||||
if (event.button != Qt.LeftButton) return;
|
if (event.button != Qt.LeftButton) return;
|
||||||
if (root.releaseAction) root.releaseAction();
|
if (root.releaseAction) root.releaseAction();
|
||||||
root.click() // Because the MouseArea already consumed the event
|
}
|
||||||
|
onClicked: (event) => {
|
||||||
|
if (event.button != Qt.LeftButton) return;
|
||||||
|
root.click()
|
||||||
}
|
}
|
||||||
onCanceled: (event) => {
|
onCanceled: (event) => {
|
||||||
root.down = false
|
root.down = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onPressAndHold: () => {
|
||||||
|
altAction();
|
||||||
|
root.down = false;
|
||||||
|
root.clicked = false;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
id: buttonBackground
|
id: buttonBackground
|
||||||
topLeftRadius: root.leftRadius
|
topLeftRadius: root.leftRadius
|
||||||
|
|||||||
Reference in New Issue
Block a user