summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Edmundson <[email protected]>2019-01-07 10:41:29 +0000
committerDavid Edmundson <[email protected]>2019-01-07 10:42:04 +0000
commite4212f1800be05ae3d4153d491db38a41cf1cf38 (patch)
treeee054dda784fe2cee824eac8ffe52e203ba29fde
parentce5f209bd7ea7dedbfe137264e73de4e5a632c67 (diff)
[sddm-theme] Don't handle enter key when blurred
Summary: Meaning pressing enter just wakes up the display. Behaviour now matches lock screen. BUG: 402957 Test Plan: Ran SDDM Reviewers: #plasma, ngraham Reviewed By: ngraham Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D17997
-rw-r--r--sddm-theme/Login.qml14
-rw-r--r--sddm-theme/Main.qml2
2 files changed, 13 insertions, 3 deletions
diff --git a/sddm-theme/Login.qml b/sddm-theme/Login.qml
index 0eb3bdb..cebf10e 100644
--- a/sddm-theme/Login.qml
+++ b/sddm-theme/Login.qml
@@ -7,12 +7,13 @@ import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
SessionManagementScreen {
-
+ id: root
property Item mainPasswordBox: passwordBox
property bool showUsernamePrompt: !showUserList
property string lastUserName
+ property bool loginScreenUiVisible: false
//the y position that should be ensured visible when the on screen keyboard is visible
property int visibleBoundary: mapFromItem(loginButton, 0, 0).y
@@ -50,7 +51,10 @@ SessionManagementScreen {
focus: showUsernamePrompt && !lastUserName //if there's a username prompt it gets focus first, otherwise password does
placeholderText: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Username")
- onAccepted: passwordBox.forceActiveFocus()
+ onAccepted:
+ if (root.loginScreenUiVisible) {
+ passwordBox.forceActiveFocus()
+ }
}
PlasmaComponents.TextField {
@@ -62,7 +66,11 @@ SessionManagementScreen {
echoMode: TextInput.Password
revealPasswordButtonShown: true
- onAccepted: startLogin()
+ onAccepted: {
+ if (root.loginScreenUiVisible) {
+ startLogin();
+ }
+ }
Keys.onEscapePressed: {
mainStack.currentItem.forceActiveFocus();
diff --git a/sddm-theme/Main.qml b/sddm-theme/Main.qml
index b61b6e9..6738d22 100644
--- a/sddm-theme/Main.qml
+++ b/sddm-theme/Main.qml
@@ -147,6 +147,7 @@ PlasmaCore.ColorScope {
initialItem: Login {
id: userListComponent
userListModel: userModel
+ loginScreenUiVisible: loginScreenRoot.uiVisible
userListCurrentIndex: userModel.lastIndex >= 0 ? userModel.lastIndex : 0
lastUserName: userModel.lastUser
showUserList: {
@@ -332,6 +333,7 @@ PlasmaCore.ColorScope {
Login {
showUsernamePrompt: true
notificationMessage: root.notificationMessage
+ loginScreenUiVisible: loginScreenRoot.uiVisible
userListModel: QtObject {
property string name: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Log in as a different user")