aboutsummaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
Diffstat (limited to 'components')
-rw-r--r--components/LineEditMulti.qml46
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
+ }
}
}