From ec1ed80c9ffa85d1e5967cd09c76ea59cd1ea991 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 16 Jun 2020 09:17:58 +0200 Subject: [PATCH] Add initials when no avatar is set CURA-7418 --- resources/qml/Account/UserOperations.qml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/resources/qml/Account/UserOperations.qml b/resources/qml/Account/UserOperations.qml index e897e97d2e..68bac07ec1 100644 --- a/resources/qml/Account/UserOperations.qml +++ b/resources/qml/Account/UserOperations.qml @@ -31,6 +31,25 @@ Column source: profile["profile_image_url"] ? profile["profile_image_url"] : "" 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 { anchors.left: avatar.right