From 01b297fe2425593b3fe2f6b3172fc26402b5c9cd Mon Sep 17 00:00:00 2001 From: Alexandra Betouni Date: Tue, 3 Aug 2021 11:41:27 +0300 Subject: [PATCH] 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 --- .../src/StatusQ/Components/StatusChatToolBar.qml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ui/StatusQ/src/StatusQ/Components/StatusChatToolBar.qml b/ui/StatusQ/src/StatusQ/Components/StatusChatToolBar.qml index dd786d8ea6..44544d28a3 100644 --- a/ui/StatusQ/src/StatusQ/Components/StatusChatToolBar.qml +++ b/ui/StatusQ/src/StatusQ/Components/StatusChatToolBar.qml @@ -88,10 +88,17 @@ Rectangle { type: StatusFlatRoundButton.Type.Secondary visible: !!statusChatToolBar.popupMenu + property bool showMoreMenu: false onClicked: { - statusChatToolBar.menuButtonClicked() + if (showMoreMenu) { + popupMenuSlot.item.popup(-popupMenuSlot.item.width + menuButton.width, menuButton.height + 4) + } highlighted = true - popupMenuSlot.item.popup(-popupMenuSlot.item.width + menuButton.width, menuButton.height + 4) + statusChatToolBar.menuButtonClicked() + } + + onPressed: { + showMoreMenu = !showMoreMenu; } StatusToolTip {