feat: use Input component for the send modal

This commit is contained in:
Jonathan Rainville 2020-05-29 13:53:39 -04:00 committed by Iuri Matias
parent 582d838ae7
commit 65332804b9
3 changed files with 18 additions and 11 deletions

View File

@ -6,8 +6,8 @@ import "../../../../imports"
import "../../../../shared"
Item {
property alias txtValue: txtValue
property alias valueInput: txtValue
property string defaultAccount: "0x1234"
Text {
id: modalDialogTitle
@ -53,8 +53,10 @@ Item {
anchors.left: parent.left
anchors.leftMargin: 32
TextField {
Input {
id: txtValue
label: "Amount"
icon: "../../../img/token-icons/eth.svg"
anchors.top: parent.top
anchors.topMargin: 0
anchors.right: parent.right
@ -64,9 +66,10 @@ Item {
placeholderText: qsTr("Enter ETH")
}
TextField {
Input {
id: txtFrom
text: assetsModel.getDefaultAccount()
label: "From account"
text: defaultAccount
placeholderText: qsTr("Send from (account)")
anchors.top: txtValue.bottom
anchors.topMargin: Theme.padding
@ -76,9 +79,10 @@ Item {
anchors.leftMargin: 0
}
TextField {
Input {
id: txtTo
text: assetsModel.getDefaultAccount()
label: "Recipient"
text: defaultAccount
placeholderText: qsTr("Send to")
anchors.top: txtFrom.bottom
anchors.topMargin: Theme.padding
@ -88,9 +92,9 @@ Item {
anchors.leftMargin: 0
}
TextField {
Input {
id: txtPassword
text: "qwerty"
label: "Password"
placeholderText: "Enter Password"
anchors.top: txtTo.bottom
anchors.topMargin: Theme.padding

View File

@ -9,8 +9,9 @@ import "./Components"
Item {
function open() {
popup.open()
sendModalContent.txtValue.text = ""
sendModalContent.txtValue.forceActiveFocus(Qt.MouseFocusReason)
sendModalContent.valueInput.text = ""
sendModalContent.valueInput.forceActiveFocus(Qt.MouseFocusReason)
sendModalContent.defaultAccount = assetsModel.getDefaultAccount()
}
function close() {

View File

@ -60,6 +60,8 @@ Item {
Image {
id: iconImg
sourceSize.height: 24
sourceSize.width: 24
anchors.left: parent.left
anchors.leftMargin: 10
anchors.verticalCenter: parent.verticalCenter