Merge pull request #10 from rinigus/touch-right
Fix activation of right-click on touch devices
This commit is contained in:
commit
a4978a43f7
|
@ -110,12 +110,21 @@ HButton {
|
||||||
|
|
||||||
TapHandler {
|
TapHandler {
|
||||||
acceptedButtons: Qt.RightButton
|
acceptedButtons: Qt.RightButton
|
||||||
|
acceptedPointerTypes: PointerDevice.GenericPointer | PointerDevice.Pen
|
||||||
onTapped: {
|
onTapped: {
|
||||||
rightClicked()
|
rightClicked()
|
||||||
if (contextMenu) contextMenuLoader.active = true
|
if (contextMenu) contextMenuLoader.active = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TapHandler {
|
||||||
|
acceptedPointerTypes: PointerDevice.Finger | PointerDevice.Pen
|
||||||
|
onLongPressed: {
|
||||||
|
rightClicked()
|
||||||
|
if (contextMenu) contextMenuLoader.active = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
enabled: contextMenuLoader.status === Loader.Ready
|
enabled: contextMenuLoader.status === Loader.Ready
|
||||||
target: contextMenuLoader.item
|
target: contextMenuLoader.item
|
||||||
|
|
|
@ -106,9 +106,15 @@ HColumnLayout {
|
||||||
|
|
||||||
TapHandler {
|
TapHandler {
|
||||||
acceptedButtons: Qt.RightButton
|
acceptedButtons: Qt.RightButton
|
||||||
|
acceptedPointerTypes: PointerDevice.GenericPointer | PointerDevice.Pen
|
||||||
onTapped: openContextMenu()
|
onTapped: openContextMenu()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TapHandler {
|
||||||
|
acceptedPointerTypes: PointerDevice.Finger | PointerDevice.Pen
|
||||||
|
onLongPressed: openContextMenu()
|
||||||
|
}
|
||||||
|
|
||||||
HMenu {
|
HMenu {
|
||||||
id: contextMenu
|
id: contextMenu
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user