From becc127dc41c2330c4e454c208fcaca87fce452e Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Thu, 15 May 2025 15:34:29 -0400 Subject: [PATCH] Add share action to the maximize delegate Self-explanatory, you know how this works! Enables sharing images out of NeoChat more easily other Purpose-enabled applications. BUG: 466382 --- src/app/qml/NeochatMaximizeComponent.qml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/app/qml/NeochatMaximizeComponent.qml b/src/app/qml/NeochatMaximizeComponent.qml index fc9ff7f48..84485a87d 100644 --- a/src/app/qml/NeochatMaximizeComponent.qml +++ b/src/app/qml/NeochatMaximizeComponent.qml @@ -29,6 +29,21 @@ Components.AlbumMaximizeComponent { readonly property var currentProgressInfo: model.data(model.index(content.currentIndex, 0), TimelineMessageModel.ProgressInfoRole) + actions: [ + ShareAction { + id: shareAction + inputData: { + urls: [filename], + mimeType: [attachmentMimetype] + } + visible: Qt.platform.os !== "android" + room: root.currentRoom + eventId: root.currentEventId + readonly property string filename: Core.StandardPaths.writableLocation(Core.StandardPaths.CacheLocation) + "/" + root.currentEventId.replace(":", "_").replace("/", "_").replace("+", "_") + root.currentRoom.fileNameToDownload(eventId) + readonly property string attachmentMimetype: FileType.mimeTypeForUrl(filename).name + } + ] + onCurrentProgressInfoChanged: () => { if (root.currentProgressInfo) { root.downloadAction.progress = root.currentProgressInfo.progress / root.currentProgressInfo.total * 100.0;