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
|
2023-02-07 08:23:44 +00:00
|
|
|
property string networkShortName
|
2022-11-28 21:05:57 +00:00
|
|
|
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
|
2023-03-06 16:46:32 +00:00
|
|
|
elide: Text.ElideRight
|
2022-11-28 21:05:57 +00:00
|
|
|
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
|
2023-03-06 16:46:32 +00:00
|
|
|
Layout.fillWidth: true
|
2022-11-28 21:05:57 +00:00
|
|
|
|
|
|
|
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
|
2023-03-06 16:46:32 +00:00
|
|
|
Layout.maximumWidth: root.width - parent.spacing - networkTag.width
|
2022-11-28 21:05:57 +00:00
|
|
|
|
|
|
|
Binding {
|
|
|
|
target: collectibleIdBottomRow.item
|
|
|
|
property: "text"
|
|
|
|
value: root.secondaryText
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
InformationTag {
|
|
|
|
id: networkTag
|
2023-02-07 08:23:44 +00:00
|
|
|
readonly property bool isNetworkValid: networkShortName !== ""
|
2022-11-28 21:05:57 +00:00
|
|
|
image.source: isNetworkValid && networkIconURL !== "" ? Style.svg("tiny/" + networkIconURL) : ""
|
2023-02-07 08:23:44 +00:00
|
|
|
tagPrimaryLabel.text: isNetworkValid ? networkShortName : "---"
|
2022-11-28 21:05:57 +00:00
|
|
|
tagPrimaryLabel.color: isNetworkValid ? networkColor : "black"
|
|
|
|
visible: isNetworkValid
|
2021-10-21 08:22:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|