2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick 2.13
|
2020-11-27 13:49:57 +00:00
|
|
|
import QtQuick.Layouts 1.3
|
|
|
|
import QtQuick.Controls 2.14
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2020-06-19 18:06:58 +00:00
|
|
|
import "../../../shared"
|
2020-05-28 14:54:42 +00:00
|
|
|
|
|
|
|
Item {
|
2020-10-15 18:44:22 +00:00
|
|
|
height: assetListView.height
|
2020-05-28 14:54:42 +00:00
|
|
|
Component {
|
|
|
|
id: assetViewDelegate
|
|
|
|
|
|
|
|
Item {
|
2020-05-28 15:38:00 +00:00
|
|
|
id: element
|
2020-05-28 14:54:42 +00:00
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.left: parent.left
|
2020-05-28 15:38:00 +00:00
|
|
|
height: 40
|
2020-05-28 14:54:42 +00:00
|
|
|
|
|
|
|
Image {
|
|
|
|
id: assetInfoImage
|
|
|
|
width: 36
|
|
|
|
height: 36
|
2021-09-28 15:04:06 +00:00
|
|
|
source: symbol ? Style.png("tokens/" + symbol) : ""
|
2020-05-28 14:54:42 +00:00
|
|
|
anchors.left: parent.left
|
2020-05-28 15:38:00 +00:00
|
|
|
anchors.leftMargin: 0
|
2020-05-28 14:54:42 +00:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2020-06-11 19:52:54 +00:00
|
|
|
onStatusChanged: {
|
|
|
|
if (assetInfoImage.status == Image.Error) {
|
2021-09-28 15:04:06 +00:00
|
|
|
assetInfoImage.source = Style.png("tokens/DEFAULT-TOKEN@3x")
|
2020-06-11 19:52:54 +00:00
|
|
|
}
|
|
|
|
}
|
2020-05-28 14:54:42 +00:00
|
|
|
}
|
2020-06-19 18:06:58 +00:00
|
|
|
StyledText {
|
2020-05-28 14:54:42 +00:00
|
|
|
id: assetSymbol
|
|
|
|
text: symbol
|
2020-05-28 15:38:00 +00:00
|
|
|
anchors.left: assetInfoImage.right
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.leftMargin: Style.current.smallPadding
|
2020-05-28 15:38:00 +00:00
|
|
|
anchors.top: assetInfoImage.top
|
|
|
|
anchors.topMargin: 0
|
|
|
|
font.pixelSize: 15
|
|
|
|
}
|
2020-06-19 18:06:58 +00:00
|
|
|
StyledText {
|
2020-05-28 15:38:00 +00:00
|
|
|
id: assetFullTokenName
|
2020-06-02 20:10:48 +00:00
|
|
|
text: name
|
2020-05-28 15:38:00 +00:00
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.bottomMargin: 0
|
|
|
|
anchors.left: assetInfoImage.right
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.leftMargin: Style.current.smallPadding
|
2021-02-25 14:35:25 +00:00
|
|
|
color: Style.current.secondaryText
|
2020-05-28 15:38:00 +00:00
|
|
|
font.pixelSize: 15
|
|
|
|
}
|
2020-06-19 18:06:58 +00:00
|
|
|
StyledText {
|
2020-05-28 15:38:00 +00:00
|
|
|
id: assetValue
|
2020-11-27 13:49:57 +00:00
|
|
|
text: value.toUpperCase() + " " + symbol
|
2020-05-28 15:38:00 +00:00
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: 0
|
|
|
|
font.pixelSize: 15
|
|
|
|
font.strikeout: false
|
2020-05-28 14:54:42 +00:00
|
|
|
}
|
2020-06-19 18:06:58 +00:00
|
|
|
StyledText {
|
2020-05-28 14:54:42 +00:00
|
|
|
id: assetFiatValue
|
2021-02-25 14:35:25 +00:00
|
|
|
color: Style.current.secondaryText
|
2021-06-08 12:48:31 +00:00
|
|
|
text: Utils.toLocaleString(fiatBalance, globalSettings.locale) + " " + walletModel.balanceView.defaultCurrency.toUpperCase()
|
2020-05-28 14:54:42 +00:00
|
|
|
anchors.right: parent.right
|
2020-05-28 15:38:00 +00:00
|
|
|
anchors.rightMargin: 0
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.bottomMargin: 0
|
|
|
|
font.pixelSize: 15
|
2020-05-28 14:54:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-28 15:38:00 +00:00
|
|
|
ListModel {
|
|
|
|
id: exampleModel
|
|
|
|
|
|
|
|
ListElement {
|
|
|
|
value: "123 USD"
|
|
|
|
symbol: "ETH"
|
|
|
|
fullTokenName: "Ethereum"
|
2020-08-05 12:53:25 +00:00
|
|
|
fiatBalanceDisplay: "3423 ETH"
|
2021-09-28 15:04:06 +00:00
|
|
|
image: "token-icons/eth"
|
2020-05-28 15:38:00 +00:00
|
|
|
}
|
|
|
|
}
|
2020-05-28 14:54:42 +00:00
|
|
|
|
2020-11-27 13:49:57 +00:00
|
|
|
ScrollView {
|
2020-05-28 14:54:42 +00:00
|
|
|
anchors.fill: parent
|
2020-11-27 13:49:57 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
|
|
|
ScrollBar.vertical.policy: assetListView.contentHeight > assetListView.height ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff
|
|
|
|
|
|
|
|
ListView {
|
|
|
|
id: assetListView
|
|
|
|
spacing: Style.current.padding * 2
|
|
|
|
anchors.fill: parent
|
|
|
|
// model: exampleModel
|
2021-06-08 12:48:31 +00:00
|
|
|
model: walletModel.tokensView.assets
|
2020-11-27 13:49:57 +00:00
|
|
|
delegate: assetViewDelegate
|
|
|
|
boundsBehavior: Flickable.StopAtBounds
|
|
|
|
}
|
2020-05-28 14:54:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
/*##^##
|
|
|
|
Designer {
|
|
|
|
D{i:0;autoSize:true;formeditorColor:"#ffffff";height:480;width:640}
|
|
|
|
}
|
|
|
|
##^##*/
|