Commit 51cab794 authored by Derek Christ's avatar Derek Christ Committed by Nate Graham
Browse files

Port lockscreen & sddm theme password fields to PlasmaExtras.PasswordField

CCBUG: 453828
parent a5165fb6
Pipeline #186026 passed with stage
in 14 minutes and 43 seconds
......@@ -67,7 +67,7 @@ PlasmaCore.ColorScope {
function onPrompt(msg) {
root.notification = msg;
mainBlock.echoMode = TextInput.Normal
mainBlock.showPassword = true;
if (lockScreenUi.hadPrompt) {
mainBlock.mainPasswordBox.text = "";
}
......@@ -75,7 +75,7 @@ PlasmaCore.ColorScope {
lockScreenUi.hadPrompt = true;
}
function onPromptForSecret(msg) {
mainBlock.echoMode = TextInput.Password
mainBlock.showPassword = false;
if (lockScreenUi.hadPrompt) {
mainBlock.mainPasswordBox.text = "";
}
......
......@@ -11,6 +11,7 @@ import QtQuick.Controls 1.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.plasma.extras 2.0 as PlasmaExtras
import "../components"
......@@ -18,7 +19,7 @@ SessionManagementScreen {
property Item mainPasswordBox: passwordBox
property bool lockScreenUiVisible: false
property alias echoMode: passwordBox.echoMode
property alias showPassword: passwordBox.showPassword
//the y position that should be ensured visible when the on screen keyboard is visible
property int visibleBoundary: mapFromItem(loginButton, 0, 0).y
......@@ -53,17 +54,14 @@ SessionManagementScreen {
RowLayout {
Layout.fillWidth: true
PlasmaComponents3.TextField {
PlasmaExtras.PasswordField {
id: passwordBox
font.pointSize: PlasmaCore.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
// In Qt this is implicitly active based on focus rather than visibility
// in any other application having a focussed invisible object would be weird
......
......@@ -5,6 +5,7 @@ import QtQuick.Layouts 1.15
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.plasma.extras 2.0 as PlasmaExtras
SessionManagementScreen {
id: root
......@@ -83,15 +84,16 @@ SessionManagementScreen {
RowLayout {
Layout.fillWidth: true
PlasmaComponents3.TextField {
PlasmaExtras.PasswordField {
id: passwordBox
font.pointSize: fontSize + 1
Layout.fillWidth: true
placeholderText: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Password")
focus: !showUsernamePrompt || lastUserName
echoMode: TextInput.Password
revealPasswordButtonShown: false // Disabled whilst SDDM does not have the breeze icon set loaded
// Disable reveal password action because SDDM does not have the breeze icon set loaded
rightActions: []
onAccepted: {
if (root.loginScreenUiVisible) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment