From 406514283035eebda6d2f82ad50dc3d3f141ddfe Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Fri, 22 Aug 2025 20:54:15 +0700 Subject: [PATCH] =?UTF-8?q?weather:=20make=20the=20=C2=B0C=20not=20look=20?= =?UTF-8?q?ass,=20move=20"feels=20like"=20to=20popup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ii/modules/bar/weather/WeatherPopup.qml | 39 ++++++++++++------- .config/quickshell/ii/services/Weather.qml | 14 ++++--- 2 files changed, 34 insertions(+), 19 deletions(-) diff --git a/.config/quickshell/ii/modules/bar/weather/WeatherPopup.qml b/.config/quickshell/ii/modules/bar/weather/WeatherPopup.qml index 0c472493..2f356756 100644 --- a/.config/quickshell/ii/modules/bar/weather/WeatherPopup.qml +++ b/.config/quickshell/ii/modules/bar/weather/WeatherPopup.qml @@ -18,26 +18,37 @@ StyledPopup { spacing: 5 // Header - RowLayout { + ColumnLayout { id: header - spacing: 5 Layout.alignment: Qt.AlignHCenter + spacing: 2 - MaterialSymbol { - fill: 0 - font.weight: Font.Medium - text: "location_on" - iconSize: Appearance.font.pixelSize.large - color: Appearance.colors.colOnSurfaceVariant - } + RowLayout { + Layout.alignment: Qt.AlignHCenter + spacing: 6 - StyledText { - text: Weather.data.city - font { - weight: Font.Medium - pixelSize: Appearance.font.pixelSize.normal + MaterialSymbol { + fill: 0 + font.weight: Font.Medium + text: "location_on" + iconSize: Appearance.font.pixelSize.large + color: Appearance.colors.colOnSurfaceVariant } + + StyledText { + text: Weather.data.city + font { + weight: Font.Medium + pixelSize: Appearance.font.pixelSize.normal + } + color: Appearance.colors.colOnSurfaceVariant + } + } + StyledText { + id: temp + font.pixelSize: Appearance.font.pixelSize.smaller color: Appearance.colors.colOnSurfaceVariant + text: Weather.data.temp + " • " + Translation.tr("Feels like %1").arg(Weather.data.tempFeelsLike) } } diff --git a/.config/quickshell/ii/services/Weather.qml b/.config/quickshell/ii/services/Weather.qml index c8d46e26..bf6be893 100644 --- a/.config/quickshell/ii/services/Weather.qml +++ b/.config/quickshell/ii/services/Weather.qml @@ -34,7 +34,8 @@ Singleton { precip: 0, visib: 0, press: 0, - temp: 0 + temp: 0, + tempFeelsLike: 0 }) function refineData(data) { @@ -47,22 +48,25 @@ Singleton { temp.wCode = data?.current?.weatherCode || "113"; temp.city = data?.location?.areaName[0]?.value || "City"; temp.temp = ""; + temp.tempFeelsLike = ""; if (root.useUSCS) { temp.wind = (data?.current?.windspeedMiles || 0) + " mph"; temp.precip = (data?.current?.precipInches || 0) + " in"; temp.visib = (data?.current?.visibilityMiles || 0) + " m"; temp.press = (data?.current?.pressureInches || 0) + " psi"; temp.temp += (data?.current?.temp_F || 0); - temp.temp += " (" + (data?.current?.FeelsLikeF || 0) + ") "; - temp.temp += "\u{02109}"; + temp.tempFeelsLike += (data?.current?.FeelsLikeF || 0); + temp.temp += "°F"; + temp.tempFeelsLike += "°F"; } else { temp.wind = (data?.current?.windspeedKmph || 0) + " km/h"; temp.precip = (data?.current?.precipMM || 0) + " mm"; temp.visib = (data?.current?.visibility || 0) + " km"; temp.press = (data?.current?.pressure || 0) + " hPa"; temp.temp += (data?.current?.temp_C || 0); - temp.temp += " (" + (data?.current?.FeelsLikeC || 0) + ") "; - temp.temp += "\u{02103}"; + temp.tempFeelsLike += (data?.current?.FeelsLikeC || 0); + temp.temp += "°C"; + temp.tempFeelsLike += "°C"; } root.data = temp; }