2017-08-29 23:58:49 +02:00
|
|
|
import QtQuick 2.7
|
2017-10-01 17:49:48 +02:00
|
|
|
import org.kde.plasma.components 2.0 as PlasmaComponents
|
2017-08-29 23:58:49 +02:00
|
|
|
|
|
|
|
ListView {
|
2017-10-01 17:49:48 +02:00
|
|
|
id: detailView
|
|
|
|
property DetailItem contextMenuItem: null
|
2017-08-29 23:58:49 +02:00
|
|
|
currentIndex: -1
|
|
|
|
interactive: false
|
|
|
|
height: contentHeight
|
2017-10-01 17:49:48 +02:00
|
|
|
|
|
|
|
PlasmaComponents.Menu {
|
|
|
|
id: contextMenu
|
|
|
|
PlasmaComponents.MenuItem {
|
|
|
|
text: qsTr('Copy value')
|
|
|
|
icon: "edit-copy"
|
|
|
|
onClicked: {
|
|
|
|
var item = detailView.contextMenuItem
|
|
|
|
if (item) {
|
|
|
|
plasmoid.nativeInterface.copyToClipboard(item.detailValue)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function showContextMenu(item, x, y) {
|
|
|
|
contextMenuItem = item
|
|
|
|
contextMenu.open(x, y)
|
|
|
|
}
|
2017-08-29 23:58:49 +02:00
|
|
|
}
|