diff --git a/ui/app/AppLayouts/Wallet/CollectiblesTab.qml b/ui/app/AppLayouts/Wallet/CollectiblesTab.qml index 31e79be12b..072c1f0bb8 100644 --- a/ui/app/AppLayouts/Wallet/CollectiblesTab.qml +++ b/ui/app/AppLayouts/Wallet/CollectiblesTab.qml @@ -9,33 +9,26 @@ Item { visible: walletModel.collectibles.rowCount() === 0 } - SVGImage { + Loader { id: loadingImg - visible: false + active: false + sourceComponent: loadingImageComponent anchors.right: parent.right anchors.rightMargin: Style.current.padding anchors.top: parent.top anchors.topMargin: Style.currentPadding anchors.verticalCenter: txtPassword.verticalCenter - // TODO replace by a real loading image - source: "../../img/settings.svg" - width: 30 - height: 30 - fillMode: Image.Stretch - RotationAnimator { - target: loadingImg; - from: 0; - to: 360; - duration: 1200 - running: true - loops: Animation.Infinite - } + } + + Component { + id: loadingImageComponent + LoadingImage {} } Connections { target: walletModel onLoadingCollectibles: { - loadingImg.visible = isLoading + loadingImg.active = isLoading } } diff --git a/ui/shared/LoadingImage.qml b/ui/shared/LoadingImage.qml new file mode 100644 index 0000000000..ed3b3b4329 --- /dev/null +++ b/ui/shared/LoadingImage.qml @@ -0,0 +1,19 @@ +import QtQuick 2.13 +import "." + +SVGImage { + id: loadingImg + // TODO replace by a real loading image + source: "../app/img/settings.svg" + width: 30 + height: 30 + fillMode: Image.Stretch + RotationAnimator { + target: loadingImg; + from: 0; + to: 360; + duration: 1200 + running: true + loops: Animation.Infinite + } +} \ No newline at end of file