fix(profile/qr) add Copy/Download menu for QR code

add a regular image context menu with:
- "Copy image" -> copy the image to clipboard
- "Download image" -> downloads the image in the user specified folder

Fixes #13479
This commit is contained in:
Lukáš Tinkl 2024-02-12 18:05:15 +01:00 committed by Lukáš Tinkl
parent 520b658c09
commit 0f1fc3b241
2 changed files with 21 additions and 0 deletions

View File

@ -40,6 +40,14 @@ SplitView {
return url
}
function copyImageToClipboardByUrl(data) {
logs.logEvent("Utils::copyImageToClipboardByUrl", ["data"], arguments)
}
function downloadImageByUrl(url, path) {
logs.logEvent("Utils::downloadImageByUrl", ["url", "path"], arguments)
}
Component.onCompleted: {
Utils.globalUtilsInst = this
root.globalUtilsReady = true

View File

@ -9,6 +9,7 @@ import StatusQ.Popups.Dialog 0.1
import utils 1.0
import shared.controls 1.0
import shared.views.chat 1.0
StatusDialog {
id: root
@ -37,6 +38,18 @@ StatusDialog {
mipmap: true
smooth: false
source: root.qrCode
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.RightButton
cursorShape: Qt.PointingHandCursor
onClicked: qrContextMenu.popup()
}
ImageContextMenu {
id: qrContextMenu
imageSource: root.qrCode
}
}
StatusBaseText {