Add initials when no avatar is set

CURA-7418
This commit is contained in:
Jaime van Kessel 2020-06-16 09:17:58 +02:00
parent c58ef1b531
commit ec1ed80c9f
No known key found for this signature in database
GPG key ID: 3710727397403C91

View file

@ -31,6 +31,25 @@ Column
source: profile["profile_image_url"] ? profile["profile_image_url"] : "" source: profile["profile_image_url"] ? profile["profile_image_url"] : ""
outlineColor: "transparent" outlineColor: "transparent"
} }
Rectangle
{
id: initialCircle
width: avatar.width
height: avatar.height
radius: width
color: UM.Theme.getColor("action_button_disabled")
Label
{
id: initialLabel
anchors.centerIn: parent
text: profile["username"].charAt(0).toUpperCase()
font: UM.Theme.getFont("large_bold")
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
renderType: Text.NativeRendering
}
}
Column Column
{ {
anchors.left: avatar.right anchors.left: avatar.right