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

60 lines
2.0 KiB
QML
Raw Normal View History

2020-05-27 20:57:36 +00:00
import QtGraphicalEffects 1.12
import QtQuick 2.0
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.3
import "../../../../imports"
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-05-27 21:28:25 +00:00
id: profileHeaderContent
height: parent.height
2020-05-27 20:57:36 +00:00
Layout.fillWidth: true
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-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
2020-05-27 21:28:25 +00:00
Text {
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
}
}
}