[GUI] Add memo field to transfer form

This commit is contained in:
Nathan Hourt 2015-07-15 17:55:12 -04:00
parent b433f90a55
commit 05efa54598

View file

@ -22,28 +22,33 @@ Rectangle {
ColumnLayout { ColumnLayout {
anchors.centerIn: parent anchors.centerIn: parent
width: parent.width - Scaling.cm(2) width: parent.width - Scaling.cm(2)
spacing: Scaling.cm(1) spacing: Scaling.mm(5)
AccountPicker { AccountPicker {
id: senderPicker id: senderPicker
width: parent.width Layout.fillWidth: true
Layout.minimumWidth: Scaling.cm(5) Layout.minimumWidth: Scaling.cm(5)
Component.onCompleted: setFocus() Component.onCompleted: setFocus()
placeholderText: qsTr("Sender") placeholderText: qsTr("Sender")
showBalance: balances? balances.reduce(function(foundIndex, balance, index) { showBalance: balances? balances.reduce(function(foundIndex, balance, index) {
if (foundIndex >= 0) return foundIndex if (foundIndex >= 0) return foundIndex
return balance.type.symbol === assetBox.currentText? index : -1 return balance.type.symbol === assetField.currentText? index : -1
}, -1) : -1 }, -1) : -1
} }
AccountPicker { AccountPicker {
id: recipientPicker id: recipientPicker
width: parent.width Layout.fillWidth: true
Layout.minimumWidth: Scaling.cm(5) Layout.minimumWidth: Scaling.cm(5)
placeholderText: qsTr("Recipient") placeholderText: qsTr("Recipient")
layoutDirection: Qt.RightToLeft layoutDirection: Qt.RightToLeft
} }
TextField {
id: memoField
Layout.fillWidth: true
placeholderText: qsTr("Memo")
}
RowLayout { RowLayout {
width: parent.width Layout.fillWidth: true
SpinBox { SpinBox {
id: amountField id: amountField
Layout.preferredWidth: Scaling.cm(4) Layout.preferredWidth: Scaling.cm(4)
@ -57,7 +62,7 @@ Rectangle {
senderPicker.balances[senderPicker.showBalance] : null senderPicker.balances[senderPicker.showBalance] : null
} }
ComboBox { ComboBox {
id: assetBox id: assetField
Layout.minimumWidth: Scaling.cm(3) Layout.minimumWidth: Scaling.cm(3)
enabled: Boolean(senderPicker.balances) enabled: Boolean(senderPicker.balances)
model: enabled? senderPicker.balances.filter(function(balance) { return balance.amount > 0 }) model: enabled? senderPicker.balances.filter(function(balance) { return balance.amount > 0 })