fix(ui): new chat menu popup hide on second click

Partially fixes #3558.
This commit is contained in:
Eric Mastro 2021-09-27 20:30:51 +10:00 committed by Iuri Matias
parent b94b932572
commit 1ee3bba598
1 changed files with 6 additions and 1 deletions

View File

@ -91,7 +91,11 @@ Item {
icon.name: "add"
state: "default"
onClicked: chatContextMenu.popup(actionButton.width-chatContextMenu.width, actionButton.height + 4)
onClicked: {
chatContextMenu.opened ?
chatContextMenu.close() :
chatContextMenu.popup(actionButton.width-chatContextMenu.width, actionButton.height + 4)
}
states: [
State {
name: "default"
@ -135,6 +139,7 @@ Item {
StatusPopupMenu {
id: chatContextMenu
closePolicy: Popup.Popup.CloseOnReleaseOutsideParent | Popup.CloseOnEscape
onOpened: {
actionButton.state = "pressed"