From 5058e3c13e427fdaae602e160cfaabb926a72832 Mon Sep 17 00:00:00 2001 From: Rinigus Date: Tue, 24 Mar 2020 16:42:41 +0200 Subject: [PATCH 1/2] Fix activation of right-click on touch devices --- src/gui/Base/HTile.qml | 9 +++++++++ src/gui/Pages/Chat/Timeline/EventDelegate.qml | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/src/gui/Base/HTile.qml b/src/gui/Base/HTile.qml index bb6bcccd..c4aca9db 100644 --- a/src/gui/Base/HTile.qml +++ b/src/gui/Base/HTile.qml @@ -110,12 +110,21 @@ HButton { TapHandler { acceptedButtons: Qt.RightButton + acceptedPointerTypes: PointerDevice.GenericPointer 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 diff --git a/src/gui/Pages/Chat/Timeline/EventDelegate.qml b/src/gui/Pages/Chat/Timeline/EventDelegate.qml index d0139dd8..393ade52 100644 --- a/src/gui/Pages/Chat/Timeline/EventDelegate.qml +++ b/src/gui/Pages/Chat/Timeline/EventDelegate.qml @@ -106,9 +106,15 @@ HColumnLayout { TapHandler { acceptedButtons: Qt.RightButton + acceptedPointerTypes: PointerDevice.GenericPointer onTapped: openContextMenu() } + TapHandler { + acceptedPointerTypes: PointerDevice.Finger | PointerDevice.Pen + onLongPressed: openContextMenu() + } + HMenu { id: contextMenu From d17c6334da0b6e85a9eeaa62be5fe09e2df3f228 Mon Sep 17 00:00:00 2001 From: Rinigus Date: Tue, 24 Mar 2020 19:52:48 +0200 Subject: [PATCH 2/2] Add pen as an input device to the right click handler --- src/gui/Base/HTile.qml | 2 +- src/gui/Pages/Chat/Timeline/EventDelegate.qml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/Base/HTile.qml b/src/gui/Base/HTile.qml index c4aca9db..677498f6 100644 --- a/src/gui/Base/HTile.qml +++ b/src/gui/Base/HTile.qml @@ -110,7 +110,7 @@ HButton { TapHandler { acceptedButtons: Qt.RightButton - acceptedPointerTypes: PointerDevice.GenericPointer + acceptedPointerTypes: PointerDevice.GenericPointer | PointerDevice.Pen onTapped: { rightClicked() if (contextMenu) contextMenuLoader.active = true diff --git a/src/gui/Pages/Chat/Timeline/EventDelegate.qml b/src/gui/Pages/Chat/Timeline/EventDelegate.qml index 393ade52..7def3fdd 100644 --- a/src/gui/Pages/Chat/Timeline/EventDelegate.qml +++ b/src/gui/Pages/Chat/Timeline/EventDelegate.qml @@ -106,7 +106,7 @@ HColumnLayout { TapHandler { acceptedButtons: Qt.RightButton - acceptedPointerTypes: PointerDevice.GenericPointer + acceptedPointerTypes: PointerDevice.GenericPointer | PointerDevice.Pen onTapped: openContextMenu() }