Skip to content

sddm-theme: Un-break userSelected signal handling

ivan tkachenko requested to merge work/ratijas/pikachu-im-selecting-you into master

Summary

This patch set improves handling of focus and interaction of login controls, and also refactors button's states into QML State. No visual changes. No behavioral regressions to be expected. Tested with screen locker as well as with system-wide installation of Breeze SDDM theme. Totally works for me.

Un-break userSelected signal handling

It was lost during refactoring some time ago, but the intention was to give focus to the next item in focus chain assuming that's either a username or a password field.

This patch is a less flexible but also less messy and more direct way to achieve practically the same thing. Additionally, explicit Tab focus reason gives a loginButton a nice visual focus which one would expect to see instead of no visual changes. It was tempting to directly call startLogin when password is not required, but that would be surprising when the signal itself is triggered by the Escape key.

CCBUG: 336368

Make login button react to Enter and Return keys

Because why not; and also because it makes for a nice flow when user does not have a password set: just press Enter (twice, if focused on a user list).

Factor out state of login button

UPDATE: this commit was removed

Use built-in State to manage property changes instead of a bunch of interleaved spaghetti expressions. The when condition is bound indirectly to passwordBox, but that actually makes sense because the button's appearance IS entirely based on passwordBox's visibility, which is also reflected in its height Layout.preferredHeight binding.

TODO

The buttons on SDDM login screen and in Plasma lock screen are slightly different, but this commit makes them once again look more similar code-wise. The SDDM one supports passwordless users, but lock screen doesn't. Temporary I'm trying to figure out how to make passwordless user (users KCM is still broken for me somehow), so I don't know how screen locker handles "no password" scenario. But we probably should unite the code anyway. Thoughts?

CC/Review? @fvogt @cblack @nicolasfella

Edited by ivan tkachenko

Merge request reports