From 82945ab15309051204e71aaa77b6c67ec3adc640 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Sat, 6 Feb 2021 01:36:59 +0100 Subject: [PATCH] Make right clicking on message works again This is now using TapHandler that can be used in a Layout without warning about undefined behaviors. --- imports/NeoChat/Page/RoomPage.qml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/imports/NeoChat/Page/RoomPage.qml b/imports/NeoChat/Page/RoomPage.qml index 7b4095874..958055e09 100644 --- a/imports/NeoChat/Page/RoomPage.qml +++ b/imports/NeoChat/Page/RoomPage.qml @@ -351,20 +351,18 @@ Kirigami.ScrollablePage { onReplyClicked: goToEvent(eventID) onReplyToMessageClicked: replyToMessage(replyUser, replyContent, eventId); innerObject: [ - MouseArea { - acceptedButtons: (Kirigami.Settings.isMobile ? Qt.LeftButton : 0) | Qt.RightButton - Layout.fillWidth: true - Layout.fillHeight: true - onClicked: { - if (mouse.button == Qt.RightButton) { - openMessageContext(author, display, eventId, toolTip); - } - } - onPressAndHold: openMessageContext(author, display, eventId, toolTip); - }, TextDelegate { Layout.fillWidth: true Layout.rightMargin: Kirigami.Units.largeSpacing + TapHandler { + acceptedButtons: Qt.RightButton + onTapped: openMessageContext(author, display, eventId, toolTip) + } + TapHandler { + acceptedButtons: Qt.LeftButton + //enabled: Kirigami.Settings.isMobile + onLongPressed: openMessageContext(author, display, eventId, toolTip) + } }, ReactionDelegate { Layout.fillWidth: true