From 665c00645bae701e081f7de25ca9dc93aeff9388 Mon Sep 17 00:00:00 2001 From: miruka Date: Mon, 16 Mar 2020 00:15:47 -0400 Subject: [PATCH] Fix displaying transparent GIFs --- src/gui/Base/HImage.qml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/gui/Base/HImage.qml b/src/gui/Base/HImage.qml index 23569061..aac80469 100644 --- a/src/gui/Base/HImage.qml +++ b/src/gui/Base/HImage.qml @@ -45,6 +45,24 @@ Image { horizontalAlignment: image.horizontalAlignment verticalAlignment: image.verticalAlignment + // Hack to make the non-animated image behind this one + // basically invisible + Binding { + target: image + property: "fillMode" + value: Image.Pad + } + Binding { + target: image + property: "sourceSize.width" + value: 1 + } + Binding { + target: image + property: "sourceSize.height" + value: 1 + } + // Online GIFs won't be able to loop if cache is set to false, // but caching GIFs is expansive. cache: ! Qt.resolvedUrl(source).startsWith("file://")