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)
This commit is contained in:
Micah Stanley 2024-07-30 02:53:33 +00:00 committed by Devin Lin
parent c45db847cc
commit d122665eb5
3 changed files with 24 additions and 31 deletions

View file

@ -30,33 +30,45 @@ Item {
ColumnLayout { ColumnLayout {
id: clockColumn id: clockColumn
spacing: Kirigami.Units.gridUnit spacing: 0
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
PC3.Label { 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" color: "white"
opacity: 0.9
renderType: Text.NativeRendering
Layout.alignment: root.layoutAlignment Layout.alignment: root.layoutAlignment
font.weight: Font.Bold font.weight: Font.Medium
font.pointSize: 36 font.pointSize: 64
layer.enabled: true layer.enabled: true
layer.effect: MobileShell.TextDropShadow { layer.effect: MobileShell.TextDropShadow {
blurMax: 16 blurMax: 16
} }
} }
PC3.Label { PC3.Label {
text: Qt.formatDate(timeSource.data["Local"]["DateTime"], "ddd, MMM d") text: Qt.formatDate(timeSource.data["Local"]["DateTime"], "dddd, MMMM d")
color: "white" color: "white"
opacity: 0.9
Layout.alignment: root.layoutAlignment Layout.alignment: root.layoutAlignment
font.weight: Font.Bold font.weight: Font.Bold
font.pointSize: 10 font.pointSize: 12
layer.enabled: true layer.enabled: true
layer.effect: MobileShell.TextDropShadow { layer.effect: MobileShell.TextDropShadow {

View file

@ -106,7 +106,7 @@ Item {
implicitWidth: keypadGrid.cellLength implicitWidth: keypadGrid.cellLength
implicitHeight: keypadGrid.cellLength implicitHeight: keypadGrid.cellLength
visible: modelData.length > 0 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 opacity: enabled
Behavior on opacity { Behavior on opacity {

View file

@ -30,32 +30,14 @@ Item {
spacing: 0 spacing: 0
// Center clock when no notifications are shown, otherwise move the clock upward // 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.topMargin: Kirigami.Units.gridUnit * 3.5
anchors.bottomMargin: Kirigami.Units.gridUnit anchors.bottomMargin: Kirigami.Units.gridUnit * 2
anchors.fill: parent 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: clockAndMediaWidget }
LayoutItemProxy { target: notificationComponent } 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) // Horizontal layout (landscape on smaller devices)
Item { Item {
id: horizontalLayout id: horizontalLayout
@ -94,13 +76,12 @@ Item {
id: clockAndMediaWidget id: clockAndMediaWidget
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: root.isVertical Layout.fillHeight: root.isVertical
spacing: Kirigami.Units.gridUnit * 2 spacing: Kirigami.Units.gridUnit
Clock { Clock {
layoutAlignment: root.isVertical ? Qt.AlignHCenter : Qt.AlignLeft layoutAlignment: root.isVertical ? Qt.AlignHCenter : Qt.AlignLeft
Layout.alignment: root.isVertical ? Qt.AlignHCenter : Qt.AlignLeft Layout.alignment: root.isVertical ? Qt.AlignHCenter : Qt.AlignLeft
Layout.fillWidth: true Layout.fillWidth: true
Layout.bottomMargin: root.isVertical ? Kirigami.Units.gridUnit * 2 : 0
} }
MobileShell.MediaControlsWidget { MobileShell.MediaControlsWidget {
@ -139,4 +120,4 @@ Item {
onPasswordRequested: root.passwordRequested() onPasswordRequested: root.passwordRequested()
onNotificationsShownChanged: root.notificationsShown = notificationsShown onNotificationsShownChanged: root.notificationsShown = notificationsShown
} }
} }