fix(StatusAccountSelector): adapt AccountSelector to new model (#482)

This commit is contained in:
Jonathan Rainville 2021-11-05 14:08:31 -04:00 committed by Michał Cieślak
parent 5fa646d2eb
commit 876c6e99f8
1 changed files with 10 additions and 10 deletions

View File

@ -54,8 +54,8 @@ Item {
if (!selectedAccount) { if (!selectedAccount) {
return return
} }
if (selectedAccount.iconColor) { if (selectedAccount.color) {
selectedIconImg.color = Utils.getThemeAccountColor(selectedAccount.iconColor, Theme.palette.accountColors) || Theme.palette.accountColors[0] selectedIconImg.color = Utils.getThemeAccountColor(selectedAccount.color, Theme.palette.accountColors) || Theme.palette.accountColors[0]
} }
if (selectedAccount.name) { if (selectedAccount.name) {
selectedTextField.text = selectedAccount.name selectedTextField.text = selectedAccount.name
@ -63,8 +63,8 @@ Item {
if (selectedAccount.address) { if (selectedAccount.address) {
textSelectedAddress.text = selectedAccount.address + " •" textSelectedAddress.text = selectedAccount.address + " •"
} }
if (selectedAccount.fiatBalance) { if (selectedAccount.currencyBalance) {
textSelectedAddressFiatBalance.text = selectedAccount.fiatBalance + " " + currency.toUpperCase() textSelectedAddressFiatBalance.text = selectedAccount.currencyBalance + " " + currency.toUpperCase()
} }
if (selectedAccount.assets && showBalanceForAssetSymbol) { if (selectedAccount.assets && showBalanceForAssetSymbol) {
assetFound = Utils.findAssetBySymbol(selectedAccount.assets, showBalanceForAssetSymbol) assetFound = Utils.findAssetBySymbol(selectedAccount.assets, showBalanceForAssetSymbol)
@ -90,11 +90,11 @@ Item {
id: txtAssetBalance id: txtAssetBalance
visible: root.assetFound !== undefined visible: root.assetFound !== undefined
anchors.bottom: select.top anchors.bottom: select.top
anchors.bottomMargin: -18 anchors.bottomMargin: -18
anchors.right: txtAssetSymbol.left anchors.right: txtAssetSymbol.left
anchors.left: select.left anchors.left: select.left
anchors.leftMargin: select.width / 2.5 anchors.leftMargin: select.width / 2.5
color: !root.isValid ? Theme.palette.dangerColor1 : Theme.palette.baseColor1 color: !root.isValid ? Theme.palette.dangerColor1 : Theme.palette.baseColor1
elide: Text.ElideRight elide: Text.ElideRight
font.pixelSize: 13 font.pixelSize: 13
@ -194,7 +194,7 @@ Item {
Component.onCompleted: { Component.onCompleted: {
if (!root.selectedAccount && isFirstItem) { if (!root.selectedAccount && isFirstItem) {
root.selectedAccount = { address, name, iconColor, assets, fiatBalance } root.selectedAccount = { address, name, color: model.color, assets, currencyBalance }
} }
} }
@ -208,7 +208,7 @@ Item {
width: 20 width: 20
height: 20 height: 20
icon: "filled-account" icon: "filled-account"
color: Utils.getThemeAccountColor(iconColor, Theme.palette.accountColors) || Theme.palette.accountColors[0] color: Utils.getThemeAccountColor(model.color, Theme.palette.accountColors) || Theme.palette.accountColors[0]
} }
Column { Column {
@ -247,7 +247,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
font.pixelSize: 15 font.pixelSize: 15
height: 22 height: 22
text: fiatBalance text: currencyBalance
color: Theme.palette.directColor1 color: Theme.palette.directColor1
} }
StatusBaseText { StatusBaseText {
@ -267,7 +267,7 @@ Item {
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
anchors.fill: itemContainer anchors.fill: itemContainer
onClicked: { onClicked: {
root.selectedAccount = { address, name, iconColor, assets, fiatBalance } root.selectedAccount = { address, name, color: model.color, assets, currencyBalance }
select.selectMenu.close() select.selectMenu.close()
} }
} }