From a8e830f76caca16718353b84dfe77b5eac363943 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/src/StatusQ/Components/StatusChatToolBar.qml b/src/StatusQ/Components/StatusChatToolBar.qml index dd786d8e..44544d28 100644 --- a/src/StatusQ/Components/StatusChatToolBar.qml +++ b/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 {