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

58 lines
1.7 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 {
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
source: profileModel.profile.identicon
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
text: profileModel.profile.username
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
}
}
}