status-desktop/ui/app/AppLayouts/Profile/LeftTab/Profile.qml

77 lines
2.7 KiB
QML
Raw Normal View History

2020-06-17 19:18:31 +00:00
import QtQuick 2.13
import QtQuick.Layouts 1.13
import QtGraphicalEffects 1.13
2020-05-27 20:57:36 +00:00
import "../../../../imports"
import "../../../../shared"
2020-05-27 20:57:36 +00:00
2020-05-27 21:28:25 +00:00
Rectangle {
2020-06-17 19:59:10 +00:00
property string username: "Jotaro Kujo"
property string identicon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAhklEQVR4nOzWwQ1AQBgFYUQvelKHMtShJ9VwFyvrsExe5jvKXiYv+WPoQhhCYwiNITSG0MSEjLUPt3097r7P09L/8f4qZhFDaAyhqboIT76+TiUxixhCYwhN9b/WW6Xr1ErMIobQGEJjCI0hNIbQGEJjCI0haiRmEUNoDKExhMYQmjMAAP//B2kXcP2uDV8AAAAASUVORK5CYII="
2020-06-17 20:17:38 +00:00
property string pubkey: "0x04d8c07dd137bd1b73a6f51df148b4f77ddaa11209d36e43d8344c0a7d6db1cad6085f27cfb75dd3ae21d86ceffebe4cf8a35b9ce8d26baa19dc264efe6d8f221b"
2020-05-27 21:28:25 +00:00
id: profileHeaderContent
height: parent.height
2020-05-27 20:57:36 +00:00
Layout.fillWidth: true
color: Style.current.transparent
2020-05-27 20:57:36 +00:00
2020-05-27 21:28:25 +00:00
Item {
id: profileImgNameContainer
width: profileHeaderContent.width
height: profileHeaderContent.height
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
2020-05-27 20:57:36 +00:00
2020-05-27 21:28:25 +00:00
Image {
id: profileImg
2020-06-17 19:59:10 +00:00
source: identicon
2020-05-27 21:28:25 +00:00
width: 80
height: 80
fillMode: Image.PreserveAspectCrop
2020-05-27 20:57:36 +00:00
anchors.horizontalCenter: parent.horizontalCenter
2020-06-23 17:54:16 +00:00
mipmap: true
smooth: false
antialiasing: true
2020-05-27 21:28:25 +00:00
property bool rounded: true
property bool adapt: false
y: 78
2020-05-27 20:57:36 +00:00
2020-05-27 21:28:25 +00:00
layer.enabled: rounded
layer.effect: OpacityMask {
maskSource: Item {
width: profileImg.width
height: profileImg.height
Rectangle {
anchors.centerIn: parent
width: profileImg.adapt ? profileImg.width : Math.min(profileImg.width, profileImg.height)
height: profileImg.adapt ? profileImg.height : width
radius: Math.min(width, height)
2020-05-27 20:57:36 +00:00
}
}
}
2020-05-27 21:28:25 +00:00
}
2020-05-27 20:57:36 +00:00
StyledText {
2020-05-27 21:28:25 +00:00
id: profileName
2020-06-17 19:59:10 +00:00
text: username
2020-05-27 21:28:25 +00:00
anchors.top: profileImg.bottom
anchors.topMargin: 10
anchors.horizontalCenterOffset: 0
anchors.horizontalCenter: parent.horizontalCenter
font.weight: Font.Medium
font.pixelSize: 20
2020-05-27 20:57:36 +00:00
}
StyledText {
2020-06-17 20:17:38 +00:00
id: pubkeyText
text: pubkey
font.family: Style.current.fontHexRegular.name
2020-06-17 20:17:38 +00:00
width: 208
elide: Text.ElideMiddle
anchors.top: profileName.bottom
anchors.topMargin: 10
anchors.horizontalCenterOffset: 0
anchors.horizontalCenter: parent.horizontalCenter
font.weight: Font.Medium
font.pixelSize: 20
}
2020-05-27 20:57:36 +00:00
}
}