nosignal-shell/components/AnimLoader.qml
2026-06-07 00:02:10 +10:00

40 lines
753 B
QML

import QtQuick
Loader {
id: root
property Component sourceComp
property bool isComplete
asynchronous: true
Component.onCompleted: {
isComplete = true;
sourceComponent = sourceComp;
}
onSourceCompChanged: {
if (isComplete)
anim.restart();
}
SequentialAnimation {
id: anim
running: false
Anim {
target: root
property: "opacity"
to: 0
type: Anim.FastEffects
}
ScriptAction {
script: root.sourceComponent = root.sourceComp
}
Anim {
target: root
property: "opacity"
to: 1
type: Anim.DefaultEffects
}
}
}