From 1366158b4572fbebe3a494370869b3df52d9505b Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Sun, 27 Nov 2022 19:50:29 +0100 Subject: [PATCH] Add menu items to copy matrix.to links for users and messages BUG: 456637 --- src/CMakeLists.txt | 2 ++ src/qml/Dialog/UserDetailDialog.qml | 9 +++++++++ src/qml/Menu/Timeline/MessageDelegateContextMenu.qml | 7 +++++++ 3 files changed, 18 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2b6e61cc2..1e35f9fdd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -165,6 +165,8 @@ if(ANDROID) "download" "smiley" "tools-check-spelling" + "username-copy" + "edit-copy" ) else() target_link_libraries(neochat PUBLIC Qt::Widgets KF5::KIOWidgets) diff --git a/src/qml/Dialog/UserDetailDialog.qml b/src/qml/Dialog/UserDetailDialog.qml index 86c3a76b1..b2e574f79 100644 --- a/src/qml/Dialog/UserDetailDialog.qml +++ b/src/qml/Dialog/UserDetailDialog.qml @@ -160,6 +160,15 @@ Kirigami.OverlaySheet { } } } + Kirigami.BasicListItem { + action: Kirigami.Action { + text: i18n("Copy link") + icon.name: "username-copy" + onTriggered: { + Clipboard.saveText("https://matrix.to/#/" + user.id) + } + } + } Component { id: fullScreenImage diff --git a/src/qml/Menu/Timeline/MessageDelegateContextMenu.qml b/src/qml/Menu/Timeline/MessageDelegateContextMenu.qml index 8b4f2e973..11057cf80 100644 --- a/src/qml/Menu/Timeline/MessageDelegateContextMenu.qml +++ b/src/qml/Menu/Timeline/MessageDelegateContextMenu.qml @@ -76,6 +76,13 @@ Loader { width: Kirigami.Units.gridUnit * 25 }); } + }, + Kirigami.Action { + text: i18n("Copy Link") + icon.name: "edit-copy" + onTriggered: { + Clipboard.saveText("https://matrix.to/#/" + currentRoom.id + "/" + loadRoot.eventId) + } } ]