2021-10-01 15:58:36 +00:00
|
|
|
import QtQuick 2.3
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared 1.0
|
|
|
|
import shared.panels 1.0
|
2021-10-01 15:58:36 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
2022-03-09 10:27:32 +00:00
|
|
|
import StatusQ.Components 0.1
|
|
|
|
|
2021-10-01 15:58:36 +00:00
|
|
|
Loader {
|
|
|
|
id: root
|
2022-03-09 10:27:32 +00:00
|
|
|
|
2022-03-30 15:30:28 +00:00
|
|
|
property int imageHeight: compact ? 36 : 40
|
|
|
|
property int imageWidth: compact ? 36 : 40
|
|
|
|
property bool compact: true
|
2022-03-09 10:27:32 +00:00
|
|
|
|
|
|
|
property string name
|
|
|
|
property string pubkey
|
2022-03-30 15:30:28 +00:00
|
|
|
property string image
|
2022-03-09 10:27:32 +00:00
|
|
|
property bool showRing: false
|
|
|
|
property bool interactive: true
|
|
|
|
|
|
|
|
signal clicked()
|
|
|
|
|
|
|
|
height: active ? item.height : 0
|
|
|
|
|
|
|
|
sourceComponent: StatusSmartIdenticon {
|
|
|
|
name: root.name
|
|
|
|
image {
|
|
|
|
width: root.imageWidth
|
|
|
|
height: root.imageHeight
|
2022-03-30 15:30:28 +00:00
|
|
|
source: root.image
|
2022-03-09 10:27:32 +00:00
|
|
|
}
|
|
|
|
icon {
|
|
|
|
width: root.imageWidth
|
|
|
|
height: root.imageHeight
|
|
|
|
color: Style.current.background
|
|
|
|
textColor: Style.current.secondaryText
|
|
|
|
charactersLen: 2
|
|
|
|
}
|
|
|
|
ringSettings {
|
|
|
|
ringSpecModel: root.showRing ? Utils.getColorHashAsJson(root.pubkey) : undefined
|
|
|
|
}
|
|
|
|
|
|
|
|
Loader {
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
active: root.interactive
|
2021-12-09 12:53:40 +00:00
|
|
|
|
2022-03-09 10:27:32 +00:00
|
|
|
sourceComponent: MouseArea {
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
hoverEnabled: true
|
|
|
|
onClicked: root.clicked()
|
2021-10-01 15:58:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|