From 5058e3c13e427fdaae602e160cfaabb926a72832 Mon Sep 17 00:00:00 2001 From: Rinigus Date: Tue, 24 Mar 2020 16:42:41 +0200 Subject: [PATCH] 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