lock screen: keep password prompt centered when error text appears
This commit is contained in:
parent
a0cb1d991d
commit
94a3fdb86c
1 changed files with 22 additions and 32 deletions
|
|
@ -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,41 +144,31 @@ WlSessionLockSurface {
|
|||
easing.type: Easing.OutCubic
|
||||
}
|
||||
|
||||
Column {
|
||||
id: _col
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
spacing: 24
|
||||
|
||||
// Password input
|
||||
// Password input - anchored at center
|
||||
LockInput {
|
||||
id: _lockInput
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: 280
|
||||
buffer: root.auth.buffer
|
||||
state: root.auth.state
|
||||
}
|
||||
|
||||
// Error message
|
||||
// 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
|
||||
height: root.auth.message ? implicitHeight : 0
|
||||
|
||||
Behavior on opacity {
|
||||
NumberAnimation {
|
||||
duration: 200
|
||||
}
|
||||
}
|
||||
Behavior on height {
|
||||
NumberAnimation {
|
||||
duration: 200
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue