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
|
2020-05-28 15:38:00 +00:00
|
|
|
import "../../../imports"
|
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
|
2020-07-22 20:46:28 +00:00
|
|
|
source: symbol ? "../../img/tokens/" + symbol + ".png" : ""
|
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-04-12 09:03:35 +00:00
|
|
|
assetInfoImage.source = "../../img/tokens/DEFAULT-TOKEN@3x.png"
|
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
|
2020-09-16 11:11:31 +00:00
|
|
|
text: Utils.toLocaleString(fiatBalance, appSettings.locale) + " " + walletModel.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"
|
2020-05-28 15:38:00 +00:00
|
|
|
image: "../../img/token-icons/eth.svg"
|
|
|
|
}
|
|
|
|
}
|
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
|
|
|
|
model: walletModel.assets
|
|
|
|
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}
|
|
|
|
}
|
|
|
|
##^##*/
|