fix(StatusChatToolBar): Fix mouse event catching after menu closing

Closes: #350
This commit is contained in:
B.Melnik 2021-08-30 14:59:08 +03:00 committed by Pascal Precht
parent 9b3275f327
commit fbecac4ac3
1 changed files with 16 additions and 6 deletions

View File

@ -93,15 +93,19 @@ Rectangle {
property bool showMoreMenu: false
onClicked: {
if (showMoreMenu) {
if (!showMoreMenu) {
popupMenuSlot.item.popup(-popupMenuSlot.item.width + menuButton.width, menuButton.height + 4)
statusChatToolBar.menuButtonClicked()
}
highlighted = true
statusChatToolBar.menuButtonClicked()
}
onPressed: {
showMoreMenu = !showMoreMenu;
Timer {
id: menuClosedUpdater
interval: 100
repeat: false
onTriggered: {
menuButton.showMoreMenu = false
}
}
Loader {
@ -110,9 +114,15 @@ Rectangle {
onLoaded: {
popupMenuSlot.item.closeHandler = function () {
menuButton.highlighted = false
menuClosedUpdater.start()
}
popupMenuSlot.item.openHandler = function () {
menuButton.highlighted = true
menuButton.showMoreMenu = true
}
}
}
}
}
Rectangle {