fix(@desktop/onboarding): update handler and naming

- add logic clarification comment

Closes:#6518
This commit is contained in:
PavelS 2022-07-28 12:43:18 +03:00 committed by PavelS
parent 06f6eb176f
commit 9af1d15f8e
1 changed files with 7 additions and 5 deletions

View File

@ -159,20 +159,22 @@ Item {
}
MouseArea {
property bool accountPopupOpened: false
property bool accountPopupWasOpened: false
anchors.fill: parent
anchors.margins: -10
cursorShape: Qt.PointingHandCursor
hoverEnabled: true
onEntered: {
accountPopupOpened = accountsPopup.opened
// cache opened state, because it is always false in onClicked
// because of CloseOnPressOutsideParent policy of accountsPopup
accountPopupWasOpened = accountsPopup.opened
}
onPressed: {
if (!accountPopupOpened) {
onClicked: {
if (!accountPopupWasOpened) {
changeAccountBtn.clicked(mouse)
}
accountPopupOpened = accountsPopup.opened
accountPopupWasOpened = accountsPopup.opened
}
}