feat: add wallet asset icon

This commit is contained in:
Jonathan Rainville 2020-05-14 16:11:27 -04:00 committed by Iuri Matias
parent a962069b73
commit 491718a0bd
3 changed files with 7 additions and 6 deletions

View File

@ -32,13 +32,13 @@ QtObject:
result.assets = @[]
result.setup
proc addAssetToList*(self: AssetsModel, name: string, symbol: string, value: string, fiatValue: string) {.slot.} =
proc addAssetToList*(self: AssetsModel, name: string, symbol: string, value: string, fiatValue: string, image: string) {.slot.} =
self.beginInsertRows(newQModelIndex(), self.assets.len, self.assets.len)
self.assets.add(Asset(name : name,
symbol : symbol,
value : value,
fiatValue: fiatValue,
image: ""))
image: image))
self.endInsertRows()
method rowCount(self: AssetsModel, index: QModelIndex = nil): int =

View File

@ -92,7 +92,8 @@ proc mainProc() =
engine.setRootContextProperty("chatsModel", chatsVariant)
engine.setRootContextProperty("assetsModel", assetsVariant)
assetsModel.addAssetToList("Ethereum", "ETH", fmt"{eth_value:.6}", "$" & fmt"{usd_balance:.6}")
let symbol = "ETH"
assetsModel.addAssetToList("Ethereum", symbol, fmt"{eth_value:.6}", "$" & fmt"{usd_balance:.6}", fmt"../../img/token-icons/{toLowerAscii(symbol)}.svg")
engine.load("../ui/main.qml")

View File

@ -224,11 +224,11 @@ ColumnLayout {
anchors.left: parent.left
anchors.leftMargin: 0
Rectangle {
Image {
id: assetInfoContainer
width: 36
height: 36
color: Theme.blue
radius: 50
source: image
anchors.left: parent.left
anchors.leftMargin: Theme.padding
anchors.verticalCenter: parent.verticalCenter