diff --git a/lookandfeel/contents/components/SessionManagementScreen.qml b/lookandfeel/contents/components/SessionManagementScreen.qml --- a/lookandfeel/contents/components/SessionManagementScreen.qml +++ b/lookandfeel/contents/components/SessionManagementScreen.qml @@ -57,14 +57,16 @@ */ property alias userListCurrentIndex: userListView.currentIndex property var userListCurrentModelData: userListView.currentItem === null ? [] : userListView.currentItem.m + property bool showUserList: true property alias userList: userListView default property alias _children: innerLayout.children UserList { id: userListView + visible: showUserList anchors { bottom: parent.verticalCenter left: parent.left diff --git a/sddm-theme/Login.qml b/sddm-theme/Login.qml --- a/sddm-theme/Login.qml +++ b/sddm-theme/Login.qml @@ -8,7 +8,7 @@ SessionManagementScreen { - property bool showUsernamePrompt: false + property bool showUsernamePrompt: !showUserList signal loginRequest(string username, string password) diff --git a/sddm-theme/Main.qml b/sddm-theme/Main.qml --- a/sddm-theme/Main.qml +++ b/sddm-theme/Main.qml @@ -81,8 +81,10 @@ } initialItem: Login { + id: userListComponent userListModel: userModel userListCurrentIndex: userModel.lastIndex >= 0 ? userModel.lastIndex : 0 + showUserList: (userListModel.count && userListModel.disableAvatarsThreshold) ? userListModel.count <= userListModel.disableAvatarsThreshold : true notificationMessage: root.notificationMessage @@ -108,8 +110,9 @@ ActionButton { iconSource: "system-search" text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Different User") - onClicked: mainStack.push(userPrompt) + onClicked: mainStack.push(userPromptComponent) enabled: true + visible: !userListComponent.showUsernamePrompt } ] @@ -128,7 +131,7 @@ } Component { - id: userPrompt + id: userPromptComponent Login { showUsernamePrompt: true notificationMessage: root.notificationMessage