display QR code in profile

This commit is contained in:
Iuri Matias 2020-08-19 17:01:22 -04:00
parent 69b3ea57d6
commit 08ddc55db4
1 changed files with 28 additions and 1 deletions

View File

@ -9,6 +9,7 @@ Item {
property string identicon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAhklEQVR4nOzWwQ1AQBgFYUQvelKHMtShJ9VwFyvrsExe5jvKXiYv+WPoQhhCYwiNITSG0MSEjLUPt3097r7P09L/8f4qZhFDaAyhqboIT76+TiUxixhCYwhN9b/WW6Xr1ErMIobQGEJjCI0hNIbQGEJjCI0haiRmEUNoDKExhMYQmjMAAP//B2kXcP2uDV8AAAAASUVORK5CYII="
property string pubkey: "0x04d8c07dd137bd1b73a6f51df148b4f77ddaa11209d36e43d8344c0a7d6db1cad6085f27cfb75dd3ae21d86ceffebe4cf8a35b9ce8d26baa19dc264efe6d8f221b"
property string ensName: "joestar.eth"
property bool showQR: false
id: profileHeaderContent
height: parent.height
@ -77,11 +78,20 @@ Item {
MouseArea {
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
hoverEnabled: true
onExited: {
qrCodeButton.color = Style.current.white
}
onEntered: {
qrCodeButton.color = Style.current.grey
}
onClicked: {
console.log('QR code ples')
showQR = !showQR
}
}
}
ColorOverlay {
anchors.fill: qrCodeImage
source: qrCodeImage
@ -96,7 +106,24 @@ Item {
}
}
Item {
anchors.fill: parent
visible: showQR
Image {
asynchronous: true
fillMode: Image.PreserveAspectFit
source: profileModel.qrCode(pubkey)
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
height: 424
width: 424
mipmap: true
smooth: false
}
}
Column {
visible: !showQR
anchors.right: profileImgNameContainer.right
anchors.left: profileImgNameContainer.left
spacing: Style.current.bigPadding