Show blurhashes for image events

This commit is contained in:
Tobias Fella
2021-08-21 00:19:07 +02:00
parent dada3e300b
commit 046e823d1b
10 changed files with 291 additions and 8 deletions

View File

@@ -11,6 +11,9 @@ ApplicationWindow {
property string filename
property url localPath
property string blurhash: ""
property int imageWidth: -1
property int imageHeight: -1
flags: Qt.FramelessWindowHint | Qt.WA_TranslucentBackground
visibility: Qt.WindowFullScreen
@@ -29,22 +32,29 @@ ApplicationWindow {
}
BusyIndicator {
visible: image.status !== Image.Ready
anchors.centerIn: parent
running: visible
visible: image.status !== Image.Ready && root.blurhash === ""
anchors.centerIn: parent
running: visible
}
AnimatedImage {
id: image
id: image
anchors.centerIn: parent
width: Math.min(sourceSize.width, root.width)
height: Math.min(sourceSize.height, root.height)
width: Math.min(root.imageWidth !== -1 ? root.imageWidth : sourceSize.width, root.width)
height: Math.min(root.imageHeight !== -1 ? root.imageWidth : sourceSize.height, root.height)
cache: false
fillMode: Image.PreserveAspectFit
source: localPath
Image {
anchors.centerIn: parent
width: image.width
height: image.height
source: root.blurhash !== "" ? ("image://blurhash/" + root.blurhash) : ""
visible: root.blurhash !== "" && parent.status !== Image.Ready
}
}
Button {