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

107 lines
3.3 KiB
QML
Raw Normal View History

2020-06-17 19:18:31 +00:00
import QtQuick 2.13
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.14
2020-05-28 15:38:00 +00:00
import "../../../imports"
import "../../../shared"
2020-05-28 14:54:42 +00:00
Item {
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
onStatusChanged: {
if (assetInfoImage.status == Image.Error) {
assetInfoImage.source = "../../img/tokens/DEFAULT-TOKEN@3x.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.secondaryText
2020-05-28 15:38:00 +00:00
font.pixelSize: 15
}
StyledText {
2020-05-28 15:38:00 +00:00
id: assetValue
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
}
StyledText {
2020-05-28 14:54:42 +00:00
id: assetFiatValue
color: Style.current.secondaryText
refactor wallet views add getSettings methods to src/status fix issue with calling getSettings; document issue remove most direct references to libstatus; document some common issues remove most references to libstatus wallet add mailserver layer to status lib; remove references to libstatus mailservers remove libstatus accounts references move types out of libstatus; remove libstatus types references remove libstatus browser references refactor libstatus utils references remove more references to libstatus stickers remove references to libstatus constants from src/app remove more libstatus references from src/app refactor token_list usage of libstatus refactor stickers usage of libstatus refactor chat usage of libstatus remove libstatus references from the wallet view remove logic from ens manager view fix issue with import & namespace conflict remove unnecessary imports refactor provider view to not depend on libstatus refactor provider view refactor: move accounts specific code to its own section fix account selection move collectibles to their own module update references to wallet transactions refactor: move gas methods to their own file refactor: extract tokens into their own file refactor: extract ens to its own file refactor: extract dappbrowser code to its own file refactor: extract history related code to its own file refactor: extract balance to its own file refactor: extract utils to its own file clean up wallet imports fix: identicon for transaction commands Fixes #2533
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"
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
ScrollView {
2020-05-28 14:54:42 +00:00
anchors.fill: parent
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
refactor wallet views add getSettings methods to src/status fix issue with calling getSettings; document issue remove most direct references to libstatus; document some common issues remove most references to libstatus wallet add mailserver layer to status lib; remove references to libstatus mailservers remove libstatus accounts references move types out of libstatus; remove libstatus types references remove libstatus browser references refactor libstatus utils references remove more references to libstatus stickers remove references to libstatus constants from src/app remove more libstatus references from src/app refactor token_list usage of libstatus refactor stickers usage of libstatus refactor chat usage of libstatus remove libstatus references from the wallet view remove logic from ens manager view fix issue with import & namespace conflict remove unnecessary imports refactor provider view to not depend on libstatus refactor provider view refactor: move accounts specific code to its own section fix account selection move collectibles to their own module update references to wallet transactions refactor: move gas methods to their own file refactor: extract tokens into their own file refactor: extract ens to its own file refactor: extract dappbrowser code to its own file refactor: extract history related code to its own file refactor: extract balance to its own file refactor: extract utils to its own file clean up wallet imports fix: identicon for transaction commands Fixes #2533
2021-06-08 12:48:31 +00:00
model: walletModel.tokensView.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}
}
##^##*/