Fix image events opened/copied url

This commit is contained in:
miruka
2019-11-04 10:46:06 -04:00
parent ca09effd6e
commit de8d0b5823
3 changed files with 21 additions and 6 deletions

View File

@@ -3,10 +3,18 @@ import QtQuick 2.12
HImage {
id: image
source: sourceOverride || (show ? cachedPath : "")
onMxcChanged: Qt.callLater(update)
onWidthChanged: Qt.callLater(update)
onHeightChanged: Qt.callLater(update)
onVisibleChanged: Qt.callLater(update)
onMxcChanged: {
Qt.callLater(update)
if (mxc.startsWith("mxc://")) {
py.callCoro("mxc_to_http", [mxc], http => { httpUrl = http || "" })
} else {
httpUrl = mxc
}
}
property string clientUserId
@@ -16,6 +24,7 @@ HImage {
property bool show: false
property string cachedPath: ""
property string httpUrl: ""
function update() {