Add an explicit unlock button for passwordless users

In the refactor we correctly made it so passwordless users were not
prompted for passwords.

This is in the right direction but the UX was still slightly off as it
meant wiggling the mouse unlocked the screen, not an explicit action.

This patch adds an explicit button that must be pressed if no other
prompts were given during the authentication process.

BUG: 440055
wilder-5.25
David Edmundson 4 years ago
parent cdf64cb660
commit dc6341bb30
  1. 11
      lookandfeel/contents/lockscreen/LockScreenUi.qml
  2. 23
      lookandfeel/contents/lockscreen/NoPasswordUnlock.qml

@ -24,6 +24,7 @@ PlasmaCore.ColorScope {
// If we're using software rendering, draw outlines instead of shadows
// See https://bugs.kde.org/show_bug.cgi?id=398317
readonly property bool softwareRendering: GraphicsInfo.api === GraphicsInfo.Software
property bool hadPrompt: false;
colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
@ -40,7 +41,13 @@ PlasmaCore.ColorScope {
}
function onSucceeded() {
Qt.quit();
if (lockScreenUi.hadPrompt) {
Qt.quit();
} else {
mainStack.push(Qt.resolvedUrl("NoPasswordUnlock.qml"),
{"userListModel": users});
mainStack.forceActiveFocus();
}
}
function onInfoMessage(msg) {
@ -58,12 +65,14 @@ PlasmaCore.ColorScope {
}
function onPrompt(msg) {
lockScreenUi.hadPrompt = true;
root.notification = msg;
mainBlock.echoMode = TextInput.Normal
mainBlock.mainPasswordBox.text = "";
mainBlock.mainPasswordBox.forceActiveFocus();
}
function onPromptForSecret(msg) {
lockScreenUi.hadPrompt = true;
mainBlock.echoMode = TextInput.Password
mainBlock.mainPasswordBox.text = "";
mainBlock.mainPasswordBox.forceActiveFocus();

@ -0,0 +1,23 @@
/*
SPDX-FileCopyrightText: 2022 David Edmundson <davidedmundson@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
import QtQuick 2.2
import org.kde.plasma.components 3.0 as PlasmaComponents3
import "../components"
SessionManagementScreen {
focus: true
PlasmaComponents3.Button {
id: loginButton
focus: true
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Unlock")
icon.name: LayoutMirroring.enabled ? "go-previous" : "go-next"
onClicked: Qt.quit();
Keys.onEnterPressed: clicked()
Keys.onReturnPressed: clicked()
}
}
Loading…
Cancel
Save