Commit 214cbeaf authored by Fushan Wen's avatar Fushan Wen 💬
Browse files

wallpapers/image: unify coding style in `replaceWhenLoaded()`

parent 02d56ca8
Pipeline #198511 passed with stage
in 6 minutes and 14 seconds
......@@ -157,22 +157,24 @@ QQC2.StackView {
}
function replaceWhenLoaded() {
if (pendingImage.status !== Image.Loading) {
// BUG 454908: Update accent color
pendingImage.QQC2.StackView.onActivated.connect(wallpaper.repaintNeeded);
pendingImage.QQC2.StackView.onRemoved.connect(pendingImage.destroy);
root.replace(pendingImage, {},
doesSkipAnimation ? QQC2.StackView.Immediate : QQC2.StackView.Transition);
pendingImage.statusChanged.disconnect(replaceWhenLoaded);
if (pendingImage.status === Image.Loading) {
return;
}
wallpaper.loading = false;
// BUG 454908: Update accent color
pendingImage.QQC2.StackView.onActivated.connect(wallpaper.repaintNeeded);
pendingImage.QQC2.StackView.onRemoved.connect(pendingImage.destroy);
root.replace(pendingImage, {},
doesSkipAnimation ? QQC2.StackView.Immediate : QQC2.StackView.Transition);
pendingImage.statusChanged.disconnect(replaceWhenLoaded);
if (pendingImage.status !== Image.Ready) {
mediaProxy.useSingleImageDefaults();
}
wallpaper.loading = false;
pendingImage = null;
if (pendingImage.status !== Image.Ready) {
mediaProxy.useSingleImageDefaults();
}
pendingImage = null;
}
replaceEnter: Transition {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment