1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-03 20:32:07 -04:00

widgets: fallback when AnimatedImage probe fails to static Image

This commit is contained in:
bbedward
2026-02-23 19:03:14 -05:00
parent e83da53162
commit 056f298cdf

View File

@@ -65,11 +65,17 @@ Rectangle {
Connections { Connections {
target: probe target: probe
function onStatusChanged() { function onStatusChanged() {
if (probe.status !== Image.Ready) switch (probe.status) {
return; case Image.Ready:
if (probe.frameCount <= 1) { if (probe.frameCount <= 1) {
staticImage.source = root.imageSource;
probe.source = "";
}
break;
case Image.Error:
staticImage.source = root.imageSource; staticImage.source = root.imageSource;
probe.source = ""; probe.source = "";
break;
} }
} }
} }