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
}
// 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
}
}
}