commit 36bada6831820c8c32adc4201ecc48e9c8bb5850 Author: Oleg Solovyov Date: Wed Aug 24 11:04:48 2022 +0300 Show textfield with help to unlock session Don't show UI when mouse is moved --- a/plasma-workspace/lookandfeel/org.kde.breeze/contents/lockscreen/MainBlock.qml +++ b/plasma-workspace/lookandfeel/org.kde.breeze/contents/lockscreen/MainBlock.qml @@ -61,6 +61,7 @@ SessionManagementScreen { placeholderText: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Password") focus: true enabled: !authenticator.graceLocked + visible: false // In Qt this is implicitly active based on focus rather than visibility // in any other application having a focussed invisible object would be weird @@ -101,6 +102,7 @@ SessionManagementScreen { Accessible.name: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Unlock") Layout.preferredHeight: passwordBox.implicitHeight Layout.preferredWidth: loginButton.Layout.preferredHeight + visible: passwordBox.visible icon.name: LayoutMirroring.enabled ? "go-previous" : "go-next" --- a/plasma-workspace/lookandfeel/org.kde.breeze/contents/lockscreen/LockScreenUi.qml +++ b/plasma-workspace/lookandfeel/org.kde.breeze/contents/lockscreen/LockScreenUi.qml @@ -38,20 +38,16 @@ PlasmaCore.ColorScope { graceLockTimer.restart(); notificationRemoveTimer.restart(); rejectPasswordAnimation.start(); + mainBlock.mainPasswordBox.visible = false; lockScreenUi.hadPrompt = false; } function onSucceeded() { - if (lockScreenUi.hadPrompt) { - Qt.quit(); - } else { - mainStack.push(Qt.resolvedUrl("NoPasswordUnlock.qml"), - {"userListModel": users}); - mainStack.forceActiveFocus(); - } + Qt.quit(); } function onInfoMessage(msg) { + fadeoutTimer.restart(); if (root.notification) { root.notification += "\n" } @@ -59,21 +55,22 @@ PlasmaCore.ColorScope { } function onErrorMessage(msg) { - if (root.notification) { - root.notification += "\n" - } - root.notification += msg; + rejectPasswordAnimation.start(); + fadeoutTimer.restart(); + root.notification = msg; } function onPrompt(msg) { root.notification = msg; mainBlock.showPassword = true; mainBlock.mainPasswordBox.forceActiveFocus(); + mainBlock.mainPasswordBox.visible = true; lockScreenUi.hadPrompt = true; } function onPromptForSecret(msg) { mainBlock.showPassword = false; mainBlock.mainPasswordBox.forceActiveFocus(); + mainBlock.mainPasswordBox.visible = true; lockScreenUi.hadPrompt = true; } } @@ -126,7 +123,6 @@ PlasmaCore.ColorScope { hoverEnabled: true drag.filterChildren: true onPressed: uiVisible = true; - onPositionChanged: uiVisible = true; onUiVisibleChanged: { if (blockUI) { fadeoutTimer.running = false; @@ -262,6 +258,17 @@ PlasmaCore.ColorScope { } } + PlasmaComponents3.Label { + id: clickMessageLabel + text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Click mouse or press any key to unlock") + visible: !lockScreenRoot.uiVisible + font.pointSize: PlasmaCore.Theme.defaultFont.pointSize + 2 + anchors.horizontalCenter: parent.horizontalCenter + y: clock.y + clock.height + (PlasmaCore.Theme.defaultFont.pointSize + 2) * 3 + horizontalAlignment: Text.AlignHCenter + wrapMode: Text.WordWrap + } + StackView { id: mainStack anchors {