status-desktop/ui/app/AppLayouts/Wallet/AssetsTab.qml

97 lines
2.8 KiB
QML
Raw Normal View History

2020-06-17 19:18:31 +00:00
import QtQuick 2.13
2020-05-28 15:38:00 +00:00
import "../../../imports"
import "../../../shared"
2020-05-28 14:54:42 +00:00
Item {
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.rightMargin: 0
anchors.left: parent.left
anchors.leftMargin: 0
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-06-11 20:12:01 +00:00
source: "../../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
onStatusChanged: {
if (assetInfoImage.status == Image.Error) {
assetInfoImage.source = "../../img/tokens/0-native.png"
}
}
2020-05-28 14:54:42 +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
anchors.leftMargin: Style.current.smallPadding
2020-05-28 15:38:00 +00:00
anchors.top: assetInfoImage.top
anchors.topMargin: 0
font.pixelSize: 15
}
StyledText {
2020-05-28 15:38:00 +00:00
id: assetFullTokenName
text: name
2020-05-28 15:38:00 +00:00
anchors.bottom: parent.bottom
anchors.bottomMargin: 0
anchors.left: assetInfoImage.right
anchors.leftMargin: Style.current.smallPadding
color: Style.current.darkGrey
2020-05-28 15:38:00 +00:00
font.pixelSize: 15
}
StyledText {
2020-05-28 15:38:00 +00:00
id: assetValue
2020-07-15 19:38:03 +00:00
text: value.toUpperCase()
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
}
StyledText {
2020-05-28 14:54:42 +00:00
id: assetFiatValue
color: Style.current.darkGrey
2020-07-15 19:38:03 +00:00
text: fiatValue.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"
fiatValue: "3423 ETH"
image: "../../img/token-icons/eth.svg"
}
}
2020-05-28 14:54:42 +00:00
ListView {
id: assetListView
2020-05-28 15:38:00 +00:00
anchors.topMargin: 20
2020-05-28 14:54:42 +00:00
anchors.fill: parent
2020-05-28 15:38:00 +00:00
// model: exampleModel
model: walletModel.assets
2020-05-28 14:54:42 +00:00
delegate: assetViewDelegate
}
}
/*##^##
Designer {
D{i:0;autoSize:true;formeditorColor:"#ffffff";height:480;width:640}
}
##^##*/