2021-10-21 08:22:05 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
|
|
|
|
2022-07-28 20:56:44 +00:00
|
|
|
import utils 1.0
|
|
|
|
|
2021-10-21 08:22:05 +00:00
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
|
2022-11-28 21:05:57 +00:00
|
|
|
import shared.controls 1.0
|
|
|
|
|
2022-07-28 20:56:44 +00:00
|
|
|
ColumnLayout {
|
|
|
|
id: root
|
2021-10-21 08:22:05 +00:00
|
|
|
property alias primaryText: collectibleName.text
|
2022-11-28 21:05:57 +00:00
|
|
|
property string secondaryText
|
|
|
|
property bool isNarrowMode
|
|
|
|
property string networkName
|
|
|
|
property string networkColor
|
|
|
|
property string networkIconURL
|
|
|
|
|
2022-08-11 11:55:08 +00:00
|
|
|
property StatusAssetSettings asset: StatusAssetSettings {
|
2022-11-28 21:05:57 +00:00
|
|
|
readonly property int size: root.isNarrowMode ? 24 : 38
|
|
|
|
width: size
|
|
|
|
height: size
|
2022-08-11 11:55:08 +00:00
|
|
|
isImage: true
|
2021-10-21 08:22:05 +00:00
|
|
|
}
|
|
|
|
|
2022-11-28 21:05:57 +00:00
|
|
|
Component {
|
|
|
|
id: collectibleIdComponent
|
|
|
|
StatusBaseText {
|
|
|
|
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
|
|
|
|
font.pixelSize: isNarrowMode ? 15 : 22
|
|
|
|
lineHeight: isNarrowMode ? 22 : 30
|
|
|
|
lineHeightMode: Text.FixedHeight
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-28 20:56:44 +00:00
|
|
|
RowLayout {
|
|
|
|
StatusSmartIdenticon {
|
2021-10-21 08:22:05 +00:00
|
|
|
id: identiconLoader
|
2022-08-11 11:55:08 +00:00
|
|
|
asset: root.asset
|
2021-10-21 08:22:05 +00:00
|
|
|
}
|
2022-11-28 21:05:57 +00:00
|
|
|
|
2021-10-21 08:22:05 +00:00
|
|
|
StatusBaseText {
|
|
|
|
id: collectibleName
|
2022-11-28 21:05:57 +00:00
|
|
|
|
|
|
|
font.pixelSize: 22
|
|
|
|
lineHeight: 30
|
2021-10-21 08:22:05 +00:00
|
|
|
lineHeightMode: Text.FixedHeight
|
|
|
|
elide: Text.ElideRight
|
|
|
|
color: Theme.palette.directColor1
|
|
|
|
}
|
2022-11-28 21:05:57 +00:00
|
|
|
|
|
|
|
Loader {
|
|
|
|
id: collectibleIdTopRow
|
|
|
|
sourceComponent: collectibleIdComponent
|
|
|
|
visible: !root.isNarrowMode
|
|
|
|
|
|
|
|
Binding {
|
|
|
|
target: collectibleIdTopRow.item
|
|
|
|
property: "text"
|
|
|
|
value: root.secondaryText
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
Layout.leftMargin: root.isNarrowMode ? 0 : 48
|
|
|
|
spacing: 10
|
|
|
|
|
|
|
|
Loader {
|
|
|
|
id: collectibleIdBottomRow
|
|
|
|
sourceComponent: collectibleIdComponent
|
|
|
|
visible: root.isNarrowMode
|
|
|
|
|
|
|
|
Binding {
|
|
|
|
target: collectibleIdBottomRow.item
|
|
|
|
property: "text"
|
|
|
|
value: root.secondaryText
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
InformationTag {
|
|
|
|
id: networkTag
|
|
|
|
readonly property bool isNetworkValid: networkName !== ""
|
|
|
|
image.source: isNetworkValid && networkIconURL !== "" ? Style.svg("tiny/" + networkIconURL) : ""
|
|
|
|
tagPrimaryLabel.text: isNetworkValid ? networkName : "---"
|
|
|
|
tagPrimaryLabel.color: isNetworkValid ? networkColor : "black"
|
|
|
|
visible: isNetworkValid
|
2021-10-21 08:22:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|