diff --git a/imports/NeoChat/Component/Timeline/MessageDelegate.qml b/imports/NeoChat/Component/Timeline/MessageDelegate.qml index d52462e24..1a3c024a1 100644 --- a/imports/NeoChat/Component/Timeline/MessageDelegate.qml +++ b/imports/NeoChat/Component/Timeline/MessageDelegate.qml @@ -26,13 +26,13 @@ RowLayout { 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 signal saveFileAs() signal openExternally() signal replyClicked(string eventID) signal replyToMessageClicked(var replyUser, string replyContent, string eventID) + signal openContextMenu() id: root @@ -80,6 +80,11 @@ RowLayout { topPadding: 0 bottomPadding: 0 hoverEnabled: true + TapHandler { + acceptedButtons: (Kirigami.Settings.isMobile ? Qt.LeftButton : 0) | Qt.RightButton + onTapped: openContextMenu() + onLongPressed: openContextMenu() + } contentItem: ColumnLayout { id: column spacing: showAuthor ? Kirigami.Units.smallSpacing : 0 diff --git a/imports/NeoChat/Page/RoomPage.qml b/imports/NeoChat/Page/RoomPage.qml index f7ee3cb65..b38bc0b4e 100644 --- a/imports/NeoChat/Page/RoomPage.qml +++ b/imports/NeoChat/Page/RoomPage.qml @@ -250,11 +250,7 @@ Kirigami.ScrollablePage { Layout.fillWidth: true Layout.maximumWidth: messageListView.width isEmote: true - mouseArea: MouseArea { - acceptedButtons: Qt.RightButton - anchors.fill: parent - onClicked: openMessageContext(author, display, eventId, toolTip); - } + onOpenContextMenu: openMessageContext(author, display, eventId, toolTip) onReplyClicked: goToEvent(eventID) onReplyToMessageClicked: replyToMessage(replyUser, replyContent, eventId); innerObject: [ @@ -280,16 +276,7 @@ Kirigami.ScrollablePage { innerObject: MessageDelegate { Layout.fillWidth: true Layout.maximumWidth: messageListView.width - mouseArea: MouseArea { - acceptedButtons: (Kirigami.Settings.isMobile ? Qt.LeftButton : 0) | Qt.RightButton - anchors.fill: parent - onClicked: { - if (mouse.button == Qt.RightButton) { - openMessageContext(author, display, eventId, toolTip); - } - } - onPressAndHold: openMessageContext(author, display, eventId, toolTip); - } + onOpenContextMenu: openMessageContext(author, display, eventId, toolTip) onReplyClicked: goToEvent(eventID) onReplyToMessageClicked: replyToMessage(replyUser, replyContent, eventId); innerObject: [