Files
pay/guis/mobile/ct/FungibleBalances.qml
tomFlowee e30f86fd8a Also make visual NFTs follow 'all wallets' concept
This includes us moving the population of visual tokens to be placed by
a QML file instead of in C++, which was what we wanted anyway.
2026-03-15 17:52:17 +01:00

86 lines
2.6 KiB
QML

import QtQuick;
import QtQuick.Controls as QQC2
import "../../mobile" as Mobile
import "../../Flowee" as Flowee
import Flowee.org.pay
Flickable {
id: root
implicitWidth: 100
implicitHeight: 100
boundsBehavior: Flickable.StopAtBounds
contentWidth: width
contentHeight: layouter.height
Flow {
id: layouter
anchors.fill: parent
spacing: 10
property int itemSize: {
let w = root.width
if (w < 210) {
if (model.length > 2)
return 120
return 160
}
if (model.length > 4)
return 120
return 160
}
Repeater {
model: tokens.tradableTokens
Rectangle {
width: layouter.itemSize
height: name.height + balanceLabel.height + 26 + (icon.visible ? icon.height : 0)
property QtObject md: metadata.identity(modelData.category)
property QtObject token: md.token
onTokenChanged: if (token) modelData.decimals = token.decimals
radius: 10
border.width: 1.2
border.color: palette.midlight
color: "#00000000"
clip: true
Flowee.Label {
id: name
y: 10
x: 6
text: md.name
width: parent.width - 12
horizontalAlignment: Text.AlignHCenter
fontSizeMode: Text.HorizontalFit
font.pixelSize: balanceLabel.font.pixelSize * 1.2
}
Flowee.Label {
id: balanceLabel
text: modelData.balance
anchors.top: name.bottom
anchors.topMargin: 6
x: 10
}
Flowee.Label {
anchors.left: balanceLabel.right
anchors.leftMargin: 6
anchors.baseline: balanceLabel.baseline
font.pixelSize: balanceLabel.font.pixelSize * 0.8
text: token == null ? "--" : token.symbol
}
Image {
id: icon
source: md.iconPath
visible: source !== ""
width: 50
height: 50
smooth: true
anchors.bottom: parent.bottom
anchors.bottomMargin: 10
anchors.horizontalCenter: parent.horizontalCenter
}
}
}
}
}