fix: code review
This commit is contained in:
parent
9d771b53dc
commit
c43f6baaa8
|
@ -18,19 +18,25 @@ ModalPopup {
|
|||
height: editable ? 450 : 380
|
||||
|
||||
onOpened: {
|
||||
addressInput.forceActiveFocus(Qt.MouseFocusReason)
|
||||
}
|
||||
|
||||
function openEditable(){
|
||||
addressInput.text = "";
|
||||
nameInput.text = "";
|
||||
symbolInput.text = "";
|
||||
decimalsInput.text = "";
|
||||
addressInput.forceActiveFocus(Qt.MouseFocusReason)
|
||||
editable = true;
|
||||
open();
|
||||
}
|
||||
|
||||
function setData(address, name, symbol, decimals){
|
||||
function openWithData(address, name, symbol, decimals){
|
||||
addressInput.text = address;
|
||||
nameInput.text = name;
|
||||
symbolInput.text = symbol;
|
||||
decimalsInput.text = decimals;
|
||||
editable = false;
|
||||
open();
|
||||
}
|
||||
|
||||
Input {
|
||||
|
@ -53,12 +59,6 @@ ModalPopup {
|
|||
label: qsTrId("name")
|
||||
}
|
||||
|
||||
|
||||
Item {
|
||||
width: 200
|
||||
anchors.top: nameInput.bottom
|
||||
anchors.topMargin: marginBetweenInputs
|
||||
anchors.left: parent.left
|
||||
Input {
|
||||
id: symbolInput
|
||||
readOnly: !editable
|
||||
|
@ -66,22 +66,25 @@ ModalPopup {
|
|||
placeholderText: qsTrId("abc")
|
||||
//% "Symbol"
|
||||
label: qsTrId("symbol")
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
width: 200
|
||||
anchors.top: nameInput.bottom
|
||||
anchors.topMargin: marginBetweenInputs
|
||||
anchors.right: parent.right
|
||||
anchors.left: parent.left
|
||||
anchors.right: undefined
|
||||
width: parent.width / 2 - 20
|
||||
}
|
||||
|
||||
Input {
|
||||
id: decimalsInput
|
||||
readOnly: !editable
|
||||
placeholderText: "18"
|
||||
//% "Decimals"
|
||||
label: qsTrId("decimals")
|
||||
text: "18"
|
||||
}
|
||||
anchors.top: nameInput.bottom
|
||||
anchors.topMargin: marginBetweenInputs
|
||||
anchors.right: parent.right
|
||||
anchors.left: undefined
|
||||
width: parent.width / 2 - 20
|
||||
}
|
||||
|
||||
footer: Item {
|
||||
|
|
|
@ -20,10 +20,7 @@ ModalPopup {
|
|||
//% "Add custom token"
|
||||
label: qsTrId("add-custom-token")
|
||||
anchors.top: parent.top
|
||||
onClicked: {
|
||||
addCustomTokenModal.editable = true;
|
||||
addCustomTokenModal.open()
|
||||
}
|
||||
onClicked: addCustomTokenModal.openEditable()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -78,10 +78,7 @@ Item {
|
|||
icon.source: "../../../img/make-admin.svg"
|
||||
//% "Token details"
|
||||
text: qsTrId("token-details")
|
||||
onTriggered: {
|
||||
addCustomTokenModal.open()
|
||||
addCustomTokenModal.setData(address, name, symbol, decimals)
|
||||
}
|
||||
onTriggered: addCustomTokenModal.openWithData(address, name, symbol, decimals)
|
||||
}
|
||||
Action {
|
||||
icon.source: "../../../img/remove-from-group.svg"
|
||||
|
|
Loading…
Reference in New Issue