summaryrefslogtreecommitdiffstats
path: root/framework/qml/SelectableLabel.qml
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-07-31 17:30:41 -0600
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-07-31 17:32:54 -0600
commit804466dba970174ed00289b1cde3d8862b111042 (patch)
treeca93f039c5235ff7660e01ddf3954d3351c2ee1b /framework/qml/SelectableLabel.qml
parent36b2ee162ffd57c70d21c27ff25801f894886569 (diff)
downloadkube-804466dba970174ed00289b1cde3d8862b111042.tar.gz
kube-804466dba970174ed00289b1cde3d8862b111042.zip
SelectableLabel with same mechanism as SelectableItem.
Note that we can not easily integrate it with Label due to recursive use of Kube.Label via the Button component. (Would be doable via dynamic loading, but that stuff is a PITA to do).
Diffstat (limited to 'framework/qml/SelectableLabel.qml')
-rw-r--r--framework/qml/SelectableLabel.qml28
1 files changed, 12 insertions, 16 deletions
diff --git a/framework/qml/SelectableLabel.qml b/framework/qml/SelectableLabel.qml
index 920f5c7a..308bf3d6 100644
--- a/framework/qml/SelectableLabel.qml
+++ b/framework/qml/SelectableLabel.qml
@@ -23,23 +23,19 @@ import org.kube.framework 1.0 as Kube
23 23
24Kube.Label { 24Kube.Label {
25 id: root 25 id: root
26 MouseArea { 26 Kube.ContextMenuOverlay {
27 id: mouseArea 27 id: menu
28 anchors.fill: parent 28 anchors.fill: parent
29 hoverEnabled: true 29 Kube.TextButton {
30 z: 1 30 id: button
31 } 31 text: qsTr("Copy")
32 Kube.IconButton { 32 onClicked: {
33 anchors { 33 clipboard.text = root.text
34 left: parent.right 34 menu.close()
35 verticalCenter: parent.verticalCenter 35 }
36 } 36 Kube.Clipboard {
37 iconName: Kube.Icons.copy 37 id: clipboard
38 visible: mouseArea.containsMouse || hovered 38 }
39 color: Kube.Colors.backgroundColor
40 onClicked: clipboard.text = root.text
41 Kube.Clipboard {
42 id: clipboard
43 } 39 }
44 } 40 }
45} 41}