mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
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. 
This commit is contained in:
parent
c45db847cc
commit
d122665eb5
3 changed files with 24 additions and 31 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue