lock: animate left pill appearance too

This commit is contained in:
end-4 2025-09-05 08:08:43 +02:00
parent f199bc4256
commit 4dcc1f340f

View file

@ -1,12 +1,10 @@
import QtQuick
import QtQuick.Layouts
import Qt5Compat.GraphicalEffects
import qs
import qs.services
import qs.modules.common
import qs.modules.common.widgets
import qs.modules.common.functions
import qs.modules.bar as Bar
MouseArea {
id: root
@ -18,10 +16,6 @@ MouseArea {
passwordBox.forceActiveFocus();
}
Component.onCompleted: {
forceFieldFocus();
}
Connections {
target: context
function onShouldReFocus() {
@ -29,6 +23,25 @@ MouseArea {
}
}
property real toolbarScale: 0.9
property real toolbarOpacity: 0
Behavior on toolbarScale {
NumberAnimation {
duration: Appearance.animation.elementMove.duration
easing.type: Appearance.animation.elementMove.type
easing.bezierCurve: Appearance.animationCurves.expressiveFastSpatial
}
}
Behavior on toolbarOpacity {
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
}
Component.onCompleted: {
forceFieldFocus();
toolbarScale = 1;
toolbarOpacity = 1;
}
Keys.onPressed: event => { // Esc to clear
if (event.key === Qt.Key_Escape) {
root.context.currentText = "";
@ -74,22 +87,8 @@ MouseArea {
animation: Appearance.animation.elementMove.numberAnimation.createObject(this)
}
scale: 0.9
opacity: 0
Component.onCompleted: {
scale = 1;
opacity = 1;
}
Behavior on scale {
NumberAnimation {
duration: Appearance.animation.elementMove.duration
easing.type: Appearance.animation.elementMove.type
easing.bezierCurve: Appearance.animationCurves.expressiveFastSpatial
}
}
Behavior on opacity {
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
}
scale: root.toolbarScale
opacity: root.toolbarOpacity
ToolbarTextField {
id: passwordBox
@ -143,6 +142,9 @@ MouseArea {
rightMargin: 20
}
scale: root.toolbarScale
opacity: root.toolbarOpacity
ToolbarButton {
id: powerButton
implicitWidth: height