Fix sync button not appearing when opening popup after clicking away

This was achieved by adding an IDLE state, which is the default state
when opening the account management popup. The state is now reseted
when the popup opens instead of when it closes. In addition, now either
the "You are in sync with your account" label or the "Check account for
updates" button will appear in the popup based on the state, not both.

Finally, with theses changes, if the popup is open and an autosync
occurs, the user will be informed that the account is synced and he/she
will have to close and reopen the popup in order to trigger a manual
update.

CURA-7290
This commit is contained in:
Kostas Karmas 2020-05-26 09:49:58 +02:00
parent 7388829fc1
commit fad02193ab
3 changed files with 14 additions and 5 deletions

View file

@ -112,8 +112,8 @@ Item
if (popup.opened)
{
popup.close()
Cura.API.account.popupClosed()
} else {
Cura.API.account.popupOpened()
popup.open()
}
}
@ -127,6 +127,7 @@ Item
x: parent.width - width
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
onOpened: Cura.API.account.popupOpened()
opacity: opened ? 1 : 0
Behavior on opacity { NumberAnimation { duration: 100 } }