File 0001-Use-Kirigami.Avatar-in-Kickoff-Header-bar.patch of Package plasma5-desktop

From 5a62f822d145485aba88cbcd4a19c5d4d7596c16 Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fabian@ritter-vogt.de>
Date: Wed, 22 Sep 2021 09:35:36 +0200
Subject: [PATCH] Use Kirigami.Avatar in Kickoff Header bar

Replace the custom code with Kirigami's implementation for consistency.

BUG: 442776


(cherry picked from commit 322854d2e87fe3a69cce8d311593902ac5cfbc7a)
---
 .../kickoff/package/contents/ui/Header.qml    | 49 ++-----------------
 1 file changed, 3 insertions(+), 46 deletions(-)

diff --git a/applets/kickoff/package/contents/ui/Header.qml b/applets/kickoff/package/contents/ui/Header.qml
index cc4a258c4..363390e29 100644
--- a/applets/kickoff/package/contents/ui/Header.qml
+++ b/applets/kickoff/package/contents/ui/Header.qml
@@ -65,39 +65,9 @@ PlasmaExtras.PlasmoidHeading {
             rightPadding: PlasmaCore.Units.devicePixelRatio
             topPadding: PlasmaCore.Units.devicePixelRatio
             bottomPadding: PlasmaCore.Units.devicePixelRatio
-            contentItem: Loader {
-                sourceComponent: kuser.faceIconUrl ? imageComponent : icon
-                Component {
-                    id: imageComponent
-                    Image {
-                        id: imageItem
-                        anchors.fill: avatar.contentItem
-                        source: kuser.faceIconUrl
-                        smooth: true
-                        sourceSize.width: avatar.contentItem.width
-                        sourceSize.height: avatar.contentItem.height
-                        fillMode: Image.PreserveAspectCrop
-                    }
-                }
-                Component {
-                    id: iconComponent
-                    PlasmaCore.IconItem {
-                        id: iconItem
-                        anchors.fill: avatar.contentItem
-                        source: "user"
-                    }
-                }
-                layer.enabled: kuser.faceIconUrl
-                layer.effect: OpacityMask {
-                    anchors.fill: avatar.contentItem
-                    source: avatar.contentItem
-                    maskSource: Rectangle {
-                        visible: false
-                        radius: height/2
-                        width: avatar.contentItem.width
-                        height: avatar.contentItem.height
-                    }
-                }
+            contentItem: Kirigami.Avatar {
+                source: kuser.faceIconUrl
+                name: kuser.fullName
             }
             Rectangle {
                 parent: avatar.background
@@ -109,19 +79,6 @@ PlasmaExtras.PlasmoidHeading {
                 border.width: avatar.visualFocus ? PlasmaCore.Units.devicePixelRatio * 2 : 0
                 border.color: PlasmaCore.Theme.buttonFocusColor
             }
-            // Only used to keep the exact circular shape consistent with the image.
-            // Without this, it looks significantly worse.
-            background.layer.enabled: kuser.faceIconUrl
-            background.layer.effect: OpacityMask {
-                anchors.fill: avatar.background
-                source: avatar.background
-                maskSource: Rectangle {
-                    visible: false
-                    radius: height/2
-                    width: avatar.background.width
-                    height: avatar.background.height
-                }
-            }
             HoverHandler {
                 id: hoverHandler
                 cursorShape: Qt.PointingHandCursor
-- 
2.33.0

openSUSE Build Service is sponsored by