summary refs log tree commit diff
path: root/resources/qml/delegates
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/delegates
parentCopy address location (diff)
downloadnheko-2d678bdcf6d23dc82ad5edbb55443003e170fca3.tar.xz
Allow copying messages via right click
fixes #291
Diffstat (limited to 'resources/qml/delegates')
-rw-r--r--resources/qml/delegates/TextMessage.qml1
1 files changed, 1 insertions, 0 deletions
diff --git a/resources/qml/delegates/TextMessage.qml b/resources/qml/delegates/TextMessage.qml
index 1624d95c..f44165b4 100644
--- a/resources/qml/delegates/TextMessage.qml
+++ b/resources/qml/delegates/TextMessage.qml
@@ -7,6 +7,7 @@ import im.nheko 1.0
 
 MatrixText {
     property string formatted: model.data.formattedBody
+    property string copyText: selectedText ? getText(selectionStart, selectionEnd) : model.data.body
 
     text: "<style type=\"text/css\">a { color:" + colors.link + ";}\ncode { background-color: " + colors.alternateBase + ";}</style>" + formatted.replace("<pre>", "<pre style='white-space: pre-wrap; background-color: " + colors.alternateBase + "'>")
     width: parent ? parent.width : undefined