2021-10-05 20:50:22 +00:00
|
|
|
import QtQuick 2.13
|
2022-07-22 14:42:21 +00:00
|
|
|
import QtQml 2.14
|
2021-10-05 20:50:22 +00:00
|
|
|
|
2023-01-12 22:39:46 +00:00
|
|
|
import StatusQ.Core 0.1
|
|
|
|
|
2021-10-05 20:50:22 +00:00
|
|
|
import utils 1.0
|
|
|
|
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared 1.0
|
|
|
|
import shared.panels 1.0
|
2021-10-05 20:50:22 +00:00
|
|
|
|
|
|
|
Item {
|
|
|
|
id: assetDelegate
|
2022-08-08 10:07:29 +00:00
|
|
|
objectName: symbol
|
2021-10-05 20:50:22 +00:00
|
|
|
|
2022-12-29 16:44:51 +00:00
|
|
|
property var locale
|
2021-10-21 08:22:05 +00:00
|
|
|
property string currency: ""
|
2022-07-22 14:42:21 +00:00
|
|
|
property string currencySymbol: ""
|
2021-10-05 20:50:22 +00:00
|
|
|
|
|
|
|
anchors.right: parent.right
|
2022-05-31 08:32:09 +00:00
|
|
|
|
2021-10-05 20:50:22 +00:00
|
|
|
anchors.left: parent.left
|
2022-12-06 09:49:57 +00:00
|
|
|
visible: visibleForNetworkWithPositiveBalance
|
2022-05-31 08:32:09 +00:00
|
|
|
height: visible ? 40 + 2 * Style.current.padding : 0
|
2022-08-08 10:07:29 +00:00
|
|
|
|
2021-10-05 20:50:22 +00:00
|
|
|
Image {
|
|
|
|
id: assetInfoImage
|
|
|
|
width: 36
|
|
|
|
height: 36
|
|
|
|
source: symbol ? Style.png("tokens/" + symbol) : ""
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: 0
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
onStatusChanged: {
|
|
|
|
if (assetInfoImage.status == Image.Error) {
|
|
|
|
assetInfoImage.source = Style.png("tokens/DEFAULT-TOKEN@3x")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-07-22 14:42:21 +00:00
|
|
|
|
2021-10-05 20:50:22 +00:00
|
|
|
StyledText {
|
|
|
|
id: assetSymbol
|
|
|
|
anchors.left: assetInfoImage.right
|
|
|
|
anchors.leftMargin: Style.current.smallPadding
|
|
|
|
anchors.top: assetInfoImage.top
|
|
|
|
anchors.topMargin: 0
|
|
|
|
font.pixelSize: 15
|
2022-07-22 14:42:21 +00:00
|
|
|
text: name
|
2021-10-05 20:50:22 +00:00
|
|
|
}
|
2022-07-22 14:42:21 +00:00
|
|
|
|
2021-10-05 20:50:22 +00:00
|
|
|
StyledText {
|
|
|
|
id: assetFullTokenName
|
2022-05-31 08:32:09 +00:00
|
|
|
anchors.top: assetSymbol.bottom
|
2021-10-05 20:50:22 +00:00
|
|
|
anchors.left: assetInfoImage.right
|
|
|
|
anchors.leftMargin: Style.current.smallPadding
|
|
|
|
font.pixelSize: 15
|
2022-07-22 14:42:21 +00:00
|
|
|
color: Style.current.secondaryText
|
2022-12-29 16:44:51 +00:00
|
|
|
text: LocaleUtils.currencyAmountToLocaleString(enabledNetworkBalance, root.locale)
|
2021-10-05 20:50:22 +00:00
|
|
|
}
|
2022-07-22 14:42:21 +00:00
|
|
|
|
2021-10-05 20:50:22 +00:00
|
|
|
StyledText {
|
2021-10-21 08:22:05 +00:00
|
|
|
id: assetBalance
|
2022-05-31 08:32:09 +00:00
|
|
|
anchors.top: assetInfoImage.top
|
|
|
|
anchors.topMargin: 0
|
2021-10-05 20:50:22 +00:00
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: 0
|
|
|
|
font.pixelSize: 15
|
|
|
|
font.strikeout: false
|
2022-12-29 16:44:51 +00:00
|
|
|
text: LocaleUtils.currencyAmountToLocaleString(enabledNetworkCurrencyBalance, root.locale)
|
2021-10-05 20:50:22 +00:00
|
|
|
}
|
|
|
|
}
|