2026-02-17 21:00:12 +01:00
|
|
|
import QtQuick;
|
|
|
|
|
import QtQuick.Controls as QQC2
|
|
|
|
|
import "../../mobile" as Mobile
|
|
|
|
|
import "../../Flowee" as Flowee
|
|
|
|
|
import Flowee.org.pay
|
|
|
|
|
|
2026-03-15 17:50:22 +01:00
|
|
|
Flickable {
|
2026-03-06 22:01:39 +01:00
|
|
|
id: root
|
2026-02-17 21:00:12 +01:00
|
|
|
implicitWidth: 100
|
|
|
|
|
implicitHeight: 100
|
2026-03-15 17:50:22 +01:00
|
|
|
boundsBehavior: Flickable.StopAtBounds
|
|
|
|
|
contentWidth: width
|
|
|
|
|
contentHeight: layouter.height
|
2026-02-17 21:00:12 +01:00
|
|
|
|
2026-03-06 22:01:39 +01:00
|
|
|
Flow {
|
|
|
|
|
id: layouter
|
2026-02-17 21:00:12 +01:00
|
|
|
anchors.fill: parent
|
2026-03-06 22:01:39 +01:00
|
|
|
spacing: 10
|
|
|
|
|
property int itemSize: {
|
|
|
|
|
let w = root.width
|
|
|
|
|
if (w < 210) {
|
|
|
|
|
if (model.length > 2)
|
2026-03-07 23:55:20 +01:00
|
|
|
return 120
|
2026-03-06 22:01:39 +01:00
|
|
|
return 160
|
|
|
|
|
}
|
|
|
|
|
if (model.length > 4)
|
2026-03-07 23:55:20 +01:00
|
|
|
return 120
|
2026-03-06 22:01:39 +01:00
|
|
|
return 160
|
|
|
|
|
}
|
2026-02-17 21:00:12 +01:00
|
|
|
|
2026-03-06 22:01:39 +01:00
|
|
|
Repeater {
|
|
|
|
|
model: tokens.tradableTokens
|
|
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
|
width: layouter.itemSize
|
2026-03-07 14:07:38 +01:00
|
|
|
height: name.height + balanceLabel.height + 26 + (icon.visible ? icon.height : 0)
|
2026-03-07 17:07:53 +01:00
|
|
|
property QtObject md: metadata.identity(modelData.category)
|
2026-03-06 22:01:39 +01:00
|
|
|
property QtObject token: md.token
|
2026-03-07 17:07:53 +01:00
|
|
|
onTokenChanged: if (token) modelData.decimals = token.decimals
|
2026-03-06 22:01:39 +01:00
|
|
|
radius: 10
|
|
|
|
|
border.width: 1.2
|
|
|
|
|
border.color: palette.midlight
|
|
|
|
|
color: "#00000000"
|
2026-03-07 23:55:20 +01:00
|
|
|
clip: true
|
2026-02-17 21:00:12 +01:00
|
|
|
|
|
|
|
|
Flowee.Label {
|
2026-03-06 22:01:39 +01:00
|
|
|
id: name
|
|
|
|
|
y: 10
|
|
|
|
|
x: 6
|
2026-03-06 21:08:37 +01:00
|
|
|
text: md.name
|
2026-03-06 22:01:39 +01:00
|
|
|
width: parent.width - 12
|
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
|
fontSizeMode: Text.HorizontalFit
|
|
|
|
|
font.pixelSize: balanceLabel.font.pixelSize * 1.2
|
2026-03-06 21:08:37 +01:00
|
|
|
}
|
|
|
|
|
Flowee.Label {
|
2026-03-06 22:01:39 +01:00
|
|
|
id: balanceLabel
|
2026-03-07 17:07:53 +01:00
|
|
|
text: modelData.balance
|
2026-03-06 22:01:39 +01:00
|
|
|
anchors.top: name.bottom
|
|
|
|
|
anchors.topMargin: 6
|
|
|
|
|
x: 10
|
2026-02-17 21:00:12 +01:00
|
|
|
}
|
2026-03-06 21:08:37 +01:00
|
|
|
Flowee.Label {
|
2026-03-06 22:01:39 +01:00
|
|
|
anchors.left: balanceLabel.right
|
|
|
|
|
anchors.leftMargin: 6
|
|
|
|
|
anchors.baseline: balanceLabel.baseline
|
|
|
|
|
font.pixelSize: balanceLabel.font.pixelSize * 0.8
|
2026-03-08 22:52:32 +01:00
|
|
|
text: token == null ? "--" : token.symbol
|
2026-03-06 21:08:37 +01:00
|
|
|
}
|
2026-03-07 14:07:38 +01:00
|
|
|
|
|
|
|
|
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
|
|
|
|
|
}
|
2026-02-17 21:00:12 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|