sddm-theme: focus password field after changing session or kbd layout

We already force focus to the password field after showing or hiding the
virtual keyboard, since otherwise it's annoying and you have to manually
re-focus it. Let's do the same for the session and keyboard layout
choosers to save the user a click and some annoyance.

BUG: 451361
FIXED-IN: 5.25
wilder-5.25
Nate Graham 4 years ago
parent a8006e8b0b
commit 157e97578f
  1. 3
      sddm-theme/KeyboardButton.qml
  2. 12
      sddm-theme/Main.qml
  3. 3
      sddm-theme/SessionButton.qml

@ -32,6 +32,8 @@ PlasmaComponents.ToolButton {
}
}
signal keyboardLayoutChanged
PlasmaComponents.Menu {
id: menu
PlasmaCore.ColorScope.colorGroup: PlasmaCore.Theme.NormalColorGroup
@ -47,6 +49,7 @@ PlasmaComponents.ToolButton {
property string shortName: modelData.shortName
onTriggered: {
keyboard.currentLayout = model.index
keyboardLayoutChanged()
}
}
}

@ -557,11 +557,23 @@ PlasmaCore.ColorScope {
KeyboardButton {
font.pointSize: config.fontSize
keyboardLayoutChanged: {
// Otherwise the password field loses focus and virtual keyboard
// keystrokes get eaten
userListComponent.mainPasswordBox.forceActiveFocus();
}
}
SessionButton {
id: sessionButton
font.pointSize: config.fontSize
onSessionChanged: {
// Otherwise the password field loses focus and virtual keyboard
// keystrokes get eaten
userListComponent.mainPasswordBox.forceActiveFocus();
}
}
Item {

@ -29,6 +29,8 @@ PlasmaComponents.ToolButton {
}
}
signal sessionChanged
PlasmaComponents.Menu {
PlasmaCore.ColorScope.colorGroup: PlasmaCore.Theme.NormalColorGroup
PlasmaCore.ColorScope.inherit: false
@ -43,6 +45,7 @@ PlasmaComponents.ToolButton {
text: model.name
onTriggered: {
root.currentIndex = model.index
sessionChanged()
}
}
}

Loading…
Cancel
Save