From ee9f521a379a55cde69d65410adffd508d12d4d7 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Thu, 18 Mar 2021 01:21:16 +0100 Subject: [PATCH] Remove mouseArea from TimelineContainer This was incorect (anchors in layout) and was replaced by TapHandler like the rest of the code was already using. --- .../Component/Timeline/TimelineContainer.qml | 1 - imports/NeoChat/Page/RoomPage.qml | 13 ++++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/imports/NeoChat/Component/Timeline/TimelineContainer.qml b/imports/NeoChat/Component/Timeline/TimelineContainer.qml index 572cd85b2..8c620e6cf 100644 --- a/imports/NeoChat/Component/Timeline/TimelineContainer.qml +++ b/imports/NeoChat/Component/Timeline/TimelineContainer.qml @@ -24,7 +24,6 @@ Item { readonly property color authorColor: eventType == "notice" ? Kirigami.Theme.activeTextColor : author.color readonly property color replyAuthorColor: replyVisible ? reply.author.color : Kirigami.Theme.focusColor - property alias mouseArea: controlContainer.children property bool isEmote: false property bool cardBackground: true property bool isLoaded diff --git a/imports/NeoChat/Page/RoomPage.qml b/imports/NeoChat/Page/RoomPage.qml index 042402bed..2a401bdcf 100644 --- a/imports/NeoChat/Page/RoomPage.qml +++ b/imports/NeoChat/Page/RoomPage.qml @@ -346,11 +346,6 @@ Kirigami.ScrollablePage { width: messageListView.width - Kirigami.Units.largeSpacing isLoaded: timelineDelegateChooser.delegateLoaded isEmote: true - mouseArea: MouseArea { - acceptedButtons: Qt.RightButton - anchors.fill: parent - onClicked: openMessageContext(author, display, eventId, toolTip); - } onReplyClicked: goToEvent(eventID) onReplyToMessageClicked: replyToMessage(replyUser, replyContent, eventId); onEdit: chatBox.edit(message, formattedBody, eventId) @@ -362,6 +357,14 @@ Kirigami.ScrollablePage { Layout.fillWidth: true Layout.rightMargin: Kirigami.Units.largeSpacing Layout.leftMargin: Kirigami.Units.largeSpacing + TapHandler { + acceptedButtons: Qt.RightButton + onTapped: openMessageContext(author, display, eventId, toolTip) + } + TapHandler { + acceptedButtons: Qt.LeftButton + onLongPressed: openMessageContext(author, display, eventId, toolTip) + } } } }