summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--framework/qml/ContextMenuOverlay.qml8
-rw-r--r--framework/qml/SelectableLabel.qml5
2 files changed, 9 insertions, 4 deletions
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
23import QtQuick.Layouts 1.3 23import QtQuick.Layouts 1.3
24 24
25Item { 25Item {
26 id: root
26 default property alias children: menuLayout.children 27 default property alias children: menuLayout.children
27 function close() { 28 function close() {
28 menu.close() 29 menu.close()
29 } 30 }
30 31
32 Component.onCompleted: {
33 for (var i = 0; i < root.children.length; i++) {
34 var child = root.children[i]
35 child.clicked.connect(close)
36 }
37 }
38
31 Rectangle { 39 Rectangle {
32 anchors.fill: parent 40 anchors.fill: parent
33 color: "transparent" 41 color: "transparent"
diff --git a/framework/qml/SelectableLabel.qml b/framework/qml/SelectableLabel.qml
index 159a717f..4bb4eae9 100644
--- a/framework/qml/SelectableLabel.qml
+++ b/framework/qml/SelectableLabel.qml
@@ -30,10 +30,7 @@ Kube.Label {
30 Kube.TextButton { 30 Kube.TextButton {
31 id: button 31 id: button
32 text: qsTr("Copy") 32 text: qsTr("Copy")
33 onClicked: { 33 onClicked: clipboard.text = root.text
34 clipboard.text = root.text
35 menu.close()
36 }
37 Kube.Clipboard { 34 Kube.Clipboard {
38 id: clipboard 35 id: clipboard
39 } 36 }