Add copy to clipboard action to generic state delegates

This commit is contained in:
Michael Zanetti 2023-11-03 23:04:27 +01:00
parent d12ac8eacd
commit 6e50da1662

View File

@ -133,6 +133,25 @@ ThingPageBase {
swipe.right: RowLayout {
height: delegate.height
anchors.right: parent.right
MouseArea {
Layout.fillHeight: true
Layout.preferredWidth: height
visible: model.type === ThingModel.TypeStateType
ColorIcon {
anchors.fill: parent
anchors.margins: app.margins
name: "../images/edit-copy.svg"
}
onClicked: {
swipe.close();
print("opening logs for", delegate.stateType.id)
PlatformHelper.toClipBoard(root.thing.states.getState(delegate.stateType.id).value)
ToolTip.show(qsTr("ID copied to clipboard"), 500);
}
}
MouseArea {
Layout.fillHeight: true
Layout.preferredWidth: height