From e58d3865df877f9c8c01fdf03ef5f4d615f277e6 Mon Sep 17 00:00:00 2001 From: Eugene Popov Date: Tue, 19 Apr 2022 16:21:28 +0000 Subject: [PATCH] Slightly improve the layout of the login/logout/lock screens Currently on the login/logout/lock screens, there is almost no spacing between the avatar and username, which makes the user' delegate looks too tight.This MR fixes this issue. --- lookandfeel/contents/components/UserDelegate.qml | 5 ++--- lookandfeel/contents/components/UserList.qml | 2 +- lookandfeel/contents/logout/Logout.qml | 4 +++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lookandfeel/contents/components/UserDelegate.qml b/lookandfeel/contents/components/UserDelegate.qml index cc8d6a376..90bdfdc28 100644 --- a/lookandfeel/contents/components/UserDelegate.qml +++ b/lookandfeel/contents/components/UserDelegate.qml @@ -33,8 +33,6 @@ Item { property real faceSize: PlasmaCore.Units.gridUnit * 7 - implicitHeight: imageSource.height + usernameDelegate.height - implicitWidth: Math.max(imageSource.width, usernameDelegate.width) opacity: isCurrent ? 1.0 : 0.5 Behavior on opacity { @@ -150,12 +148,13 @@ Item { id: usernameDelegate anchors.top: imageSource.bottom + anchors.topMargin: PlasmaCore.Units.gridUnit anchors.horizontalCenter: parent.horizontalCenter // Make it bigger than other fonts to match the scale of the avatar better font.pointSize: wrapper.fontSize + 4 - width: constrainText ? imageSource.width : implicitWidth + width: constrainText ? parent.width : implicitWidth text: wrapper.name style: softwareRendering ? Text.Outline : Text.Normal styleColor: softwareRendering ? PlasmaCore.ColorScope.backgroundColor : "transparent" //no outline, doesn't matter diff --git a/lookandfeel/contents/components/UserList.qml b/lookandfeel/contents/components/UserList.qml index a9719b81c..becc65101 100644 --- a/lookandfeel/contents/components/UserList.qml +++ b/lookandfeel/contents/components/UserList.qml @@ -12,7 +12,7 @@ ListView { id: view readonly property string selectedUser: currentItem ? currentItem.userName : "" readonly property int userItemWidth: PlasmaCore.Units.gridUnit * 8 - readonly property int userItemHeight: PlasmaCore.Units.gridUnit * 8 + readonly property int userItemHeight: PlasmaCore.Units.gridUnit * 9 readonly property bool constrainText: count > 1 property int fontSize: PlasmaCore.Theme.defaultFont.pointSize + 2 diff --git a/lookandfeel/contents/logout/Logout.qml b/lookandfeel/contents/logout/Logout.qml index e5a036745..edb4c31f6 100644 --- a/lookandfeel/contents/logout/Logout.qml +++ b/lookandfeel/contents/logout/Logout.qml @@ -40,7 +40,7 @@ PlasmaCore.ColorScope { function hibernateRequested() { root.suspendRequested(4); } - + property real timeout: 30 property real remainingTime: root.timeout property var currentAction: { @@ -104,6 +104,8 @@ PlasmaCore.ColorScope { onClicked: root.cancelRequested() } UserDelegate { + width: PlasmaCore.Units.gridUnit * 8 + height: PlasmaCore.Units.gridUnit * 9 anchors { horizontalCenter: parent.horizontalCenter bottom: parent.verticalCenter