Files
dashboard/dashboard/ui/climate.slint
2026-08-08 13:41:02 +02:00

96 lines
2.5 KiB
Plaintext

/*
in property <string> : "--";
in property <string> : "HIGH --";
in property <string> : "CONNECTING";
in property <string> : "cloud";
*/
export struct WeatherData {
outside-temperature: string,
outside-high: string,
outside-condition: string,
weather-kind: string,
}
export component Climate inherits Rectangle {
in property <WeatherData> weather;
Text {
width: 300px;
height: 116px;
text: weather.outside-temperature;
font-size: 104px;
font-weight: 700;
vertical-alignment: center;
}
Text {
width: 150px;
height: 32px;
text: weather.outside-high;
font-size: 20px;
font-weight: 700;
vertical-alignment: center;
}
if weather.weather-kind == "sun": Image {
width: 120px;
height: 105px;
source: @image-url("icons/sun.svg");
image-fit: contain;
}
if weather.weather-kind == "cloud-sun": Image {
width: 120px;
height: 105px;
source: @image-url("icons/cloud-sun.svg");
image-fit: contain;
}
if weather.weather-kind == "cloud-moon": Image {
width: 120px;
height: 105px;
source: @image-url("icons/cloud-moon.svg");
image-fit: contain;
}
if weather.weather-kind == "cloud": Image {
width: 120px;
height: 105px;
source: @image-url("icons/cloud.svg");
image-fit: contain;
}
if weather.weather-kind == "cloud-rain": Image {
width: 120px;
height: 105px;
source: @image-url("icons/cloud-rain.svg");
image-fit: contain;
}
if weather.weather-kind == "cloud-rain-wind": Image {
width: 120px;
height: 105px;
source: @image-url("icons/cloud-rain-wind.svg");
image-fit: contain;
}
if weather.weather-kind == "cloud-lightning": Image {
width: 120px;
height: 105px;
source: @image-url("icons/cloud-lightning.svg");
image-fit: contain;
}
if weather.weather-kind == "snowflake": Image {
width: 120px;
height: 105px;
source: @image-url("icons/snowflake.svg");
image-fit: contain;
}
if weather.weather-kind == "cloud-fog": Image {
width: 120px;
height: 105px;
source: @image-url("icons/cloud-fog.svg");
image-fit: contain;
}
if weather.weather-kind == "moon": Image {
width: 120px;
height: 105px;
source: @image-url("icons/moon.svg");
image-fit: contain;
}
}