From d122665eb5cbccd6becb96349d0f5598b632cabc Mon Sep 17 00:00:00 2001 From: Micah Stanley Date: Tue, 30 Jul 2024 02:53:33 +0000 Subject: [PATCH] Lock Screen Adjustments Clock position changed so that it will always be at the top. The login keypad will now hide when the keyboard is opened. ![Screenshot_20240728_054940](/uploads/be3a5625c10717add38a76dbdded358b/Screenshot_20240728_054940.png) --- shell/contents/lockscreen/Clock.qml | 26 +++++++++++++----- shell/contents/lockscreen/Keypad.qml | 2 +- .../contents/lockscreen/LockScreenContent.qml | 27 +++---------------- 3 files changed, 24 insertions(+), 31 deletions(-) diff --git a/shell/contents/lockscreen/Clock.qml b/shell/contents/lockscreen/Clock.qml index 94066c13..61b06394 100644 --- a/shell/contents/lockscreen/Clock.qml +++ b/shell/contents/lockscreen/Clock.qml @@ -30,33 +30,45 @@ Item { ColumnLayout { id: clockColumn - spacing: Kirigami.Units.gridUnit + spacing: 0 anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right PC3.Label { - text: Qt.formatTime(timeSource.data["Local"]["DateTime"], MobileShell.ShellUtil.isSystem24HourFormat ? "h:mm" : "h:mm ap") + text: { + let timeText = Qt.formatTime(timeSource.data["Local"]["DateTime"], MobileShell.ShellUtil.isSystem24HourFormat ? "h:mm" : "h:mm ap"); + + // Remove am/pm in 12-hour time to avoid excessive length + if (!MobileShell.ShellUtil.isSystem24HourFormat) { + timeText = timeText.substring(0, timeText.length - 3); + } + return timeText; + } + color: "white" + opacity: 0.9 + + renderType: Text.NativeRendering Layout.alignment: root.layoutAlignment - font.weight: Font.Bold - font.pointSize: 36 + font.weight: Font.Medium + font.pointSize: 64 layer.enabled: true layer.effect: MobileShell.TextDropShadow { blurMax: 16 } } - PC3.Label { - text: Qt.formatDate(timeSource.data["Local"]["DateTime"], "ddd, MMM d") + text: Qt.formatDate(timeSource.data["Local"]["DateTime"], "dddd, MMMM d") color: "white" + opacity: 0.9 Layout.alignment: root.layoutAlignment font.weight: Font.Bold - font.pointSize: 10 + font.pointSize: 12 layer.enabled: true layer.effect: MobileShell.TextDropShadow { diff --git a/shell/contents/lockscreen/Keypad.qml b/shell/contents/lockscreen/Keypad.qml index a77a0ab1..a9e66751 100644 --- a/shell/contents/lockscreen/Keypad.qml +++ b/shell/contents/lockscreen/Keypad.qml @@ -106,7 +106,7 @@ Item { implicitWidth: keypadGrid.cellLength implicitHeight: keypadGrid.cellLength visible: modelData.length > 0 - enabled: root.openProgress >= 0.8 // Only enable after a certain point in animation + enabled: root.openProgress >= 0.8 && !lockScreenState.isKeyboardMode // Only enable after a certain point in animation opacity: enabled Behavior on opacity { diff --git a/shell/contents/lockscreen/LockScreenContent.qml b/shell/contents/lockscreen/LockScreenContent.qml index 51825e92..d325e2df 100644 --- a/shell/contents/lockscreen/LockScreenContent.qml +++ b/shell/contents/lockscreen/LockScreenContent.qml @@ -30,32 +30,14 @@ Item { spacing: 0 // Center clock when no notifications are shown, otherwise move the clock upward - anchors.topMargin: root.notificationsShown ? Kirigami.Units.gridUnit * 5 : Math.round(root.fullHeight / 2 - (verticalLayout.implicitHeight / 2)) - anchors.bottomMargin: Kirigami.Units.gridUnit + anchors.topMargin: Kirigami.Units.gridUnit * 3.5 + anchors.bottomMargin: Kirigami.Units.gridUnit * 2 anchors.fill: parent - // Animate clock centering change when notifications come in - Behavior on anchors.topMargin { - id: topMarginAnim - enabled: false - - NumberAnimation { - duration: Kirigami.Units.veryLongDuration - easing.type: Easing.InOutExpo - } - } - LayoutItemProxy { target: clockAndMediaWidget } LayoutItemProxy { target: notificationComponent } } - // HACK: don't animate top margin at beginning, while notification model figures itself out - Timer { - running: true - repeat: false - onTriggered: topMarginAnim.enabled = true - } - // Horizontal layout (landscape on smaller devices) Item { id: horizontalLayout @@ -94,13 +76,12 @@ Item { id: clockAndMediaWidget Layout.fillWidth: true Layout.fillHeight: root.isVertical - spacing: Kirigami.Units.gridUnit * 2 + spacing: Kirigami.Units.gridUnit Clock { layoutAlignment: root.isVertical ? Qt.AlignHCenter : Qt.AlignLeft Layout.alignment: root.isVertical ? Qt.AlignHCenter : Qt.AlignLeft Layout.fillWidth: true - Layout.bottomMargin: root.isVertical ? Kirigami.Units.gridUnit * 2 : 0 } MobileShell.MediaControlsWidget { @@ -139,4 +120,4 @@ Item { onPasswordRequested: root.passwordRequested() onNotificationsShownChanged: root.notificationsShown = notificationsShown } -} \ No newline at end of file +}