diff options
| author | xiphon <xiphon@protonmail.com> | 2018-12-21 16:32:26 +0000 |
|---|---|---|
| committer | xiphon <xiphon@protonmail.com> | 2018-12-24 11:13:32 +0300 |
| commit | 55c3d07a143c56fe404aedc652263c94af393d6d (patch) | |
| tree | 82920083bfbff19bb915b5b100ee23059d29af15 | |
| parent | bac833c1dd95666e159406f290ad334decee2810 (diff) | |
| download | monzero-gui-55c3d07a143c56fe404aedc652263c94af393d6d.tar.gz monzero-gui-55c3d07a143c56fe404aedc652263c94af393d6d.tar.xz monzero-gui-55c3d07a143c56fe404aedc652263c94af393d6d.zip | |
Transfer: hide PaymentId and Description by default
| -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 bcb23d07..45cf7d4e 100644 --- a/pages/Transfer.qml +++ b/pages/Transfer.qml @@ -71,17 +71,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() } @@ -223,9 +233,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; } @@ -290,25 +300,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 } } @@ -355,7 +397,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 +478,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 +709,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> |
