From e117cc0cfbc7fcf6731079a52d3b5751e38d1f9b Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Mon, 2 Sep 2024 12:58:49 -0400 Subject: [PATCH] Move the "Show User" action to DelegateContextMenu, add it for media This was missing from the media context menu, and should be added. Since it's shared between messages and files, it's now a common action. --- src/qml/DelegateContextMenu.qml | 8 ++++++++ src/qml/FileDelegateContextMenu.qml | 1 + src/qml/MessageDelegateContextMenu.qml | 8 +------- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/qml/DelegateContextMenu.qml b/src/qml/DelegateContextMenu.qml index fcab2d25b..40271b488 100644 --- a/src/qml/DelegateContextMenu.qml +++ b/src/qml/DelegateContextMenu.qml @@ -136,6 +136,14 @@ Loader { } } + component ShowUserAction: Kirigami.Action { + text: i18nc("@action:inmenu", "Show User") + icon.name: "username-copy" + onTriggered: { + RoomManager.resolveResource(author.id) + } + } + Component { id: regularMenu diff --git a/src/qml/FileDelegateContextMenu.qml b/src/qml/FileDelegateContextMenu.qml index bb8df60f1..b00ba0e9a 100644 --- a/src/qml/FileDelegateContextMenu.qml +++ b/src/qml/FileDelegateContextMenu.qml @@ -86,6 +86,7 @@ DelegateContextMenu { } }, DelegateContextMenu.ReportMessageAction {}, + DelegateContextMenu.ShowUserAction {}, DelegateContextMenu.ViewSourceAction {} ] diff --git a/src/qml/MessageDelegateContextMenu.qml b/src/qml/MessageDelegateContextMenu.qml index 1d622b429..998425215 100644 --- a/src/qml/MessageDelegateContextMenu.qml +++ b/src/qml/MessageDelegateContextMenu.qml @@ -66,13 +66,7 @@ DelegateContextMenu { onTriggered: Clipboard.saveText(root.selectedText.length > 0 ? root.selectedText : root.plainText) }, DelegateContextMenu.ReportMessageAction {}, - Kirigami.Action { - text: i18nc("@action:inmenu", "Show User") - icon.name: "username-copy" - onTriggered: { - RoomManager.resolveResource(author.id) - } - }, + DelegateContextMenu.ShowUserAction {}, DelegateContextMenu.ViewSourceAction {}, Kirigami.Action { text: i18n("Copy Link")