transfer: change description/pid checkbox

This commit is contained in:
mmbyday 2019-04-16 22:30:17 -07:00
parent e81cb7e640
commit 9b7adfc0a8

View File

@ -304,64 +304,61 @@ Rectangle {
} }
ColumnLayout { ColumnLayout {
visible: appWindow.persistentSettings.showPid || paymentIdCheckbox.checked spacing: 15
CheckBox { ColumnLayout {
id: paymentIdCheckbox CheckBox {
border: false id: descriptionCheckbox
checkedIcon: "qrc:///images/minus-white.png" border: false
uncheckedIcon: "qrc:///images/plus-white.png" checkedIcon: "qrc:///images/plus-in-circle-medium-white.png"
imgWidth: 12 uncheckedIcon: "qrc:///images/plus-in-circle-medium-white.png"
imgHeight: 12 fontSize: descriptionLine.labelFontSize
fontSize: paymentIdLine.labelFontSize iconOnTheLeft: true
iconOnTheLeft: false Layout.fillWidth: true
Layout.fillWidth: true text: qsTr("Add description") + translationManager.emptyString
text: qsTr("Payment ID <font size='2'>( Optional )</font>") + translationManager.emptyString onClicked: {
onClicked: { if (!descriptionCheckbox.checked) {
if (!paymentIdCheckbox.checked) { descriptionLine.text = "";
paymentIdLine.text = ""; }
} }
} }
LineEditMulti {
id: descriptionLine
placeholderText: qsTr("Saved to local wallet history") + translationManager.emptyString
Layout.fillWidth: true
visible: descriptionCheckbox.checked
}
} }
// payment id input ColumnLayout {
LineEditMulti { visible: appWindow.persistentSettings.showPid || paymentIdCheckbox.checked
id: paymentIdLine // @TODO: remove after pid removal hardfork
fontBold: true CheckBox {
placeholderText: qsTr("64 hexadecimal characters") + translationManager.emptyString id: paymentIdCheckbox
Layout.fillWidth: true border: false
wrapMode: Text.WrapAnywhere checkedIcon: "qrc:///images/plus-in-circle-medium-white.png"
addressValidation: false uncheckedIcon: "qrc:///images/plus-in-circle-medium-white.png"
visible: paymentIdCheckbox.checked fontSize: paymentIdLine.labelFontSize
} iconOnTheLeft: true
} Layout.fillWidth: true
text: qsTr("Add payment ID") + translationManager.emptyString
ColumnLayout { onClicked: {
CheckBox { if (!paymentIdCheckbox.checked) {
id: descriptionCheckbox paymentIdLine.text = "";
border: false }
checkedIcon: "qrc:///images/minus-white.png"
uncheckedIcon: "qrc:///images/plus-white.png"
imgWidth: 12
imgHeight: 12
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 { // payment id input
id: descriptionLine LineEditMulti {
placeholderText: qsTr("Saved to local wallet history") + translationManager.emptyString id: paymentIdLine
Layout.fillWidth: true fontBold: true
visible: descriptionCheckbox.checked placeholderText: qsTr("64 hexadecimal characters") + translationManager.emptyString
onTextChanged: { Layout.fillWidth: true
paymentIdWarningBox.visible = walletManager.paymentIdValid(text) && !persistentSettings.showPid wrapMode: Text.WrapAnywhere
addressValidation: false
visible: paymentIdCheckbox.checked
} }
} }
} }