lock: adjustments for smaller screens

This commit is contained in:
2 * r + 2 * t 2025-08-10 23:49:56 +10:00
parent 2defabfd83
commit e4aff1695e

View file

@ -59,31 +59,37 @@ ColumnLayout {
} }
} }
ColumnLayout { Loader {
Layout.rightMargin: Appearance.padding.smaller Layout.rightMargin: Appearance.padding.smaller
spacing: Appearance.spacing.small asynchronous: true
active: root.width > 400
visible: active
StyledText { sourceComponent: ColumnLayout {
Layout.fillWidth: true spacing: Appearance.spacing.small
animate: true StyledText {
text: Weather.temp Layout.fillWidth: true
color: Colours.palette.m3primary
horizontalAlignment: Text.AlignRight
font.pointSize: Appearance.font.size.extraLarge
font.weight: 500
elide: Text.ElideLeft
}
StyledText { animate: true
Layout.fillWidth: true text: Weather.temp
color: Colours.palette.m3primary
horizontalAlignment: Text.AlignRight
font.pointSize: Appearance.font.size.extraLarge
font.weight: 500
elide: Text.ElideLeft
}
animate: true StyledText {
text: qsTr("Feels like: %1").arg(Weather.feelsLike) Layout.fillWidth: true
color: Colours.palette.m3outline
horizontalAlignment: Text.AlignRight animate: true
font.pointSize: Appearance.font.size.smaller text: qsTr("Feels like: %1").arg(Weather.feelsLike)
elide: Text.ElideLeft color: Colours.palette.m3outline
horizontalAlignment: Text.AlignRight
font.pointSize: Appearance.font.size.smaller
elide: Text.ElideLeft
}
} }
} }
} }
@ -97,14 +103,14 @@ ColumnLayout {
Repeater { Repeater {
model: { model: {
const forecast = Weather.forecast; const forecast = Weather.forecast;
let count = root.width < 320 ? 3 : root.width < 400 ? 4 : 5;
if (!forecast) if (!forecast)
return Array.from({ return Array.from({
length: 5 length: count
}, () => null); }, () => null);
const hours = []; const hours = [];
const hour = new Date().getHours(); const hour = new Date().getHours();
let count = 5;
const today = forecast[0].hourly; const today = forecast[0].hourly;
const arr = [...today, ...forecast[1].hourly]; const arr = [...today, ...forecast[1].hourly];