From 01fdc09393ae212af1c3a68d18a60d307df6177e Mon Sep 17 00:00:00 2001 From: Nydragon Date: Mon, 25 Nov 2024 18:34:49 +0100 Subject: [PATCH] chore: add weather icon --- src/provider/Weather.qml | 3 +++ src/widgets/notifications/NotificationToast.qml | 4 +++- src/widgets/weather/WeatherMedium.qml | 6 ++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/provider/Weather.qml b/src/provider/Weather.qml index eac0028..be935db 100644 --- a/src/provider/Weather.qml +++ b/src/provider/Weather.qml @@ -43,7 +43,10 @@ Singleton { return day ? "weather-few-clouds" : "weather-few-clouds-night"; case "122": return "weather-overcast"; + case "296": + return day ? "weather-showers-scattered" : "weather-showers-scattered-night"; default: + console.log("Unknown weather code: ", weatherCode); return "weather-none-available"; } } diff --git a/src/widgets/notifications/NotificationToast.qml b/src/widgets/notifications/NotificationToast.qml index 2849baa..e33e8e1 100644 --- a/src/widgets/notifications/NotificationToast.qml +++ b/src/widgets/notifications/NotificationToast.qml @@ -95,11 +95,13 @@ MouseArea { elide: Text.ElideRight font.pointSize: 12.5 - Component.onCompleted: () => { + onImplicitHeightChanged: { if (text.implicitHeight < bodyBox.height) { bodyBox.height = text.implicitHeight; } + } + Component.onCompleted: () => { bodyBox.maxHeight = Qt.binding(() => text.implicitHeight); } } diff --git a/src/widgets/weather/WeatherMedium.qml b/src/widgets/weather/WeatherMedium.qml index c22a9fc..0767b56 100644 --- a/src/widgets/weather/WeatherMedium.qml +++ b/src/widgets/weather/WeatherMedium.qml @@ -38,7 +38,7 @@ BRectangle { } GridLayout { - + Layout.margins: 10 Repeater { model: Weather.lastFetch?.weather @@ -50,9 +50,11 @@ BRectangle { property string maxtempC: modelData.maxtempC property string date: modelData.date + color: "#D7B4F3" + radius: 5 + Layout.fillWidth: true Layout.fillHeight: true - Layout.margins: 5 ColumnLayout { anchors.fill: parent