From 74e0af62a7f20f67a9cddc582bb28a1d31f9654e Mon Sep 17 00:00:00 2001 From: Nate Graham Date: Wed, 1 Sep 2021 09:45:03 -0600 Subject: [PATCH] kcms/users: improve UI for the case where no real name is set Currently the title of the list item is blank, leaving an awkward subtitle with nothing above it. This commit improves that to use the username as the title and avoid setting the subtitle at all, in the case where the user has not provided their real name. BUG: 441821 FIXED-IN: 5.23 --- kcms/users/package/contents/ui/main.qml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kcms/users/package/contents/ui/main.qml b/kcms/users/package/contents/ui/main.qml index 8f0e8f337..947dd2edb 100644 --- a/kcms/users/package/contents/ui/main.qml +++ b/kcms/users/package/contents/ui/main.qml @@ -56,8 +56,9 @@ KCM.ScrollViewKCM { } delegate: Kirigami.BasicListItem { - text: model.display - subtitle: model.name + text: model.display ? model.display : model.name + subtitle: model.display ? model.name : "" + reserveSpaceForSubtitle: true highlighted: index == userList.currentIndex @@ -80,7 +81,7 @@ KCM.ScrollViewKCM { Kirigami.Avatar { source: model.decoration + '?' + avatarVersion // force reload after saving cache: false // avoid caching - name: model.display + name: model.display ? model.display : model.name anchors { fill: parent margins: 1