From e4aff1695e063cce8ed777adc93c1ffc284acbe9 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Sun, 10 Aug 2025 23:49:56 +1000 Subject: lock: adjustments for smaller screens --- modules/lock/WeatherInfo.qml | 50 +++++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 22 deletions(-) (limited to 'modules') diff --git a/modules/lock/WeatherInfo.qml b/modules/lock/WeatherInfo.qml index da35a92..5d10e7b 100644 --- a/modules/lock/WeatherInfo.qml +++ b/modules/lock/WeatherInfo.qml @@ -59,31 +59,37 @@ ColumnLayout { } } - ColumnLayout { + Loader { Layout.rightMargin: Appearance.padding.smaller - spacing: Appearance.spacing.small + asynchronous: true + active: root.width > 400 + visible: active - StyledText { - Layout.fillWidth: true + sourceComponent: ColumnLayout { + spacing: Appearance.spacing.small - animate: true - text: Weather.temp - color: Colours.palette.m3primary - horizontalAlignment: Text.AlignRight - font.pointSize: Appearance.font.size.extraLarge - font.weight: 500 - elide: Text.ElideLeft - } + StyledText { + Layout.fillWidth: true - StyledText { - Layout.fillWidth: true + animate: 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 - text: qsTr("Feels like: %1").arg(Weather.feelsLike) - color: Colours.palette.m3outline - horizontalAlignment: Text.AlignRight - font.pointSize: Appearance.font.size.smaller - elide: Text.ElideLeft + StyledText { + Layout.fillWidth: true + + animate: true + text: qsTr("Feels like: %1").arg(Weather.feelsLike) + color: Colours.palette.m3outline + horizontalAlignment: Text.AlignRight + font.pointSize: Appearance.font.size.smaller + elide: Text.ElideLeft + } } } } @@ -97,14 +103,14 @@ ColumnLayout { Repeater { model: { const forecast = Weather.forecast; + let count = root.width < 320 ? 3 : root.width < 400 ? 4 : 5; if (!forecast) return Array.from({ - length: 5 + length: count }, () => null); const hours = []; const hour = new Date().getHours(); - let count = 5; const today = forecast[0].hourly; const arr = [...today, ...forecast[1].hourly]; -- cgit v1.2.3-freya