2022-03-09 10:27:32 +00:00
|
|
|
import QtQuick 2.14
|
|
|
|
import QtQuick.Layouts 1.14
|
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
import shared.panels 1.0
|
2022-03-07 22:59:38 +00:00
|
|
|
import shared.controls 1.0
|
2022-03-09 10:27:32 +00:00
|
|
|
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import StatusQ.Core.Utils 0.1 as StatusQUtils
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
property string displayName
|
|
|
|
property string pubkey
|
|
|
|
property string icon
|
|
|
|
|
2022-04-14 08:26:46 +00:00
|
|
|
property bool compact: true
|
2022-03-09 10:27:32 +00:00
|
|
|
property bool displayNameVisible: true
|
|
|
|
property bool pubkeyVisible: true
|
|
|
|
|
|
|
|
property alias imageOverlay: imageOverlay.sourceComponent
|
|
|
|
|
|
|
|
signal clicked()
|
|
|
|
|
|
|
|
height: visible ? contentContainer.height : 0
|
2022-03-16 21:20:03 +00:00
|
|
|
implicitHeight: contentContainer.implicitHeight
|
2022-03-09 10:27:32 +00:00
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
id: contentContainer
|
|
|
|
|
2022-04-14 08:26:46 +00:00
|
|
|
spacing: root.compact ? 4 : 12
|
|
|
|
|
2022-03-09 10:27:32 +00:00
|
|
|
anchors {
|
|
|
|
left: parent.left
|
|
|
|
right: parent.right
|
|
|
|
leftMargin: Style.current.smallPadding
|
|
|
|
rightMargin: Style.current.smallPadding
|
|
|
|
}
|
|
|
|
|
|
|
|
UserImage {
|
|
|
|
id: userImage
|
|
|
|
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
|
|
|
|
name: root.displayName
|
|
|
|
pubkey: root.pubkey
|
2022-03-30 15:30:28 +00:00
|
|
|
image: root.icon
|
2022-03-09 10:27:32 +00:00
|
|
|
interactive: false
|
2022-04-14 08:26:46 +00:00
|
|
|
imageWidth: root.compact ? 36 : 80
|
|
|
|
imageHeight: imageWidth
|
2022-03-09 10:27:32 +00:00
|
|
|
|
|
|
|
Loader {
|
|
|
|
id: imageOverlay
|
|
|
|
anchors.fill: parent
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
|
|
visible: root.displayNameVisible
|
|
|
|
|
|
|
|
text: root.displayName
|
|
|
|
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
elide: Text.ElideRight
|
|
|
|
maximumLineCount: 3
|
|
|
|
wrapMode: Text.Wrap
|
|
|
|
font {
|
|
|
|
weight: Font.Medium
|
|
|
|
pixelSize: Style.current.primaryTextFontSize
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
|
|
visible: root.pubkeyVisible
|
|
|
|
|
2022-03-30 07:09:39 +00:00
|
|
|
text: Utils.getElidedCompressedPk(pubkey)
|
2022-03-09 10:27:32 +00:00
|
|
|
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
font.pixelSize: Style.current.asideTextFontSize
|
|
|
|
color: Style.current.secondaryText
|
|
|
|
}
|
|
|
|
|
2022-03-07 22:59:38 +00:00
|
|
|
EmojiHash {
|
2022-04-14 08:26:46 +00:00
|
|
|
id: emojiHash
|
|
|
|
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
|
2022-03-07 22:59:38 +00:00
|
|
|
publicKey: root.pubkey
|
2022-04-14 08:26:46 +00:00
|
|
|
size: root.compact ? 16 : 20
|
2022-03-09 10:27:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|