From b5619dadaf594db98b39abbd1218f9749d613f73 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Thu, 9 Jul 2020 13:36:42 -0400 Subject: [PATCH] fix: close chat menu when re-clicking the button --- ui/app/AppLayouts/Chat/ChatColumn/TopBar.qml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ui/app/AppLayouts/Chat/ChatColumn/TopBar.qml b/ui/app/AppLayouts/Chat/ChatColumn/TopBar.qml index 76cbc29302..5c672b6955 100644 --- a/ui/app/AppLayouts/Chat/ChatColumn/TopBar.qml +++ b/ui/app/AppLayouts/Chat/ChatColumn/TopBar.qml @@ -77,6 +77,8 @@ Rectangle { font.pixelSize: 25 MouseArea { + property bool menuOpened: false + id: mouseArea // The negative margins are for the mouse area to be a bit more wide around the button and have more space for the click anchors.topMargin: -10 @@ -90,9 +92,14 @@ Rectangle { menu = groupContextMenu } - menu.arrowX = menu.width - 40 - menu.popup(moreActionsBtn.x, moreActionsBtn.height + 10) - + if (!menuOpened) { + menu.arrowX = menu.width - 40 + menu.popup(moreActionsBtn.x, moreActionsBtn.height + 10) + menuOpened = true + } else { + menu.dismiss() + menuOpened = false + } } cursorShape: Qt.PointingHandCursor acceptedButtons: Qt.LeftButton | Qt.RightButton