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 exited
|
||||||
signal clicked
|
signal clicked
|
||||||
signal rightClicked
|
signal rightClicked
|
||||||
|
signal middleClicked
|
||||||
|
|
||||||
implicitWidth: size
|
implicitWidth: size
|
||||||
implicitHeight: size
|
implicitHeight: size
|
||||||
|
|
@ -59,7 +60,7 @@ Rectangle {
|
||||||
enabled: root.enabled
|
enabled: root.enabled
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
cursorShape: root.enabled ? Qt.PointingHandCursor : Qt.ArrowCursor
|
cursorShape: root.enabled ? Qt.PointingHandCursor : Qt.ArrowCursor
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
onEntered: {
|
onEntered: {
|
||||||
hovering = true
|
hovering = true
|
||||||
|
|
@ -83,6 +84,8 @@ Rectangle {
|
||||||
root.clicked()
|
root.clicked()
|
||||||
} else if (mouse.button === Qt.RightButton) {
|
} else if (mouse.button === Qt.RightButton) {
|
||||||
root.rightClicked()
|
root.rightClicked()
|
||||||
|
} else if (mouse.button === Qt.MiddleButton) {
|
||||||
|
root.middleClicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue