NPill: added support for middle mouse button
This commit is contained in:
parent
0915071299
commit
f3d1d15b61
1 changed files with 5 additions and 1 deletions
|
|
@ -29,6 +29,7 @@ Item {
|
||||||
signal exited
|
signal exited
|
||||||
signal clicked
|
signal clicked
|
||||||
signal rightClicked
|
signal rightClicked
|
||||||
|
signal middleClicked
|
||||||
signal wheel(int delta)
|
signal wheel(int delta)
|
||||||
|
|
||||||
// Internal state
|
// Internal state
|
||||||
|
|
@ -207,7 +208,7 @@ Item {
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
|
||||||
onEntered: {
|
onEntered: {
|
||||||
root.entered()
|
root.entered()
|
||||||
tooltip.show()
|
tooltip.show()
|
||||||
|
|
@ -231,6 +232,9 @@ Item {
|
||||||
} else if (mouse.button === Qt.RightButton) {
|
} else if (mouse.button === Qt.RightButton) {
|
||||||
root.rightClicked()
|
root.rightClicked()
|
||||||
}
|
}
|
||||||
|
else if (mouse.button === Qt.MiddleButton) {
|
||||||
|
root.middleClicked()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
onWheel: wheel => {
|
onWheel: wheel => {
|
||||||
root.wheel(wheel.angleDelta.y)
|
root.wheel(wheel.angleDelta.y)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue