Merge pull request #10 from rinigus/touch-right

Fix activation of right-click on touch devices
This commit is contained in:
miruka 2020-03-24 14:05:50 -04:00 committed by GitHub
commit a4978a43f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View File

@ -110,12 +110,21 @@ HButton {
TapHandler {
acceptedButtons: Qt.RightButton
acceptedPointerTypes: PointerDevice.GenericPointer | PointerDevice.Pen
onTapped: {
rightClicked()
if (contextMenu) contextMenuLoader.active = true
}
}
TapHandler {
acceptedPointerTypes: PointerDevice.Finger | PointerDevice.Pen
onLongPressed: {
rightClicked()
if (contextMenu) contextMenuLoader.active = true
}
}
Connections {
enabled: contextMenuLoader.status === Loader.Ready
target: contextMenuLoader.item

View File

@ -106,9 +106,15 @@ HColumnLayout {
TapHandler {
acceptedButtons: Qt.RightButton
acceptedPointerTypes: PointerDevice.GenericPointer | PointerDevice.Pen
onTapped: openContextMenu()
}
TapHandler {
acceptedPointerTypes: PointerDevice.Finger | PointerDevice.Pen
onLongPressed: openContextMenu()
}
HMenu {
id: contextMenu