diff options
| author | luigi1111 <luigi1111w@gmail.com> | 2018-12-26 16:11:02 -0600 |
|---|---|---|
| committer | luigi1111 <luigi1111w@gmail.com> | 2018-12-26 16:11:02 -0600 |
| commit | b88ac2baa9244aed10aafa2b91ae3442651c4ef9 (patch) | |
| tree | 5cd4296ea5e4b341dec9bd357d84f303c6d538c8 | |
| parent | f5b684811c3dc4073e89c2c2705e695121377a8d (diff) | |
| parent | 55c3d07a143c56fe404aedc652263c94af393d6d (diff) | |
| download | monzero-gui-b88ac2baa9244aed10aafa2b91ae3442651c4ef9.tar.gz monzero-gui-b88ac2baa9244aed10aafa2b91ae3442651c4ef9.tar.xz monzero-gui-b88ac2baa9244aed10aafa2b91ae3442651c4ef9.zip | |
Merge pull request #1855
55c3d07 Transfer: hide PaymentId and Description by default (xiphon)
| -rw-r--r-- | images/minus-white.png | bin | 0 -> 170 bytes | |||
| -rw-r--r-- | images/minus-white@2x.png | bin | 0 -> 170 bytes | |||
| -rw-r--r-- | images/plus-white.png | bin | 0 -> 193 bytes | |||
| -rw-r--r-- | images/plus-white@2x.png | bin | 0 -> 195 bytes | |||
| -rw-r--r-- | pages/Transfer.qml | 70 | ||||
| -rw-r--r-- | qml.qrc | 4 |
6 files changed, 60 insertions, 14 deletions
diff --git a/images/minus-white.png b/images/minus-white.png Binary files differnew file mode 100644 index 00000000..b42bee8e --- /dev/null +++ b/images/minus-white.png diff --git a/images/minus-white@2x.png b/images/minus-white@2x.png Binary files differnew file mode 100644 index 00000000..c8652959 --- /dev/null +++ b/images/minus-white@2x.png diff --git a/images/plus-white.png b/images/plus-white.png Binary files differnew file mode 100644 index 00000000..8cc8bcfc --- /dev/null +++ b/images/plus-white.png diff --git a/images/plus-white@2x.png b/images/plus-white@2x.png Binary files differnew file mode 100644 index 00000000..54611b87 --- /dev/null +++ b/images/plus-white@2x.png diff --git a/pages/Transfer.qml b/pages/Transfer.qml index 0b05c5f5..0a1693ef 100644 --- a/pages/Transfer.qml +++ b/pages/Transfer.qml @@ -63,17 +63,27 @@ 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 + setDescription(recipient_name + " " + tx_description); cameraUi.qrcode_decoded.disconnect(updateFromQrCode) } + function setDescription(value) { + descriptionLine.text = value; + descriptionCheckbox.checked = descriptionLine.text != ""; + } + + function setPaymentId(value) { + paymentIdLine.text = value; + paymentIdCheckbox.checked = paymentIdLine.text != ""; + } + function clearFields() { addressLine.text = "" - paymentIdLine.text = "" + setPaymentId(""); amountLine.text = "" - descriptionLine.text = "" + setDescription(""); priorityDropdown.currentIndex = 0 updatePriorityDropdown() } @@ -215,9 +225,9 @@ 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; + setDescription(parsed.tx_description); } else { addressLine.text = clipboardText; } @@ -282,25 +292,57 @@ 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 <font size='2'>( Optional )</font>") + translationManager.emptyString + onClicked: { + if (!paymentIdCheckbox.checked) { + paymentIdLine.text = ""; + } + } + } + // payment id input LineEditMulti { id: paymentIdLine fontBold: true - labelText: qsTr("Payment ID <font size='2'>( Optional )</font>") + translationManager.emptyString placeholderText: qsTr("16 or 64 hexadecimal characters") + translationManager.emptyString Layout.fillWidth: true wrapMode: Text.WrapAnywhere addressValidation: false + visible: paymentIdCheckbox.checked } } - RowLayout { + ColumnLayout { + CheckBox { + id: descriptionCheckbox + border: false + checkedIcon: "qrc:///images/minus-white.png" + uncheckedIcon: "qrc:///images/plus-white.png" + fontSize: descriptionLine.labelFontSize + iconOnTheLeft: false + Layout.fillWidth: true + text: qsTr("Description <font size='2'>( Optional )</font>") + translationManager.emptyString + onClicked: { + if (!descriptionCheckbox.checked) { + descriptionLine.text = ""; + } + } + } + LineEditMulti { id: descriptionLine - labelText: qsTr("Description <font size='2'>( Optional )</font>") + translationManager.emptyString placeholderText: qsTr("Saved to local wallet history") + translationManager.emptyString Layout.fillWidth: true + visible: descriptionCheckbox.checked } } @@ -347,7 +389,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) } } @@ -428,7 +470,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) } @@ -661,7 +703,7 @@ Rectangle { // Popuplate fields from addressbook. function sendTo(address, paymentId, description){ addressLine.text = address - paymentIdLine.text = paymentId - descriptionLine.text = description + setPaymentId(paymentId); + setDescription(description); } } @@ -8,7 +8,11 @@ <file>images/helpIcon.png</file> <file>images/maximizeIcon.png</file> <file>images/minimizeIcon.png</file> + <file>images/minus-white.png</file> + <file>images/minus-white@2x.png</file> <file>images/moneroLogo.png</file> + <file>images/plus-white.png</file> + <file>images/plus-white@2x.png</file> <file>components/Label.qml</file> <file>images/whatIsIcon.png</file> <file>images/lockIcon.png</file> |
