syncthingtray/plasmoid/package/contents/ui/DetailView.qml

30 lines
687 B
QML
Raw Normal View History

import QtQuick 2.7
2020-11-30 19:11:50 +01:00
import QtQuick.Controls 2.15 as QQC2
ListView {
id: detailView
property DetailItem contextMenuItem: null
currentIndex: -1
interactive: false
height: contentHeight
2020-11-30 19:11:50 +01:00
QQC2.Menu {
id: contextMenu
2020-11-30 19:11:50 +01:00
QQC2.MenuItem {
text: qsTr('Copy value')
2020-11-30 19:11:50 +01:00
icon.name: "edit-copy"
onTriggered: {
var item = detailView.contextMenuItem
if (item) {
plasmoid.nativeInterface.copyToClipboard(item.detailValue)
}
}
}
}
function showContextMenu(item, x, y) {
contextMenuItem = item
2020-11-30 19:11:50 +01:00
contextMenu.popup()
}
}