From 08ddc55db43940234fee3ebd1979e1302bfa8535 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Wed, 19 Aug 2020 17:01:22 -0400 Subject: [PATCH] display QR code in profile --- .../Profile/Sections/MyProfileContainer.qml | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/ui/app/AppLayouts/Profile/Sections/MyProfileContainer.qml b/ui/app/AppLayouts/Profile/Sections/MyProfileContainer.qml index 2fd2a92f4f..421deb9ae6 100644 --- a/ui/app/AppLayouts/Profile/Sections/MyProfileContainer.qml +++ b/ui/app/AppLayouts/Profile/Sections/MyProfileContainer.qml @@ -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