Nicer weather card

This commit is contained in:
quadbyte 2025-08-12 10:08:33 -04:00
parent 091d7bf5a3
commit 0202965f65

View file

@ -33,35 +33,37 @@ NBox {
} }
ColumnLayout { ColumnLayout {
NText {
text: Settings.data.location.name
font.weight: Style.fontWeightBold
font.pointSize: Style.fontSizeXL * scaling
}
RowLayout { RowLayout {
NText { NText {
text: Settings.data.location.name visible: weatherReady
font.weight: Style.fontWeightBold text: {
if (!weatherReady) {
return ""
}
var temp = Location.data.weather.current_weather.temperature
if (Settings.data.location.useFahrenheit) {
temp = Location.celsiusToFahrenheit(temp)
}
temp = Math.round(temp)
return `${temp}°`
}
font.pointSize: Style.fontSizeXL * scaling font.pointSize: Style.fontSizeXL * scaling
font.weight: Style.fontWeightBold
} }
NText { NText {
text: weatherReady ? `(${Location.data.weather.timezone_abbreviation})` : "" text: weatherReady ? `(${Location.data.weather.timezone_abbreviation})` : ""
font.pointSize: Style.fontSizeSmall * scaling font.pointSize: Style.fontSizeSmall * scaling
visible: Location.data.weather visible: Location.data.weather
} }
} }
NText {
visible: weatherReady
text: {
if (!weatherReady) {
return ""
}
var temp = Location.data.weather.current_weather.temperature
if (Settings.data.location.useFahrenheit) {
temp = Location.celsiusToFahrenheit(temp)
}
temp = Math.round(temp)
return `${temp}°`
}
font.pointSize: Style.fontSizeXL * scaling
font.weight: Style.fontWeightBold
}
} }
} }