Merge PR #1075: Add copy to clipboard action to generic state delegates

pull/1079/head
jenkins 2023-11-03 23:06:34 +01:00
commit da864e7166
1 changed files with 19 additions and 0 deletions

View File

@ -133,6 +133,25 @@ ThingPageBase {
swipe.right: RowLayout { swipe.right: RowLayout {
height: delegate.height height: delegate.height
anchors.right: parent.right 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 { MouseArea {
Layout.fillHeight: true Layout.fillHeight: true
Layout.preferredWidth: height Layout.preferredWidth: height