From 0fc98b26920961f4cf9002f0413684d9c18671cc Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Sun, 1 Mar 2020 19:55:43 +0100 Subject: Experimental blurhash implementation (MXC2448) --- resources/qml/delegates/ImageMessage.qml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'resources') diff --git a/resources/qml/delegates/ImageMessage.qml b/resources/qml/delegates/ImageMessage.qml index cb05021d..62cae42c 100644 --- a/resources/qml/delegates/ImageMessage.qml +++ b/resources/qml/delegates/ImageMessage.qml @@ -11,6 +11,20 @@ Item { height: tooHigh ? timelineRoot.height / 2 : tempHeight width: tooHigh ? (timelineRoot.height / 2) / model.data.proportionalHeight : tempWidth + Image { + id: blurhash + anchors.fill: parent + visible: img.status != Image.Ready + + source: model.data.blurhash ? ("image://blurhash/" + model.data.blurhash) : ("image://colorimage/:/icons/icons/ui/do-not-disturb-rounded-sign@2x.png?"+colors.buttonText) + asynchronous: true + fillMode: Image.PreserveAspectFit + + + sourceSize.width: parent.width + sourceSize.height: parent.height + } + Image { id: img anchors.fill: parent -- cgit 1.4.1