summary refs log tree commit diff
path: root/resources/qml/TimelineView.qml
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-04-29 23:38:45 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2021-04-29 23:38:45 +0200
commit2d678bdcf6d23dc82ad5edbb55443003e170fca3 (patch)
tree54491fffb9b3e78c561f1d065cd4afe64a0eee04 /resources/qml/TimelineView.qml
parentCopy address location (diff)
downloadnheko-2d678bdcf6d23dc82ad5edbb55443003e170fca3.tar.xz
Allow copying messages via right click
fixes #291
Diffstat (limited to 'resources/qml/TimelineView.qml')
-rw-r--r--resources/qml/TimelineView.qml14
1 files changed, 13 insertions, 1 deletions
diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml
index ce5d54c0..442047d5 100644
--- a/resources/qml/TimelineView.qml
+++ b/resources/qml/TimelineView.qml
@@ -93,15 +93,20 @@ Page {
 
         property string eventId
         property string link
+        property string text
         property int eventType
         property bool isEncrypted
         property bool isEditable
 
-        function show(eventId_, eventType_, isEncrypted_, isEditable_, link_, showAt_) {
+        function show(eventId_, eventType_, isEncrypted_, isEditable_, link_, text_, showAt_) {
             eventId = eventId_;
             eventType = eventType_;
             isEncrypted = isEncrypted_;
             isEditable = isEditable_;
+            if (text_)
+                text = text_;
+            else
+                text = "";
             if (link_)
                 link = link_;
             else
@@ -113,6 +118,13 @@ Page {
         }
 
         Platform.MenuItem {
+            visible: messageContextMenu.text
+            enabled: visible
+            text: qsTr("Copy")
+            onTriggered: Clipboard.text = messageContextMenu.text
+        }
+
+        Platform.MenuItem {
             visible: messageContextMenu.link
             enabled: visible
             text: qsTr("Copy address location")