Skip to content

Commit

Permalink
addressbook: improve readability by truncating long text and allowing…
Browse files Browse the repository at this point in the history
… wrapmode on address/description/paymentid fields
  • Loading branch information
mmbyday committed Dec 4, 2018
1 parent 9f6b433 commit 56bd606
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
17 changes: 15 additions & 2 deletions components/AddressBookTable.qml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@


import QtQuick 2.0 import QtQuick 2.0
import moneroComponents.Clipboard 1.0 import moneroComponents.Clipboard 1.0
import "../js/TxUtils.js" as TxUtils


ListView { ListView {
id: listView id: listView
Expand Down Expand Up @@ -88,7 +89,13 @@ ListView {
font.family: "Arial" font.family: "Arial"
font.pixelSize: 16 font.pixelSize: 16
color: "#ffffff" color: "#ffffff"
text: address text: {
if(isMobile){
TxUtils.addressTruncate(address, 6);
} else {
return TxUtils.addressTruncate(address, 10);
}
}
readOnly: true readOnly: true
} }


Expand Down Expand Up @@ -117,7 +124,13 @@ ListView {
font.family: "Arial" font.family: "Arial"
font.pixelSize: 13 font.pixelSize: 13
color: "#545454" color: "#545454"
text: paymentId text: {
if(isMobile){
TxUtils.addressTruncate(paymentId, 6);
} else {
return TxUtils.addressTruncate(paymentId, 10);
}
}
} }


ListModel { ListModel {
Expand Down
10 changes: 7 additions & 3 deletions pages/AddressBook.qml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -58,29 +58,33 @@ Rectangle {
} }
} }


LineEdit { LineEditMulti {
Layout.fillWidth: true; Layout.fillWidth: true;
id: addressLine id: addressLine
labelText: qsTr("Address") + translationManager.emptyString labelText: qsTr("Address") + translationManager.emptyString
error: true; error: true;
placeholderText: qsTr("4.. / 8..") + translationManager.emptyString placeholderText: qsTr("4.. / 8..") + translationManager.emptyString
wrapMode: Text.WrapAnywhere
addressValidation: true
} }
} }


LineEdit { LineEditMulti {
id: paymentIdLine id: paymentIdLine
Layout.fillWidth: true; Layout.fillWidth: true;
labelText: qsTr("Payment ID <font size='2'>(Optional)</font>") + translationManager.emptyString labelText: qsTr("Payment ID <font size='2'>(Optional)</font>") + translationManager.emptyString
placeholderText: qsTr("Paste 64 hexadecimal characters") + translationManager.emptyString placeholderText: qsTr("Paste 64 hexadecimal characters") + translationManager.emptyString
wrapMode: Text.WrapAnywhere
// tipText: qsTr("<b>Payment ID</b><br/><br/>A unique user name used in<br/>the address book. It is not a<br/>transfer of information sent<br/>during the transfer") // tipText: qsTr("<b>Payment ID</b><br/><br/>A unique user name used in<br/>the address book. It is not a<br/>transfer of information sent<br/>during the transfer")
// + translationManager.emptyString // + translationManager.emptyString
} }


LineEdit { LineEditMulti {
id: descriptionLine id: descriptionLine
Layout.fillWidth: true; Layout.fillWidth: true;
labelText: qsTr("Description <font size='2'>(Optional)</font>") + translationManager.emptyString labelText: qsTr("Description <font size='2'>(Optional)</font>") + translationManager.emptyString
placeholderText: qsTr("Give this entry a name or description") + translationManager.emptyString placeholderText: qsTr("Give this entry a name or description") + translationManager.emptyString
wrapMode: Text.WrapAnywhere
} }




Expand Down

0 comments on commit 56bd606

Please sign in to comment.