diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-08-10 23:49:56 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-08-10 23:49:56 +1000 |
| commit | e4aff1695e063cce8ed777adc93c1ffc284acbe9 (patch) | |
| tree | 090a491dc95d048d9d3fa42078bc0fde805ef484 /modules | |
| parent | lock: larger outer rounding (diff) | |
| download | caelestia-shell-e4aff1695e063cce8ed777adc93c1ffc284acbe9.tar.gz caelestia-shell-e4aff1695e063cce8ed777adc93c1ffc284acbe9.tar.bz2 caelestia-shell-e4aff1695e063cce8ed777adc93c1ffc284acbe9.zip | |
lock: adjustments for smaller screens
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/lock/WeatherInfo.qml | 50 |
1 files changed, 28 insertions, 22 deletions
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]; |