diff --git a/lookandfeel/contents/lockscreen/MainBlock.qml b/lookandfeel/contents/lockscreen/MainBlock.qml --- a/lookandfeel/contents/lockscreen/MainBlock.qml +++ b/lookandfeel/contents/lockscreen/MainBlock.qml @@ -51,52 +51,60 @@ loginRequest(password); } - PlasmaComponents.TextField { - id: passwordBox - font.pointSize: theme.defaultFont.pointSize + 1 + RowLayout { Layout.fillWidth: true - placeholderText: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Password") - focus: true - echoMode: TextInput.Password - inputMethodHints: Qt.ImhHiddenText | Qt.ImhSensitiveData | Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText - enabled: !authenticator.graceLocked - revealPasswordButtonShown: true - - onAccepted: { - if (lockScreenUiVisible) { - startLogin(); + PlasmaComponents.TextField { + id: passwordBox + font.pointSize: theme.defaultFont.pointSize + 1 + Layout.fillWidth: true + + placeholderText: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Password") + focus: true + echoMode: TextInput.Password + inputMethodHints: Qt.ImhHiddenText | Qt.ImhSensitiveData | Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText + enabled: !authenticator.graceLocked + revealPasswordButtonShown: true + + onAccepted: { + if (lockScreenUiVisible) { + startLogin(); + } } - } - //if empty and left or right is pressed change selection in user switch - //this cannot be in keys.onLeftPressed as then it doesn't reach the password box - Keys.onPressed: { - if (event.key == Qt.Key_Left && !text) { - userList.decrementCurrentIndex(); - event.accepted = true + //if empty and left or right is pressed change selection in user switch + //this cannot be in keys.onLeftPressed as then it doesn't reach the password box + Keys.onPressed: { + if (event.key == Qt.Key_Left && !text) { + userList.decrementCurrentIndex(); + event.accepted = true + } + if (event.key == Qt.Key_Right && !text) { + userList.incrementCurrentIndex(); + event.accepted = true + } } - if (event.key == Qt.Key_Right && !text) { - userList.incrementCurrentIndex(); - event.accepted = true - } - } - Connections { - target: root - onClearPassword: { - passwordBox.forceActiveFocus() - passwordBox.selectAll() + Connections { + target: root + onClearPassword: { + passwordBox.forceActiveFocus() + passwordBox.selectAll() + } } } - } - - PlasmaComponents.Button { - id: loginButton - font.pointSize: theme.defaultFont.pointSize + 1 - Layout.fillWidth: true - text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Unlock") - onClicked: startLogin() + PlasmaComponents.Button { + id: loginButton + Accessible.name: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Unlock") + implicitHeight: passwordBox.height - units.smallSpacing * 0.5 // otherwise it comes out taller than the password field + + PlasmaCore.IconItem { // no iconSource because if you take away half a unit (implicitHeight), "go-next" gets cut off + anchors.fill: parent + anchors.margins: units.smallSpacing + source: "go-next" + } + onClicked: startLogin() + } } } diff --git a/sddm-theme/Login.qml b/sddm-theme/Login.qml --- a/sddm-theme/Login.qml +++ b/sddm-theme/Login.qml @@ -58,54 +58,63 @@ } } - PlasmaComponents.TextField { - id: passwordBox - font.pointSize: theme.defaultFont.pointSize + 1 + RowLayout { Layout.fillWidth: true - placeholderText: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Password") - focus: !showUsernamePrompt || lastUserName - echoMode: TextInput.Password - revealPasswordButtonShown: true + PlasmaComponents.TextField { + id: passwordBox + font.pointSize: theme.defaultFont.pointSize + 1 + Layout.fillWidth: true - onAccepted: { - if (root.loginScreenUiVisible) { - startLogin(); + placeholderText: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Password") + focus: !showUsernamePrompt || lastUserName + echoMode: TextInput.Password + revealPasswordButtonShown: true + + onAccepted: { + if (root.loginScreenUiVisible) { + startLogin(); + } } - } - Keys.onEscapePressed: { - mainStack.currentItem.forceActiveFocus(); - } + Keys.onEscapePressed: { + mainStack.currentItem.forceActiveFocus(); + } - //if empty and left or right is pressed change selection in user switch - //this cannot be in keys.onLeftPressed as then it doesn't reach the password box - Keys.onPressed: { - if (event.key == Qt.Key_Left && !text) { - userList.decrementCurrentIndex(); - event.accepted = true + //if empty and left or right is pressed change selection in user switch + //this cannot be in keys.onLeftPressed as then it doesn't reach the password box + Keys.onPressed: { + if (event.key == Qt.Key_Left && !text) { + userList.decrementCurrentIndex(); + event.accepted = true + } + if (event.key == Qt.Key_Right && !text) { + userList.incrementCurrentIndex(); + event.accepted = true + } } - if (event.key == Qt.Key_Right && !text) { - userList.incrementCurrentIndex(); - event.accepted = true + + Connections { + target: sddm + onLoginFailed: { + passwordBox.selectAll() + passwordBox.forceActiveFocus() + } } } - Connections { - target: sddm - onLoginFailed: { - passwordBox.selectAll() - passwordBox.forceActiveFocus() + PlasmaComponents.Button { + id: loginButton + Accessible.name: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Log In") + implicitHeight: passwordBox.height - units.smallSpacing * 0.5 // otherwise it comes out taller than the password field + Layout.rightMargin: 1 // prevents it from extending beyond the username field + + PlasmaCore.IconItem { // no iconSource because if you take away half a unit (implicitHeight), "go-next" gets cut off + anchors.fill: parent + anchors.margins: units.smallSpacing + source: "go-next" } + onClicked: startLogin(); } } - PlasmaComponents.Button { - id: loginButton - font.pointSize: theme.defaultFont.pointSize + 1 - Layout.fillWidth: true - - text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Log In") - onClicked: startLogin(); - } - }