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
This commit is contained in:
Joshua Goins
2025-05-15 15:34:29 -04:00
parent e2742cbf8b
commit becc127dc4

View File

@@ -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;