Added refresh moving icon for feedback purpose

While refreshing the material sync, no feedback was provided before, now there is a refreshing icon animation available for "refresh in progress"

fixes: CURA-8754
This commit is contained in:
saumya.jain 2023-07-10 14:36:14 +02:00
parent cca33bb4a5
commit d12659f71f

View File

@ -430,17 +430,19 @@ UM.Window
{ {
id: refreshListButton id: refreshListButton
property int accountState: Cura.API.account.syncState property int accountState: Cura.API.account.syncState
readonly property int _AccountSyncState_SYNCING: 0
readonly property int _AccountSyncState_SUCCESS: 1
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
text: catalog.i18nc("@button", "Refresh List") text: catalog.i18nc("@button", "Refresh List")
iconSource: UM.Theme.getIcon("ArrowDoubleCircleRight") iconSource: UM.Theme.getIcon("ArrowDoubleCircleRight")
onClicked: Cura.API.account.sync(true) onClicked: Cura.API.account.sync(true)
onAccountStateChanged: { onAccountStateChanged: {
if (Cura.API.account.syncState == 0) if (Cura.API.account.syncState == _AccountSyncState_SYNCING)
{ {
refreshListButton.visible = false; refreshListButton.visible = false;
} }
if (Cura.API.account.syncState == 1) else if (Cura.API.account.syncState == _AccountSyncState_SUCCESS)
{ {
refreshListButton.visible = true; refreshListButton.visible = true;
} }