status-desktop/ui/app/AppLayouts/Chat/components/Contact.qml

75 lines
2.1 KiB
QML
Raw Normal View History

2020-06-17 15:56:48 +00:00
import QtQuick 2.3
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3
import Qt.labs.platform 1.1
import "../../../../imports"
import "../../../../shared"
Rectangle {
property string pubKey: "0x123456"
property string name: "Jotaro Kujo"
property string address: "0x04d8c07dd137bd1b73a6f51df148b4f77ddaa11209d36e43d8344c0a7d6db1cad6085f27cfb75dd3ae21d86ceffebe4cf8a35b9ce8d26baa19dc264efe6d8f221b"
property string identicon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII="
2020-06-22 12:16:44 +00:00
property bool isContact: true
2020-06-17 15:56:48 +00:00
property bool isUser: false
property bool isVisible: true
property bool showCheckbox: true
property bool isChecked: false
property var onItemChecked: (function(pubKey, itemChecked) { console.log(pubKey, itemChecked) })
2020-06-22 12:16:44 +00:00
visible: isVisible && (isContact || isUser)
height: visible ? 64 : 0
2020-06-17 15:56:48 +00:00
anchors.right: parent.right
anchors.left: parent.left
border.width: 0
radius: Theme.radius
RoundImage {
id: accountImage
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
source: identicon
}
StyledText {
2020-06-17 15:56:48 +00:00
id: usernameText
text: name
elide: Text.ElideRight
anchors.right: parent.right
anchors.rightMargin: Theme.padding
font.pixelSize: 17
anchors.top: accountImage.top
anchors.topMargin: 10
anchors.left: accountImage.right
anchors.leftMargin: Theme.padding
}
CheckBox {
id: assetCheck
visible: showCheckbox && !isUser
anchors.top: accountImage.top
anchors.topMargin: 6
anchors.right: parent.right
anchors.rightMargin: Theme.padding
checked: isChecked
onClicked: {
isChecked = !isChecked
onItemChecked(pubKey, isChecked)
}
}
StyledText {
2020-06-17 15:56:48 +00:00
visible: isUser
text: qsTr("Admin")
anchors.right: parent.right
anchors.rightMargin: Theme.padding
font.pixelSize: 15
color: Theme.darkGrey
anchors.top: accountImage.top
anchors.topMargin: 10
}
}