From 94a3fdb86c3ce9d1d154538cdef77845a2aaf711 Mon Sep 17 00:00:00 2001 From: Damocles Date: Wed, 22 Apr 2026 21:21:19 +0200 Subject: [PATCH] lock screen: keep password prompt centered when error text appears --- shell/lock/LockSurface.qml | 54 ++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 32 deletions(-) diff --git a/shell/lock/LockSurface.qml b/shell/lock/LockSurface.qml index 35b0ca8..983a2f5 100644 --- a/shell/lock/LockSurface.qml +++ b/shell/lock/LockSurface.qml @@ -124,12 +124,12 @@ WlSessionLockSurface { unlockFade: root._unlockFade } - // Center content - password and notifications + // Center content - password dead center, error below Item { id: content anchors.centerIn: parent width: 320 - height: _col.height + height: _lockInput.height NumberAnimation on opacity { from: 0 @@ -144,39 +144,29 @@ WlSessionLockSurface { easing.type: Easing.OutCubic } - Column { - id: _col + // Password input - anchored at center + LockInput { + id: _lockInput anchors.horizontalCenter: parent.horizontalCenter - spacing: 24 + width: 280 + buffer: root.auth.buffer + state: root.auth.state + } - // Password input - LockInput { - anchors.horizontalCenter: parent.horizontalCenter - width: 280 - buffer: root.auth.buffer - state: root.auth.state - } + // Error message - fixed position below password, never shifts layout + Text { + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: _lockInput.bottom + anchors.topMargin: 16 + text: root.auth.message + color: S.Theme.base08 + font.pixelSize: S.Theme.fontSize - 1 + font.family: S.Theme.fontFamily + opacity: root.auth.message ? 1 : 0 - // Error message - Text { - anchors.horizontalCenter: parent.horizontalCenter - text: root.auth.message - color: S.Theme.base08 - font.pixelSize: S.Theme.fontSize - 1 - font.family: S.Theme.fontFamily - opacity: root.auth.message ? 1 : 0 - height: root.auth.message ? implicitHeight : 0 - - Behavior on opacity { - NumberAnimation { - duration: 200 - } - } - Behavior on height { - NumberAnimation { - duration: 200 - easing.type: Easing.OutCubic - } + Behavior on opacity { + NumberAnimation { + duration: 200 } } }