2024-02-15 09:25:40 +00:00
|
|
|
import QtQuick 2.14
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
2024-02-27 17:11:03 +00:00
|
|
|
import QtGraphicalEffects 1.0
|
2024-02-15 09:25:40 +00:00
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import AppLayouts.Wallet.controls 1.0
|
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
Control {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
padding: 12
|
|
|
|
|
2024-02-27 17:11:03 +00:00
|
|
|
property bool highlight: false
|
2024-02-15 09:25:40 +00:00
|
|
|
property string title: ""
|
|
|
|
property string subTitle: ""
|
|
|
|
property string tagIcon: ""
|
|
|
|
property var enabledNetworks
|
|
|
|
property bool loading: false
|
|
|
|
property alias rightSideButtons: rightSideButtonsLoader.sourceComponent
|
2024-02-27 17:11:03 +00:00
|
|
|
signal clicked(var mouse)
|
|
|
|
signal communityTagClicked(var mouse)
|
|
|
|
|
2024-02-15 09:25:40 +00:00
|
|
|
|
|
|
|
property StatusAssetSettings asset: StatusAssetSettings {
|
|
|
|
height: 32
|
|
|
|
width: 32
|
|
|
|
bgRadius: bgWidth / 2
|
|
|
|
}
|
|
|
|
|
|
|
|
background: Rectangle {
|
2024-02-27 17:11:03 +00:00
|
|
|
id: background
|
2024-02-15 09:25:40 +00:00
|
|
|
anchors.fill: parent
|
|
|
|
color: Style.current.background
|
|
|
|
radius: Style.current.radius
|
|
|
|
border.width: 1
|
|
|
|
border.color: Theme.palette.baseColor2
|
2024-02-27 17:11:03 +00:00
|
|
|
layer.enabled: mouseArea.containsMouse || root.highlight
|
|
|
|
layer.effect: DropShadow {
|
|
|
|
source: background
|
|
|
|
horizontalOffset: 0
|
|
|
|
verticalOffset: 2
|
|
|
|
radius: 16
|
|
|
|
samples: 25
|
|
|
|
spread: 0
|
|
|
|
color: Theme.palette.backdropColor
|
|
|
|
}
|
2024-02-15 09:25:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
contentItem: Item {
|
2024-02-27 17:11:03 +00:00
|
|
|
MouseArea {
|
|
|
|
id: mouseArea
|
|
|
|
anchors.fill: parent
|
|
|
|
acceptedButtons: Qt.LeftButton|Qt.RightButton
|
|
|
|
hoverEnabled: true
|
|
|
|
onClicked: {
|
|
|
|
root.clicked(mouse);
|
|
|
|
}
|
|
|
|
}
|
2024-02-15 09:25:40 +00:00
|
|
|
ColumnLayout {
|
|
|
|
id: titleColumn
|
|
|
|
anchors.fill: parent
|
|
|
|
spacing: 0
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.preferredHeight: root.asset.height
|
|
|
|
StatusSmartIdenticon {
|
|
|
|
asset: root.asset
|
|
|
|
active: ((root.asset.isLetterIdenticon ||
|
|
|
|
!!root.asset.name ||
|
|
|
|
!!root.asset.emoji) && !root.showLoadingIndicator)
|
|
|
|
loading: root.loading
|
|
|
|
}
|
|
|
|
Item { Layout.fillWidth: true }
|
|
|
|
Loader {
|
|
|
|
id: rightSideButtonsLoader
|
2024-02-27 17:11:03 +00:00
|
|
|
Layout.alignment: Qt.AlignRight | Qt.AlignTop
|
2024-02-15 09:25:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusTextWithLoadingState {
|
2024-02-27 17:11:03 +00:00
|
|
|
Layout.fillWidth: true
|
2024-02-15 09:25:40 +00:00
|
|
|
Layout.preferredHeight: 22
|
|
|
|
Layout.topMargin: Style.current.halfPadding
|
2024-02-27 17:11:03 +00:00
|
|
|
text: root.title
|
2024-02-15 09:25:40 +00:00
|
|
|
elide: Text.ElideRight
|
|
|
|
font.weight: Font.Medium
|
|
|
|
loading: root.loading
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusTextWithLoadingState {
|
|
|
|
id: statusListItemSubTitle
|
|
|
|
objectName: "statusListItemSubTitle"
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.preferredHeight: 16
|
|
|
|
text: root.subTitle
|
|
|
|
font.pixelSize: Style.current.tertiaryTextFontSize
|
|
|
|
lineHeight: 16
|
|
|
|
customColor: !root.enabled || !root.tertiaryTitle ?
|
|
|
|
Theme.palette.baseColor1 : Theme.palette.directColor1
|
|
|
|
visible: !!root.subTitle
|
|
|
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
|
|
|
loading: root.loading
|
|
|
|
maximumLineCount: 3
|
|
|
|
elide: Text.ElideRight
|
|
|
|
}
|
|
|
|
Item { Layout.fillHeight: true }
|
|
|
|
Row {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.preferredHeight: 20
|
|
|
|
spacing: -4
|
|
|
|
visible: (chainRepeater.count > 0)
|
|
|
|
Repeater {
|
|
|
|
id: chainRepeater
|
|
|
|
model: root.enabledNetworks
|
2024-02-27 17:11:03 +00:00
|
|
|
delegate: StatusRoundedComponent {
|
2024-02-15 09:25:40 +00:00
|
|
|
width: 20
|
|
|
|
height: 20
|
2024-02-27 17:11:03 +00:00
|
|
|
visible: model.iconUrl !== ""
|
|
|
|
color: Theme.palette.baseColor3
|
2024-02-15 09:25:40 +00:00
|
|
|
z: index + 1
|
2024-02-27 17:11:03 +00:00
|
|
|
border.color: Style.current.background
|
|
|
|
StatusIcon {
|
|
|
|
anchors.fill:parent
|
|
|
|
anchors.margins: 1
|
|
|
|
icon: Style.svg(model.iconUrl)
|
|
|
|
}
|
2024-02-15 09:25:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ManageTokensCommunityTag {
|
|
|
|
Layout.preferredWidth: 24
|
|
|
|
Layout.preferredHeight: 24
|
|
|
|
horizontalPadding: 2
|
|
|
|
verticalPadding: 0
|
|
|
|
spacing: 0
|
|
|
|
visible: !!root.tagIcon
|
2024-02-27 17:11:03 +00:00
|
|
|
communityImage: root.tagIcon
|
2024-02-15 09:25:40 +00:00
|
|
|
asset.width: 20
|
|
|
|
asset.height: 20
|
2024-02-27 17:11:03 +00:00
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
onClicked: {
|
|
|
|
root.communityTagClicked(mouse);
|
|
|
|
}
|
|
|
|
}
|
2024-02-15 09:25:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|