From f70fb14b36c2d6af498f31c36b5fd5d8beb827f4 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 3 Aug 2017 21:03:52 -0600 Subject: auto-close the menu when something has been selected --- framework/qml/ContextMenuOverlay.qml | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'framework/qml/ContextMenuOverlay.qml') diff --git a/framework/qml/ContextMenuOverlay.qml b/framework/qml/ContextMenuOverlay.qml index 24ad9701..472b6f4d 100644 --- a/framework/qml/ContextMenuOverlay.qml +++ b/framework/qml/ContextMenuOverlay.qml @@ -23,11 +23,19 @@ import org.kube.framework 1.0 as Kube import QtQuick.Layouts 1.3 Item { + id: root default property alias children: menuLayout.children function close() { menu.close() } + Component.onCompleted: { + for (var i = 0; i < root.children.length; i++) { + var child = root.children[i] + child.clicked.connect(close) + } + } + Rectangle { anchors.fill: parent color: "transparent" -- cgit v1.2.3