2022-11-28 21:05:57 +00:00
|
|
|
import QtQuick 2.14
|
2021-10-21 08:22:05 +00:00
|
|
|
import QtQuick.Layouts 1.13
|
|
|
|
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
|
2022-07-28 20:56:44 +00:00
|
|
|
import utils 1.0
|
|
|
|
import shared.controls 1.0
|
|
|
|
|
2021-12-06 21:10:54 +00:00
|
|
|
import "../../stores"
|
2021-10-21 08:22:05 +00:00
|
|
|
import "../../controls"
|
|
|
|
|
2022-07-28 20:56:44 +00:00
|
|
|
Item {
|
2021-10-21 08:22:05 +00:00
|
|
|
id: root
|
|
|
|
|
2022-11-22 19:31:07 +00:00
|
|
|
property var currentCollectible: RootStore.currentCollectible
|
2022-11-28 21:05:57 +00:00
|
|
|
readonly property int isNarrowMode : width < 700
|
2022-11-22 19:31:07 +00:00
|
|
|
|
2021-10-21 08:22:05 +00:00
|
|
|
CollectibleDetailsHeader {
|
|
|
|
id: collectibleHeader
|
2022-07-28 20:56:44 +00:00
|
|
|
anchors.top: parent.top
|
2021-10-21 08:22:05 +00:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
2022-11-22 19:31:07 +00:00
|
|
|
asset.name: currentCollectible.collectionImageUrl
|
2022-08-11 11:55:08 +00:00
|
|
|
asset.isImage: true
|
2022-11-28 21:05:57 +00:00
|
|
|
primaryText: currentCollectible.collectionName
|
2022-11-22 19:31:07 +00:00
|
|
|
secondaryText: currentCollectible.id
|
2022-11-28 21:05:57 +00:00
|
|
|
isNarrowMode: root.isNarrowMode
|
2023-02-07 08:23:44 +00:00
|
|
|
networkShortName: currentCollectible.networkShortName
|
2022-11-28 21:05:57 +00:00
|
|
|
networkColor: currentCollectible.networkColor
|
|
|
|
networkIconURL: currentCollectible.networkIconUrl
|
2021-10-21 08:22:05 +00:00
|
|
|
}
|
|
|
|
|
2022-07-28 20:56:44 +00:00
|
|
|
ColumnLayout {
|
2022-11-28 21:05:57 +00:00
|
|
|
id: collectibleBody
|
2021-10-21 08:22:05 +00:00
|
|
|
anchors.top: collectibleHeader.bottom
|
2022-11-28 21:05:57 +00:00
|
|
|
anchors.topMargin: 25
|
2022-07-28 20:56:44 +00:00
|
|
|
anchors.left: parent.left
|
2022-11-28 21:05:57 +00:00
|
|
|
anchors.leftMargin: root.isNarrowMode ? 0 : 52
|
2022-07-28 20:56:44 +00:00
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
|
|
|
|
spacing: Style.current.padding
|
2021-10-21 08:22:05 +00:00
|
|
|
|
|
|
|
Row {
|
|
|
|
id: collectibleImageDetails
|
2022-11-28 21:05:57 +00:00
|
|
|
Layout.preferredHeight: root.isNarrowMode ? 152 : collectibleimage.height
|
2022-07-28 20:56:44 +00:00
|
|
|
Layout.preferredWidth: parent.width
|
2021-10-21 08:22:05 +00:00
|
|
|
spacing: 24
|
|
|
|
|
|
|
|
StatusRoundedImage {
|
|
|
|
id: collectibleimage
|
2022-11-28 21:05:57 +00:00
|
|
|
readonly property int size : root.isNarrowMode ? 132 : 253
|
|
|
|
width: size
|
|
|
|
height: size
|
2021-10-21 08:22:05 +00:00
|
|
|
radius: 2
|
2022-11-22 19:31:07 +00:00
|
|
|
color: currentCollectible.backgroundColor
|
2021-10-21 08:22:05 +00:00
|
|
|
border.color: Theme.palette.directColor8
|
|
|
|
border.width: 1
|
2022-11-22 19:31:07 +00:00
|
|
|
image.source: currentCollectible.imageUrl
|
2021-10-21 08:22:05 +00:00
|
|
|
}
|
2022-11-28 21:05:57 +00:00
|
|
|
|
|
|
|
Column {
|
|
|
|
id: collectibleNameAndDescription
|
|
|
|
spacing: 12
|
|
|
|
|
2022-07-28 20:56:44 +00:00
|
|
|
width: parent.width - collectibleimage.width - Style.current.bigPadding
|
2022-11-28 21:05:57 +00:00
|
|
|
|
|
|
|
StatusBaseText {
|
|
|
|
id: collectibleName
|
|
|
|
width: parent.width
|
|
|
|
height: 24
|
|
|
|
|
|
|
|
text: currentCollectible.name
|
|
|
|
color: Theme.palette.directColor1
|
|
|
|
font.pixelSize: 17
|
|
|
|
lineHeight: 24
|
|
|
|
elide: Text.ElideRight
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusScrollView {
|
|
|
|
id: descriptionScrollView
|
|
|
|
width: parent.width
|
|
|
|
height: collectibleImageDetails.height - collectibleName.height - parent.spacing
|
|
|
|
|
|
|
|
contentWidth: availableWidth
|
|
|
|
contentHeight: descriptionText.height
|
|
|
|
|
|
|
|
padding: 0
|
|
|
|
|
|
|
|
StatusBaseText {
|
|
|
|
id: descriptionText
|
|
|
|
width: descriptionScrollView.availableWidth
|
|
|
|
|
|
|
|
text: currentCollectible.description
|
|
|
|
textFormat: Text.MarkdownText
|
|
|
|
color: Theme.palette.directColor4
|
|
|
|
font.pixelSize: 15
|
|
|
|
lineHeight: 22
|
|
|
|
lineHeightMode: Text.FixedHeight
|
|
|
|
elide: Text.ElideRight
|
|
|
|
wrapMode: Text.Wrap
|
|
|
|
}
|
|
|
|
}
|
2021-10-21 08:22:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-28 20:56:44 +00:00
|
|
|
StatusTabBar {
|
|
|
|
id: collectiblesDetailsTab
|
|
|
|
Layout.fillWidth: true
|
2022-11-28 21:05:57 +00:00
|
|
|
Layout.topMargin: root.isNarrowMode ? 0 : Style.current.xlPadding
|
2022-11-22 19:31:07 +00:00
|
|
|
visible: currentCollectible.properties.count > 0
|
2021-10-21 08:22:05 +00:00
|
|
|
|
2022-07-28 20:56:44 +00:00
|
|
|
StatusTabButton {
|
|
|
|
leftPadding: 0
|
|
|
|
width: implicitWidth
|
|
|
|
text: qsTr("Properties")
|
2021-10-21 08:22:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-11-28 21:05:57 +00:00
|
|
|
StatusScrollView {
|
|
|
|
id: scrollView
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
2022-07-28 20:56:44 +00:00
|
|
|
Flow {
|
2022-11-28 21:05:57 +00:00
|
|
|
width: scrollView.availableWidth
|
2022-07-28 20:56:44 +00:00
|
|
|
spacing: 10
|
|
|
|
Repeater {
|
2022-11-22 19:31:07 +00:00
|
|
|
model: currentCollectible.properties
|
2022-07-28 20:56:44 +00:00
|
|
|
InformationTile {
|
|
|
|
maxWidth: parent.width
|
|
|
|
primaryText: model.traitType
|
|
|
|
secondaryText: model.value
|
2021-10-21 08:22:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|