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,8 +59,13 @@ ColumnLayout {
} }
} }
ColumnLayout { Loader {
Layout.rightMargin: Appearance.padding.smaller Layout.rightMargin: Appearance.padding.smaller
asynchronous: true
active: root.width > 400
visible: active
sourceComponent: ColumnLayout {
spacing: Appearance.spacing.small spacing: Appearance.spacing.small
StyledText { StyledText {
@ -87,6 +92,7 @@ ColumnLayout {
} }
} }
} }
}
RowLayout { RowLayout {
Layout.topMargin: Appearance.spacing.smaller Layout.topMargin: Appearance.spacing.smaller
@ -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];