lock screen: keep password prompt centered when error text appears

This commit is contained in:
Damocles 2026-04-22 21:21:19 +02:00
parent a0cb1d991d
commit 94a3fdb86c

View file

@ -124,12 +124,12 @@ WlSessionLockSurface {
unlockFade: root._unlockFade unlockFade: root._unlockFade
} }
// Center content - password and notifications // Center content - password dead center, error below
Item { Item {
id: content id: content
anchors.centerIn: parent anchors.centerIn: parent
width: 320 width: 320
height: _col.height height: _lockInput.height
NumberAnimation on opacity { NumberAnimation on opacity {
from: 0 from: 0
@ -144,39 +144,29 @@ WlSessionLockSurface {
easing.type: Easing.OutCubic easing.type: Easing.OutCubic
} }
Column { // Password input - anchored at center
id: _col LockInput {
id: _lockInput
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
spacing: 24 width: 280
buffer: root.auth.buffer
state: root.auth.state
}
// Password input // Error message - fixed position below password, never shifts layout
LockInput { Text {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
width: 280 anchors.top: _lockInput.bottom
buffer: root.auth.buffer anchors.topMargin: 16
state: root.auth.state 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 Behavior on opacity {
Text { NumberAnimation {
anchors.horizontalCenter: parent.horizontalCenter duration: 200
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
}
} }
} }
} }