1786192688

This commit is contained in:
2026-08-08 14:38:08 +02:00
parent f0cf878383
commit 653179be2e

View File

@@ -31,97 +31,97 @@ export component Climate inherits Rectangle {
in property <WeatherData> weather; in property <WeatherData> weather;
in property <bool> is-night; in property <bool> is-night;
HorizontalBox { VerticalLayout {
height: parent.height; HorizontalLayout {
Rectangle { }
Rectangle { } if weather.kind == "sun": Image {
colorize: Palette.foreground;
if weather.kind == "sun": Image { width: 120px;
colorize: Palette.foreground; height: 105px;
width: 120px; source: @image-url("icons/sun.svg");
height: 105px; image-fit: contain;
source: @image-url("icons/sun.svg"); }
image-fit: contain; if weather.kind == "cloud-sun" && !is-night: Image {
} colorize: Palette.foreground;
if weather.kind == "cloud-sun" && !is-night: Image { width: 120px;
colorize: Palette.foreground; height: 105px;
width: 120px; source: @image-url("icons/cloud-sun.svg");
height: 105px; image-fit: contain;
source: @image-url("icons/cloud-sun.svg"); }
image-fit: contain; if weather.kind == "cloud-sun" && is-night: Image {
} colorize: Palette.foreground;
if weather.kind == "cloud-sun" && is-night: Image { width: 120px;
colorize: Palette.foreground; height: 105px;
width: 120px; source: @image-url("icons/cloud-moon.svg");
height: 105px; image-fit: contain;
source: @image-url("icons/cloud-moon.svg"); }
image-fit: contain; if weather.kind == "cloud": Image {
} colorize: Palette.foreground;
if weather.kind == "cloud": Image { width: 120px;
colorize: Palette.foreground; height: 105px;
width: 120px; source: @image-url("icons/cloud.svg");
height: 105px; image-fit: contain;
source: @image-url("icons/cloud.svg"); }
image-fit: contain; if weather.kind == "cloud-rain": Image {
} colorize: Palette.foreground;
if weather.kind == "cloud-rain": Image { width: 120px;
colorize: Palette.foreground; height: 105px;
width: 120px; source: @image-url("icons/cloud-rain.svg");
height: 105px; image-fit: contain;
source: @image-url("icons/cloud-rain.svg"); }
image-fit: contain; if weather.kind == "cloud-rain-wind": Image {
} colorize: Palette.foreground;
if weather.kind == "cloud-rain-wind": Image { width: 120px;
colorize: Palette.foreground; height: 105px;
width: 120px; source: @image-url("icons/cloud-rain-wind.svg");
height: 105px; image-fit: contain;
source: @image-url("icons/cloud-rain-wind.svg"); }
image-fit: contain; if weather.kind == "cloud-lightning": Image {
} colorize: Palette.foreground;
if weather.kind == "cloud-lightning": Image { width: 120px;
colorize: Palette.foreground; height: 105px;
width: 120px; source: @image-url("icons/cloud-lightning.svg");
height: 105px; image-fit: contain;
source: @image-url("icons/cloud-lightning.svg"); }
image-fit: contain; if weather.kind == "snowflake": Image {
} colorize: Palette.foreground;
if weather.kind == "snowflake": Image { width: 120px;
colorize: Palette.foreground; height: 105px;
width: 120px; source: @image-url("icons/snowflake.svg");
height: 105px; image-fit: contain;
source: @image-url("icons/snowflake.svg"); }
image-fit: contain; if weather.kind == "cloud-fog": Image {
} colorize: Palette.foreground;
if weather.kind == "cloud-fog": Image { width: 120px;
colorize: Palette.foreground; height: 105px;
width: 120px; source: @image-url("icons/cloud-fog.svg");
height: 105px; image-fit: contain;
source: @image-url("icons/cloud-fog.svg"); }
image-fit: contain; if weather.kind == "moon": Image {
} colorize: Palette.foreground;
if weather.kind == "moon": Image { width: 120px;
colorize: Palette.foreground; height: 105px;
width: 120px; source: @image-url("icons/moon.svg");
height: 105px; image-fit: contain;
source: @image-url("icons/moon.svg");
image-fit: contain;
}
VerticalBox {
Text {
text: "\{weather.temperature}\{weather.temperature-unit}";
font-size: 36px;
font-weight: 700;
vertical-alignment: center;
horizontal-alignment: right;
} }
Text { VerticalBox {
text: weather.label; Text {
font-size: 24px; text: "\{weather.temperature}\{weather.temperature-unit}";
font-weight: 500; font-size: 36px;
vertical-alignment: center; font-weight: 700;
horizontal-alignment: right; vertical-alignment: center;
horizontal-alignment: right;
}
Text {
text: weather.label;
font-size: 24px;
font-weight: 500;
vertical-alignment: center;
horizontal-alignment: right;
}
} }
} }
} }