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:
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user