From 3c5a1f36296d6554e5e9c92acafb4ccd08df992e Mon Sep 17 00:00:00 2001 From: Avii Date: Sat, 8 Aug 2026 14:43:01 +0200 Subject: [PATCH] 1786192981 --- dashboard/ui/climate.slint | 85 +++++++------------------------------- 1 file changed, 14 insertions(+), 71 deletions(-) diff --git a/dashboard/ui/climate.slint b/dashboard/ui/climate.slint index fed0cc6..ab969cc 100644 --- a/dashboard/ui/climate.slint +++ b/dashboard/ui/climate.slint @@ -31,81 +31,16 @@ export component Climate inherits Rectangle { in property weather; in property is-night; + property <[image]> icons: [ + @image-url("icons/sun.svg"), + @image-url("icons/cloud-sun.svg"), + @image-url("icons/cloud-moon.svg") + ]; + VerticalLayout { HorizontalLayout { Rectangle { } - if weather.kind == "sun": Image { - colorize: Palette.foreground; - width: 120px; - height: 105px; - source: @image-url("icons/sun.svg"); - image-fit: contain; - } - if weather.kind == "cloud-sun" && !is-night: Image { - colorize: Palette.foreground; - width: 120px; - height: 105px; - source: @image-url("icons/cloud-sun.svg"); - image-fit: contain; - } - if weather.kind == "cloud-sun" && is-night: Image { - colorize: Palette.foreground; - width: 120px; - height: 105px; - source: @image-url("icons/cloud-moon.svg"); - image-fit: contain; - } - if weather.kind == "cloud": Image { - colorize: Palette.foreground; - width: 120px; - height: 105px; - source: @image-url("icons/cloud.svg"); - image-fit: contain; - } - if weather.kind == "cloud-rain": Image { - colorize: Palette.foreground; - width: 120px; - height: 105px; - source: @image-url("icons/cloud-rain.svg"); - image-fit: contain; - } - if weather.kind == "cloud-rain-wind": Image { - colorize: Palette.foreground; - width: 120px; - height: 105px; - source: @image-url("icons/cloud-rain-wind.svg"); - image-fit: contain; - } - if weather.kind == "cloud-lightning": Image { - colorize: Palette.foreground; - width: 120px; - height: 105px; - source: @image-url("icons/cloud-lightning.svg"); - image-fit: contain; - } - if weather.kind == "snowflake": Image { - colorize: Palette.foreground; - width: 120px; - height: 105px; - source: @image-url("icons/snowflake.svg"); - image-fit: contain; - } - if weather.kind == "cloud-fog": Image { - colorize: Palette.foreground; - width: 120px; - height: 105px; - source: @image-url("icons/cloud-fog.svg"); - image-fit: contain; - } - if weather.kind == "moon": Image { - colorize: Palette.foreground; - width: 120px; - height: 105px; - source: @image-url("icons/moon.svg"); - image-fit: contain; - } - VerticalBox { Text { text: "\{weather.temperature}\{weather.temperature-unit}"; @@ -123,6 +58,14 @@ export component Climate inherits Rectangle { horizontal-alignment: right; } } + + Image { + colorize: Palette.foreground; + width: 120px; + height: 105px; + source: icons[0]; + image-fit: contain; + } } Rectangle { }