From e1a94cfd8447864fcf14a0195d4a351752f98764 Mon Sep 17 00:00:00 2001 From: Pascal Precht Date: Tue, 15 Jun 2021 16:04:41 +0200 Subject: [PATCH] feat(StatusPopupMenu): introduce `openHandler` Similar to `closeHandler`, StatusPopupMenu can now have a customized `openHandler` to run custom logic on open. --- ui/StatusQ/src/StatusQ/Popups/StatusPopupMenu.qml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ui/StatusQ/src/StatusQ/Popups/StatusPopupMenu.qml b/ui/StatusQ/src/StatusQ/Popups/StatusPopupMenu.qml index 050325691c..25187136dc 100644 --- a/ui/StatusQ/src/StatusQ/Popups/StatusPopupMenu.qml +++ b/ui/StatusQ/src/StatusQ/Popups/StatusPopupMenu.qml @@ -16,8 +16,15 @@ Menu { property int menuItemCount: 0 property var subMenuItemIcons: [] + property var openHandler property var closeHandler + onOpened: { + if (typeof openHandler === "function") { + openHandler() + } + } + onClosed: { if (typeof closeHandler === "function") { closeHandler()