mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-16 16:47:24 +00:00
fix: code review
This commit is contained in:
parent
9d771b53dc
commit
c43f6baaa8
@ -18,19 +18,25 @@ ModalPopup {
|
|||||||
height: editable ? 450 : 380
|
height: editable ? 450 : 380
|
||||||
|
|
||||||
onOpened: {
|
onOpened: {
|
||||||
|
addressInput.forceActiveFocus(Qt.MouseFocusReason)
|
||||||
|
}
|
||||||
|
|
||||||
|
function openEditable(){
|
||||||
addressInput.text = "";
|
addressInput.text = "";
|
||||||
nameInput.text = "";
|
nameInput.text = "";
|
||||||
symbolInput.text = "";
|
symbolInput.text = "";
|
||||||
decimalsInput.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;
|
addressInput.text = address;
|
||||||
nameInput.text = name;
|
nameInput.text = name;
|
||||||
symbolInput.text = symbol;
|
symbolInput.text = symbol;
|
||||||
decimalsInput.text = decimals;
|
decimalsInput.text = decimals;
|
||||||
editable = false;
|
editable = false;
|
||||||
|
open();
|
||||||
}
|
}
|
||||||
|
|
||||||
Input {
|
Input {
|
||||||
@ -53,37 +59,34 @@ ModalPopup {
|
|||||||
label: qsTrId("name")
|
label: qsTrId("name")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Input {
|
||||||
Item {
|
id: symbolInput
|
||||||
width: 200
|
readOnly: !editable
|
||||||
|
//% "ABC"
|
||||||
|
placeholderText: qsTrId("abc")
|
||||||
|
//% "Symbol"
|
||||||
|
label: qsTrId("symbol")
|
||||||
anchors.top: nameInput.bottom
|
anchors.top: nameInput.bottom
|
||||||
anchors.topMargin: marginBetweenInputs
|
anchors.topMargin: marginBetweenInputs
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
Input {
|
anchors.right: undefined
|
||||||
id: symbolInput
|
width: parent.width / 2 - 20
|
||||||
readOnly: !editable
|
|
||||||
//% "ABC"
|
|
||||||
placeholderText: qsTrId("abc")
|
|
||||||
//% "Symbol"
|
|
||||||
label: qsTrId("symbol")
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Input {
|
||||||
width: 200
|
id: decimalsInput
|
||||||
|
readOnly: !editable
|
||||||
|
placeholderText: "18"
|
||||||
|
//% "Decimals"
|
||||||
|
label: qsTrId("decimals")
|
||||||
|
text: "18"
|
||||||
anchors.top: nameInput.bottom
|
anchors.top: nameInput.bottom
|
||||||
anchors.topMargin: marginBetweenInputs
|
anchors.topMargin: marginBetweenInputs
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
Input {
|
anchors.left: undefined
|
||||||
id: decimalsInput
|
width: parent.width / 2 - 20
|
||||||
readOnly: !editable
|
|
||||||
//% "Decimals"
|
|
||||||
label: qsTrId("decimals")
|
|
||||||
text: "18"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
footer: Item {
|
footer: Item {
|
||||||
visible: editable
|
visible: editable
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
@ -20,10 +20,7 @@ ModalPopup {
|
|||||||
//% "Add custom token"
|
//% "Add custom token"
|
||||||
label: qsTrId("add-custom-token")
|
label: qsTrId("add-custom-token")
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
onClicked: {
|
onClicked: addCustomTokenModal.openEditable()
|
||||||
addCustomTokenModal.editable = true;
|
|
||||||
addCustomTokenModal.open()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,10 +78,7 @@ Item {
|
|||||||
icon.source: "../../../img/make-admin.svg"
|
icon.source: "../../../img/make-admin.svg"
|
||||||
//% "Token details"
|
//% "Token details"
|
||||||
text: qsTrId("token-details")
|
text: qsTrId("token-details")
|
||||||
onTriggered: {
|
onTriggered: addCustomTokenModal.openWithData(address, name, symbol, decimals)
|
||||||
addCustomTokenModal.open()
|
|
||||||
addCustomTokenModal.setData(address, name, symbol, decimals)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Action {
|
Action {
|
||||||
icon.source: "../../../img/remove-from-group.svg"
|
icon.source: "../../../img/remove-from-group.svg"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user