From d8d5048622adf7e3a3bf190f2aeaefabf8ce69d8 Mon Sep 17 00:00:00 2001 From: "B.Melnik" Date: Wed, 8 Sep 2021 05:20:06 +0300 Subject: [PATCH] refactor(StatusPopupMenu): Refactor bug with reopen menu --- .../StatusQ/Components/StatusChatToolBar.qml | 21 ++++--------------- .../src/StatusQ/Popups/StatusPopupMenu.qml | 4 ++++ 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/ui/StatusQ/src/StatusQ/Components/StatusChatToolBar.qml b/ui/StatusQ/src/StatusQ/Components/StatusChatToolBar.qml index 02ed625f94..cbc3c6f817 100644 --- a/ui/StatusQ/src/StatusQ/Components/StatusChatToolBar.qml +++ b/ui/StatusQ/src/StatusQ/Components/StatusChatToolBar.qml @@ -93,19 +93,8 @@ Rectangle { property bool showMoreMenu: false onClicked: { - if (!showMoreMenu) { - popupMenuSlot.item.popup(-popupMenuSlot.item.width + menuButton.width, menuButton.height + 4) - statusChatToolBar.menuButtonClicked() - } - } - - Timer { - id: menuClosedUpdater - interval: 100 - repeat: false - onTriggered: { - menuButton.showMoreMenu = false - } + popupMenuSlot.item.popup(-popupMenuSlot.item.width + menuButton.width, menuButton.height + 4) + statusChatToolBar.menuButtonClicked() } Loader { @@ -114,15 +103,13 @@ Rectangle { onLoaded: { popupMenuSlot.item.closeHandler = function () { menuButton.highlighted = false - menuClosedUpdater.start() } popupMenuSlot.item.openHandler = function () { menuButton.highlighted = true - menuButton.showMoreMenu = true } } - } + } } Rectangle { @@ -131,7 +118,7 @@ Rectangle { color: Theme.palette.directColor7 anchors.verticalCenter: parent.verticalCenter visible: notificationButton.visible && - (menuButton.visible || membersButton.visible || searchButton.visible) + (menuButton.visible || membersButton.visible || searchButton.visible) } StatusFlatRoundButton { diff --git a/ui/StatusQ/src/StatusQ/Popups/StatusPopupMenu.qml b/ui/StatusQ/src/StatusQ/Popups/StatusPopupMenu.qml index d3368b84a1..64678af076 100644 --- a/ui/StatusQ/src/StatusQ/Popups/StatusPopupMenu.qml +++ b/ui/StatusQ/src/StatusQ/Popups/StatusPopupMenu.qml @@ -20,6 +20,10 @@ Menu { property var openHandler property var closeHandler + dim: true + Overlay.modeless: MouseArea {} + + signal menuItemClicked(int menuIndex) onOpened: {