From 4dcc1f340f1b55057eb288d05da08c5fc123e119 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Fri, 5 Sep 2025 08:08:43 +0200 Subject: [PATCH] lock: animate left pill appearance too --- .../ii/modules/lock/LockSurface.qml | 46 ++++++++++--------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/.config/quickshell/ii/modules/lock/LockSurface.qml b/.config/quickshell/ii/modules/lock/LockSurface.qml index f664c2ed4..39d1d3378 100644 --- a/.config/quickshell/ii/modules/lock/LockSurface.qml +++ b/.config/quickshell/ii/modules/lock/LockSurface.qml @@ -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