diff --git a/resources/qml/delegates/Reply.qml b/resources/qml/delegates/Reply.qml index 8bbce10ee..b98820ed7 100644 --- a/resources/qml/delegates/Reply.qml +++ b/resources/qml/delegates/Reply.qml @@ -7,6 +7,7 @@ import QtQuick.Controls 2.3 import QtQuick.Layouts 1.2 import QtQuick.Window 2.13 import im.nheko 1.0 +import Qt.labs.platform 1.1 as Platform Item { id: r @@ -41,6 +42,40 @@ Item { gesturePolicy: TapHandler.ReleaseWithinBounds } + Platform.Menu { + id: replyContextMenu + + property string text + property string link + + function show(text_, link_) { + text = text_; + link = link_; + open(); + } + + Platform.MenuItem { + visible: replyContextMenu.text + enabled: visible + text: qsTr("&Copy") + onTriggered: Clipboard.text = replyContextMenu.text + } + + Platform.MenuItem { + visible: replyContextMenu.link + enabled: visible + text: qsTr("Copy &link location") + onTriggered: Clipboard.text = replyContextMenu.link + } + + } + + TapHandler { + acceptedButtons: Qt.RightButton + onSingleTapped: replyContextMenu.show(reply.child.copyText, reply.child.hoveredLink) + gesturePolicy: TapHandler.ReleaseWithinBounds + } + CursorShape { anchors.fill: parent cursorShape: Qt.PointingHandCursor @@ -99,11 +134,10 @@ Item { callType: r.callType relatedEventCacheBuster: r.relatedEventCacheBuster encryptionError: r.encryptionError - enabled: false + enabled: true width: parent.width isReply: true } - } Rectangle {