From 92b5dc1dbdca2f57762faf741b508f2c030ed465 Mon Sep 17 00:00:00 2001 From: Devin Lin Date: Sun, 22 Oct 2023 23:42:38 -0700 Subject: [PATCH] lockscreen: Fix styling --- lookandfeel/contents/lockscreen/Keypad.qml | 4 ++ .../contents/lockscreen/LockScreen.qml | 43 ++++++++++++++----- .../contents/lockscreen/PasswordBar.qml | 14 +++--- 3 files changed, 45 insertions(+), 16 deletions(-) diff --git a/lookandfeel/contents/lockscreen/Keypad.qml b/lookandfeel/contents/lockscreen/Keypad.qml index 327ebc67..3a3ac17b 100644 --- a/lookandfeel/contents/lockscreen/Keypad.qml +++ b/lookandfeel/contents/lockscreen/Keypad.qml @@ -177,12 +177,16 @@ Rectangle { Kirigami.Icon { visible: modelData === "R" anchors.centerIn: parent + width: Kirigami.Units.iconSizes.small + height: Kirigami.Units.iconSizes.small source: "edit-clear" } Kirigami.Icon { visible: modelData === "E" anchors.centerIn: parent + width: Kirigami.Units.iconSizes.small + height: Kirigami.Units.iconSizes.small source: "go-next" } } diff --git a/lookandfeel/contents/lockscreen/LockScreen.qml b/lookandfeel/contents/lockscreen/LockScreen.qml index 4b282bf5..100be805 100644 --- a/lookandfeel/contents/lockscreen/LockScreen.qml +++ b/lookandfeel/contents/lockscreen/LockScreen.qml @@ -58,8 +58,6 @@ Item { Item { anchors.fill: parent - Kirigami.Theme.colorSet: Kirigami.Theme.Complementary - Kirigami.Theme.inherit: false // header bar and action drawer Loader { @@ -124,7 +122,7 @@ Item { onPasswordRequested: flickable.goToOpenPosition() anchors.top: parent.top - anchors.bottom: scrollUpIconLoader.top + anchors.bottom: parent.bottom anchors.left: parent.left anchors.right: parent.right @@ -147,7 +145,7 @@ Item { anchors.topMargin: headerBarLoader.statusBarHeight anchors.top: parent.top - anchors.bottom: scrollUpIconLoader.top + anchors.bottom: parent.bottom anchors.left: parent.left anchors.right: parent.right @@ -160,17 +158,40 @@ Item { id: scrollUpIconLoader asynchronous: true + property real animationY: 0 + readonly property real fullYOffset: Kirigami.Units.largeSpacing + anchors.bottom: parent.bottom - anchors.bottomMargin: Kirigami.Units.gridUnit + flickable.position * 0.5 + anchors.bottomMargin: Kirigami.Units.gridUnit + flickable.position * 0.5 + scrollUpIconLoader.animationY anchors.horizontalCenter: parent.horizontalCenter + // animate it going up and down + NumberAnimation on animationY { + id: animateUpAndDown + running: true + duration: 800 + easing.type: Easing.InCubic + to: scrollUpIconLoader.fullYOffset + + onFinished: { + if (scrollUpIconLoader.animationY === scrollUpIconLoader.fullYOffset) { + to = 0; + easing.type = Easing.OutCubic; + } else { + to = scrollUpIconLoader.fullYOffset; + easing.type = Easing.InCubic; + } + restart(); + } + } + sourceComponent: Kirigami.Icon { id: scrollUpIcon - implicitWidth: Kirigami.Units.iconSizes.smallMedium - implicitHeight: Kirigami.Units.iconSizes.smallMedium + implicitWidth: Kirigami.Units.iconSizes.small + implicitHeight: Kirigami.Units.iconSizes.small opacity: 1 - flickable.openFactor - Kirigami.Theme.colorSet: Kirigami.Theme.ComplementaryColorGroup + Kirigami.Theme.colorSet: Kirigami.Theme.Complementary source: "arrow-up" } } @@ -213,9 +234,9 @@ Item { Kirigami.Icon { Layout.alignment: Qt.AlignHCenter Layout.bottomMargin: Kirigami.Units.gridUnit - implicitWidth: Kirigami.Units.iconSizes.smallMedium - implicitHeight: Kirigami.Units.iconSizes.smallMedium - Kirigami.Theme.colorSet: Kirigami.Theme.ComplementaryColorGroup + implicitWidth: Kirigami.Units.iconSizes.small + implicitHeight: Kirigami.Units.iconSizes.small + Kirigami.Theme.colorSet: Kirigami.Theme.Complementary source: "arrow-down" opacity: Math.sin((Math.PI / 2) * flickable.openFactor + 1.5 * Math.PI) + 1 } diff --git a/lookandfeel/contents/lockscreen/PasswordBar.qml b/lookandfeel/contents/lockscreen/PasswordBar.qml index d8dd7f3f..381f75b8 100644 --- a/lookandfeel/contents/lockscreen/PasswordBar.qml +++ b/lookandfeel/contents/lockscreen/PasswordBar.qml @@ -210,22 +210,26 @@ Rectangle { ListView { id: dotDisplay - property int dotWidth: Math.round(Kirigami.Units.gridUnit * 0.35) + + property int dotWidth: 6 Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter Layout.bottomMargin: Math.round(dotWidth / 2) - orientation: ListView.Horizontal + + implicitHeight: dotWidth implicitWidth: count * dotWidth + spacing * (count - 1) + + orientation: ListView.Horizontal spacing: 8 model: dotDisplayModel Behavior on implicitWidth { NumberAnimation { duration: 50 } } - + delegate: Item { - implicitWidth: dotDisplay.dotWidth - implicitHeight: dotDisplay.dotWidth + width: dotDisplay.dotWidth + height: dotDisplay.dotWidth property bool showChar: index === root.previewCharIndex Component.onCompleted: {