transfer: paste Payment URL to fill the payment form fields

This commit is contained in:
xiphon
2018-11-30 03:51:03 +00:00
parent 45781ab4a1
commit 02134c4fc6
6 changed files with 75 additions and 18 deletions

View File

@@ -74,6 +74,10 @@ ColumnLayout {
property bool mouseSelection: true
property alias readOnly: input.readOnly
property bool copyButton: false
property bool pasteButton: false
property var onPaste: function(clipboardText) {
item.text = clipboardText;
}
property bool showingHeader: true
property var wrapMode: Text.NoWrap
property alias addressValidation: input.addressValidation
@@ -109,25 +113,35 @@ ColumnLayout {
}
}
MoneroComponents.LabelButton {
id: labelButton
onClicked: labelButtonClicked()
visible: labelButtonVisible
}
RowLayout {
anchors.right: parent.right
spacing: 16 * scaleRatio
MoneroComponents.LabelButton {
id: copyButtonId
visible: copyButton && input.text !== ""
text: qsTr("Copy")
anchors.right: labelButton.visible ? inputLabel.right : parent.right
anchors.rightMargin: labelButton.visible? 4 : 0
onClicked: {
if (input.text.length > 0) {
console.log("Copied to clipboard");
clipboard.setText(input.text);
appWindow.showStatusMessage(qsTr("Copied to clipboard"), 3);
MoneroComponents.LabelButton {
id: labelButton
onClicked: labelButtonClicked()
visible: labelButtonVisible
}
MoneroComponents.LabelButton {
id: copyButtonId
visible: copyButton && input.text !== ""
text: qsTr("Copy")
onClicked: {
if (input.text.length > 0) {
console.log("Copied to clipboard");
clipboard.setText(input.text);
appWindow.showStatusMessage(qsTr("Copied to clipboard"), 3);
}
}
}
MoneroComponents.LabelButton {
id: pasteButtonId
onClicked: item.onPaste(clipboard.text())
text: qsTr("Paste")
visible: pasteButton
}
}
}