diff options
| author | luigi1111 <luigi1111w@gmail.com> | 2018-12-01 14:03:51 -0600 |
|---|---|---|
| committer | luigi1111 <luigi1111w@gmail.com> | 2018-12-01 14:03:51 -0600 |
| commit | 72808de1ad3b8b8e9fd5a397e2b615e49af4b202 (patch) | |
| tree | 7963b2ab51c76de68674fdc6ad48b60959f6ef07 /components | |
| parent | 6182d85f7ea2d36c8b6b29cf88465b8387671a91 (diff) | |
| parent | 02134c4fc664334be07036d7511c89382376e480 (diff) | |
| download | monzero-gui-72808de1ad3b8b8e9fd5a397e2b615e49af4b202.tar.gz monzero-gui-72808de1ad3b8b8e9fd5a397e2b615e49af4b202.tar.xz monzero-gui-72808de1ad3b8b8e9fd5a397e2b615e49af4b202.zip | |
Merge pull request #1768
02134c4 transfer: paste Payment URL to fill the payment form fields (xiphon)
Diffstat (limited to 'components')
| -rw-r--r-- | components/LineEditMulti.qml | 46 |
1 files changed, 30 insertions, 16 deletions
diff --git a/components/LineEditMulti.qml b/components/LineEditMulti.qml index 87cee6d4..63b2dee2 100644 --- a/components/LineEditMulti.qml +++ b/components/LineEditMulti.qml @@ -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: labelButton + onClicked: labelButtonClicked() + visible: labelButtonVisible + } - 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: 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 + } } } |
