2026-03-13 18:53:02 +01:00
|
|
|
import QtQuick
|
2026-03-07 23:55:20 +01:00
|
|
|
import QtQuick.Controls as QQC2
|
|
|
|
|
import "../../mobile" as Mobile
|
|
|
|
|
import "../../Flowee" as Flowee
|
|
|
|
|
import Flowee.org.pay
|
|
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
|
id: root
|
|
|
|
|
color: palette.base
|
|
|
|
|
border.width: 1
|
|
|
|
|
border.color: palette.midlight
|
|
|
|
|
radius: 10
|
|
|
|
|
|
|
|
|
|
property QtObject md: metadata.identity(modelData.category)
|
|
|
|
|
property QtObject token: md.token
|
2026-03-13 18:53:02 +01:00
|
|
|
property QtObject nft: token.nftById(modelData.nftId)
|
2026-03-07 23:55:20 +01:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* NFTs of the visual kind typically have an image or icon.
|
|
|
|
|
* We don't want to auto download data just because the token tab is open.
|
|
|
|
|
* Because this means that just sending a transaction to a known address on
|
|
|
|
|
* chain may cause the wallet to download stuff. Let alone display something
|
|
|
|
|
* that may be offensive or simply an advertisement.
|
|
|
|
|
*
|
|
|
|
|
* As such the download should be user initiated.
|
|
|
|
|
*/
|
|
|
|
|
Item {
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
anchors.margins: 4
|
|
|
|
|
Image {
|
|
|
|
|
source: {
|
2026-03-13 18:53:02 +01:00
|
|
|
var n = root.nft;
|
2026-03-07 23:55:20 +01:00
|
|
|
if (n == null)
|
|
|
|
|
return ""
|
|
|
|
|
return n.iconPath
|
|
|
|
|
}
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
anchors.bottomMargin: title.height
|
|
|
|
|
fillMode: Image.PreserveAspectCrop
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Flowee.Label {
|
|
|
|
|
id: title
|
|
|
|
|
anchors.bottom: parent.bottom
|
2026-03-13 18:53:02 +01:00
|
|
|
text: root.nft.name
|
2026-03-07 23:55:20 +01:00
|
|
|
width: parent.width - 20
|
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
|
elide: Text.ElideRight
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QQC2.Button {
|
|
|
|
|
text: "fetch"
|
2026-03-13 18:53:02 +01:00
|
|
|
onClicked: root.nft.downloadIcon()
|
|
|
|
|
visible: root.nft.iconPath === ""
|
2026-03-07 23:55:20 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|