diff --git a/images/minus-white.png b/images/minus-white.png
new file mode 100644
index 0000000000..b42bee8e1c
Binary files /dev/null and b/images/minus-white.png differ
diff --git a/images/minus-white@2x.png b/images/minus-white@2x.png
new file mode 100644
index 0000000000..c865295928
Binary files /dev/null and b/images/minus-white@2x.png differ
diff --git a/images/plus-white.png b/images/plus-white.png
new file mode 100644
index 0000000000..8cc8bcfc7c
Binary files /dev/null and b/images/plus-white.png differ
diff --git a/images/plus-white@2x.png b/images/plus-white@2x.png
new file mode 100644
index 0000000000..54611b87e1
Binary files /dev/null and b/images/plus-white@2x.png differ
diff --git a/pages/Transfer.qml b/pages/Transfer.qml
index bcb23d07aa..6edf00b434 100644
--- a/pages/Transfer.qml
+++ b/pages/Transfer.qml
@@ -71,15 +71,20 @@ Rectangle {
function updateFromQrCode(address, payment_id, amount, tx_description, recipient_name) {
console.log("updateFromQrCode")
addressLine.text = address
- paymentIdLine.text = payment_id
+ setPaymentId(payment_id);
amountLine.text = amount
descriptionLine.text = recipient_name + " " + tx_description
cameraUi.qrcode_decoded.disconnect(updateFromQrCode)
}
+ function setPaymentId(value) {
+ paymentIdLine.text = value;
+ paymentIdCheckbox.checked = paymentIdLine.text != "";
+ }
+
function clearFields() {
addressLine.text = ""
- paymentIdLine.text = ""
+ setPaymentId("");
amountLine.text = ""
descriptionLine.text = ""
priorityDropdown.currentIndex = 0
@@ -223,7 +228,7 @@ Rectangle {
const parsed = walletManager.parse_uri_to_object(clipboardText);
if (!parsed.error) {
addressLine.text = parsed.address;
- paymentIdLine.text = parsed.payment_id;
+ setPaymentId(parsed.payment_id);
amountLine.text = parsed.amount;
descriptionLine.text = parsed.tx_description;
} else {
@@ -290,16 +295,32 @@ Rectangle {
}
}
- RowLayout {
+ ColumnLayout {
+ CheckBox {
+ id: paymentIdCheckbox
+ border: false
+ checkedIcon: "qrc:///images/minus-white.png"
+ uncheckedIcon: "qrc:///images/plus-white.png"
+ fontSize: paymentIdLine.labelFontSize
+ iconOnTheLeft: false
+ Layout.fillWidth: true
+ text: qsTr("Payment ID ( Optional )") + translationManager.emptyString
+ onClicked: {
+ if (!paymentIdCheckbox.checked) {
+ paymentIdLine.text = "";
+ }
+ }
+ }
+
// payment id input
LineEditMulti {
id: paymentIdLine
fontBold: true
- labelText: qsTr("Payment ID ( Optional )") + translationManager.emptyString
placeholderText: qsTr("16 or 64 hexadecimal characters") + translationManager.emptyString
Layout.fillWidth: true
wrapMode: Text.WrapAnywhere
addressValidation: false
+ visible: paymentIdCheckbox.checked
}
}
@@ -355,7 +376,7 @@ Rectangle {
console.log("priority: " + priority)
console.log("amount: " + amountLine.text)
addressLine.text = addressLine.text.trim()
- paymentIdLine.text = paymentIdLine.text.trim()
+ setPaymentId(paymentIdLine.text.trim());
root.paymentClicked(addressLine.text, paymentIdLine.text, amountLine.text, root.mixin, priority, descriptionLine.text)
}
}
@@ -436,7 +457,7 @@ Rectangle {
console.log("priority: " + priority)
console.log("amount: " + amountLine.text)
addressLine.text = addressLine.text.trim()
- paymentIdLine.text = paymentIdLine.text.trim()
+ setPaymentId(paymentIdLine.text.trim());
root.paymentClicked(addressLine.text, paymentIdLine.text, amountLine.text, root.mixin, priority, descriptionLine.text)
}
@@ -667,7 +688,7 @@ Rectangle {
// Popuplate fields from addressbook.
function sendTo(address, paymentId, description){
addressLine.text = address
- paymentIdLine.text = paymentId
+ selectMultiple(paymentId);
descriptionLine.text = description
}
}
diff --git a/qml.qrc b/qml.qrc
index 74f100ca4d..e8cbdf8644 100644
--- a/qml.qrc
+++ b/qml.qrc
@@ -8,7 +8,11 @@
images/helpIcon.png
images/maximizeIcon.png
images/minimizeIcon.png
+ images/minus-white.png
+ images/minus-white@2x.png
images/moneroLogo.png
+ images/plus-white.png
+ images/plus-white@2x.png
components/Label.qml
images/whatIsIcon.png
images/lockIcon.png