Archived
1
Fork 0
This repository has been archived on 2025-04-12. You can view files and clone it, but cannot push or open issues or pull requests.
trinity/ImageViewer.qml
2021-07-21 16:08:15 -04:00

50 lines
805 B
QML

import QtQuick 2.0
Rectangle {
anchors.fill: parent
color: Qt.rgba(0.0, 0.0, 0.0, 0.5)
property string url
Image {
id: imagePreview
width: 500
fillMode: Image.PreserveAspectFit
anchors.centerIn: parent
source: url
}
Text {
id: downloadLink
anchors.right: imagePreview.right
anchors.top: imagePreview.bottom
anchors.topMargin: 5
text: "Download"
color: "#048dc2"
z: 5
MouseArea {
anchors.fill: downloadLink
cursorShape: Qt.PointingHandCursor
onReleased: Qt.openUrlExternally(url)
}
}
MouseArea {
anchors.fill: parent
propagateComposedEvents: true
onReleased: parent.destroy()
}
}