NIconButton: added support for middle click
This commit is contained in:
parent
06a11f003b
commit
1f919e4469
1 changed files with 4 additions and 1 deletions
|
|
@ -28,6 +28,7 @@ Rectangle {
|
|||
signal exited
|
||||
signal clicked
|
||||
signal rightClicked
|
||||
signal middleClicked
|
||||
|
||||
implicitWidth: size
|
||||
implicitHeight: size
|
||||
|
|
@ -59,7 +60,7 @@ Rectangle {
|
|||
enabled: root.enabled
|
||||
anchors.fill: parent
|
||||
cursorShape: root.enabled ? Qt.PointingHandCursor : Qt.ArrowCursor
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
|
||||
hoverEnabled: true
|
||||
onEntered: {
|
||||
hovering = true
|
||||
|
|
@ -83,6 +84,8 @@ Rectangle {
|
|||
root.clicked()
|
||||
} else if (mouse.button === Qt.RightButton) {
|
||||
root.rightClicked()
|
||||
} else if (mouse.button === Qt.MiddleButton) {
|
||||
root.middleClicked()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue