Skip to content

Draft: SDDM Theme/Lock Screen/Logout Screen component modernization

Noah Davis requested to merge work/ndavis/login-logout-improvements2 into master

Modernize UserDelegate

It is now an ItemDelegate subclass with automatic accessibility info

We use implicit size now, so no need to set size externally in order to see everything.

We use Kirigami icon sizes and spacings now.

For naming clarity: name -> displayName, iconSource -> iconName

Opacity animation duration was changed to veryLongDuration to sync with other animations that usually play at the same time.

All the icon/avatar things that were previously done with an Image and Kirigami Icon could actually be done with just the Kirigami Icon. We use one Kirigami Icon for avatars and icons now.

font size is now automatically scaled with the icon size. The original intention for the font size was to make the font bigger to go with the icon size visually.

Logout: use Pane so that controls can inherit fonts

Simplify WallpaperFader

We don't need to plug in a set group of items, we can just expose the UI opacity that should be applied and bind to that.

For some reason, the opacity animation duration wasn't the same as the factor animation duration. I made them the same so that they'd move in sync.

Simplify VirtualKeyboardLoader

Having automatically managed behavior for items in different files and different repos makes the code harder to follow. Bind to VirtualKeyboardLoader::y to move items out of the way.

Update UserList.qml

Modernize UserList

We use implicit delegate size to set the view's size so that it always conforms to the size of its content by default.

Sets preferredHighlightBegin/preferredHighlightEnd correctly. The existing code didn't seem to actually cause bugs, but docs say the beginning and end should be where the item you want to highlight begins and ends.

Set highlight animation durations to Kirigami durations. These affect the speed at which the view moves when changing the index.

Added selectedUserNeedsPassword so that the screen locker wouldn't have to access the current item directly.

Inherit font data instead of having a fontSize property.

Set accessible role to List.

Minor code modernizations like using ?. and ?? operators.

Modernize Clock

Previously, you had to add a shadow property to this component holding the clock's shadow in order for the wallpaper fader to work right. The clock and clock shadow both had to be managed by the wallpaper fader. Now you can just bind the wallpaper fader's uiOpacity to this component's uiOpacity and you get the same effect with less deeply nested behaviors.

Also, we use MultiEffect instead of the Qt5 compatibility DropShadow. The appearance is not exactly the same, but it looks fine.

Battery: inherit font instead of setting an explicit size

fontSize was changed to a font alias in case someone still needs to access the font of the label inside.

Add ActivityDetectorItem

This is an item that detects input activity from users.

You need to put this very high in the stacking order for it to work right. You also need to forward key events to this in order to detect keyboard activity.

Add LoginForm

This component provides all the controls you would typically need to login with all the behaviors shared between the SDDM theme and lock screen.

This way we don't have to keep so much code in sync between the SDDM theme and the lock screen.

Refactor SessionManagementScreen

This now has a lot more of the content and behavior that was shared between the SDDM theme and the lock screen.

  • Virtual keyboard boundary and login form control properties that were once duplicated by the SDDM theme and lock screen are declared here.
  • You can use waitingForResponse to determine whether we are waiting for a response after requesting to login.
  • The bounce animation used to have to be manually started by external components, now it's started automatically based on the original intended behavior from the lock screen. It will play when you call setNotificationMessage() with the same text as what it already has.
  • Font data is now inherited, so we don't have to bind all the fontSizes together to propagate font size.
  • CapsLock detection was moved here because it's only ever used here, but was previously set up externally in a duplicated manner.
  • Common behaviors for the login form controls were moved here.
  • Requesting to login is now done with requestLogin(), which first does some common behaviors and then uses a callback for login system specific behaviors.

We still didn't put everything into one layout like the old FIXME comment said, but that's fine because the UserList position is managed by Page as a header.

Merge request reports