fix(StatusChatToolBar) Fixing more menu not closing

The menu has a CloseOnReleaseOutside policy and so it
was closing and immediately re-opened when the kebab icon
was clicked since it's outside the menu area and also was
calling the popup function of the menu. Added dummy bool
property to detect whether the menu is already closed and
not open it again

Closes #308
This commit is contained in:
Alexandra Betouni 2021-08-03 11:41:27 +03:00 committed by Michał Cieślak
parent 32eeb91cd2
commit 01b297fe24
1 changed files with 9 additions and 2 deletions

View File

@ -88,11 +88,18 @@ Rectangle {
type: StatusFlatRoundButton.Type.Secondary type: StatusFlatRoundButton.Type.Secondary
visible: !!statusChatToolBar.popupMenu visible: !!statusChatToolBar.popupMenu
property bool showMoreMenu: false
onClicked: { onClicked: {
statusChatToolBar.menuButtonClicked() if (showMoreMenu) {
highlighted = true
popupMenuSlot.item.popup(-popupMenuSlot.item.width + menuButton.width, menuButton.height + 4) popupMenuSlot.item.popup(-popupMenuSlot.item.width + menuButton.width, menuButton.height + 4)
} }
highlighted = true
statusChatToolBar.menuButtonClicked()
}
onPressed: {
showMoreMenu = !showMoreMenu;
}
StatusToolTip { StatusToolTip {
visible: !!text && parent.hovered && !popupMenuSlot.item.opened visible: !!text && parent.hovered && !popupMenuSlot.item.opened