From 6276a789c3a0d2c854bdeb5139ccea3cb9ed1a53 Mon Sep 17 00:00:00 2001 From: Pascal Precht Date: Tue, 8 Jun 2021 13:25:45 +0200 Subject: [PATCH] feat(StatusPopupMenu): introduce `closeHandler` hook This enables us to predefine default close handlers for popup menus. --- 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 349a259edf..3340a79eec 100644 --- a/ui/StatusQ/src/StatusQ/Popups/StatusPopupMenu.qml +++ b/ui/StatusQ/src/StatusQ/Popups/StatusPopupMenu.qml @@ -16,6 +16,13 @@ Menu { property int menuItemCount: 0 property var subMenuItemIcons: [] + property var closeHandler + + onClosed: { + if (typeof closeHandler === "function") { + closeHandler() + } + } delegate: MenuItem { id: statusPopupMenuItem