2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
2020-06-13 13:49:20 +00:00
|
|
|
import "../../../../../imports"
|
|
|
|
import "../../../../../shared"
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
property string name: "Jotaro Kujo"
|
|
|
|
property string address: "0x04d8c07dd137bd1b73a6f51df148b4f77ddaa11209d36e43d8344c0a7d6db1cad6085f27cfb75dd3ae21d86ceffebe4cf8a35b9ce8d26baa19dc264efe6d8f221b"
|
|
|
|
property string identicon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII="
|
2020-06-16 18:04:56 +00:00
|
|
|
property bool selectable: false
|
2020-06-17 21:54:03 +00:00
|
|
|
property var profileClick: function() {}
|
2020-06-22 12:16:44 +00:00
|
|
|
property bool isContact: true
|
2020-06-13 13:49:20 +00:00
|
|
|
|
2020-06-22 12:16:44 +00:00
|
|
|
visible: isContact
|
|
|
|
height: visible ? 64 : 0
|
2020-06-13 13:49:20 +00:00
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.left: parent.left
|
|
|
|
border.width: 0
|
2020-07-02 15:14:31 +00:00
|
|
|
radius: Style.current.radius
|
2020-06-13 13:49:20 +00:00
|
|
|
|
2020-06-24 03:23:49 +00:00
|
|
|
Identicon {
|
2020-06-13 13:49:20 +00:00
|
|
|
id: accountImage
|
|
|
|
anchors.left: parent.left
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.leftMargin: Style.current.padding
|
2020-06-13 13:49:20 +00:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
source: identicon
|
|
|
|
}
|
2020-06-19 18:06:58 +00:00
|
|
|
StyledText {
|
2020-06-13 13:49:20 +00:00
|
|
|
id: usernameText
|
|
|
|
text: name
|
|
|
|
elide: Text.ElideRight
|
|
|
|
anchors.right: parent.right
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.rightMargin: Style.current.padding
|
2020-06-13 13:49:20 +00:00
|
|
|
font.pixelSize: 17
|
|
|
|
anchors.top: accountImage.top
|
|
|
|
anchors.left: accountImage.right
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.leftMargin: Style.current.padding
|
2020-06-13 13:49:20 +00:00
|
|
|
}
|
2020-06-19 18:06:58 +00:00
|
|
|
StyledText {
|
2020-06-13 13:49:20 +00:00
|
|
|
id: addressText
|
|
|
|
width: 108
|
2020-07-02 15:14:31 +00:00
|
|
|
font.family: Style.current.fontHexRegular.name
|
2020-06-13 13:49:20 +00:00
|
|
|
text: address
|
|
|
|
elide: Text.ElideMiddle
|
|
|
|
anchors.bottom: accountImage.bottom
|
|
|
|
anchors.bottomMargin: 0
|
|
|
|
anchors.left: usernameText.left
|
|
|
|
anchors.leftMargin: 0
|
|
|
|
font.pixelSize: 15
|
2020-07-02 15:14:31 +00:00
|
|
|
color: Style.current.darkGrey
|
2020-06-13 13:49:20 +00:00
|
|
|
}
|
2020-06-16 18:04:56 +00:00
|
|
|
RadioButton {
|
|
|
|
visible: selectable
|
|
|
|
anchors.top: parent.top
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.topMargin: Style.current.smallPadding
|
2020-06-16 18:04:56 +00:00
|
|
|
anchors.right: parent.right
|
|
|
|
ButtonGroup.group: contactGroup
|
|
|
|
}
|
2020-06-17 21:54:03 +00:00
|
|
|
MouseArea {
|
|
|
|
enabled: !selectable
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
anchors.fill: parent
|
|
|
|
onClicked: {
|
|
|
|
profileClick(name, address, identicon)
|
|
|
|
}
|
|
|
|
}
|
2020-06-13 13:49:20 +00:00
|
|
|
}
|