support opening profile modal in contacts section

This commit is contained in:
Iuri Matias 2020-06-17 17:54:03 -04:00
parent e7e77f58dc
commit 93361921b7
2 changed files with 15 additions and 0 deletions

View File

@ -10,6 +10,7 @@ Rectangle {
property string address: "0x04d8c07dd137bd1b73a6f51df148b4f77ddaa11209d36e43d8344c0a7d6db1cad6085f27cfb75dd3ae21d86ceffebe4cf8a35b9ce8d26baa19dc264efe6d8f221b"
property string identicon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII="
property bool selectable: false
property var profileClick: function() {}
height: 64
anchors.right: parent.right
@ -54,4 +55,12 @@ Rectangle {
anchors.right: parent.right
ButtonGroup.group: contactGroup
}
MouseArea {
enabled: !selectable
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
onClicked: {
profileClick(name, address, identicon)
}
}
}

View File

@ -5,6 +5,7 @@ import Qt.labs.platform 1.1
import "./samples/"
import "../../../../../imports"
import "../../../../../shared"
import "../../../Chat/components"
ListView {
id: contactList
@ -22,6 +23,11 @@ ListView {
address: model.address
identicon: model.identicon
selectable: contactList.selectable
profileClick: profilePopup.openPopup.bind(profilePopup)
}
ProfilePopup {
id: profilePopup
}
ButtonGroup {