1786192304

This commit is contained in:
2026-08-08 14:31:44 +02:00
parent b50df74bd0
commit 24b3e2f2ce

View File

@@ -5,7 +5,7 @@ in property <string> : "CONNECTING";
in property <string> : "cloud"; in property <string> : "cloud";
*/ */
import { Palette } from "std-widgets.slint"; import { Palette, HorizontalBox, VerticalBox } from "std-widgets.slint";
export struct WeatherData { export struct WeatherData {
kind: string, kind: string,
label: string, label: string,
@@ -31,29 +31,7 @@ export component Climate inherits Rectangle {
in property <WeatherData> weather; in property <WeatherData> weather;
in property <bool> is-night; in property <bool> is-night;
Text { HorizontalBox {
text: "\{weather.temperature}\{weather.temperature-unit}";
font-size: 72px;
font-weight: 700;
vertical-alignment: center;
}
Text {
text: weather.label;
font-size: 24px;
font-weight: 500;
vertical-alignment: center;
}
// Text {
// width: 150px;
// height: 32px;
// text: weather.outside-high;
// font-size: 20px;
// font-weight: 700;
// vertical-alignment: center;
// }
if weather.kind == "sun": Image { if weather.kind == "sun": Image {
colorize: Palette.foreground; colorize: Palette.foreground;
width: 120px; width: 120px;
@@ -124,4 +102,30 @@ export component Climate inherits Rectangle {
source: @image-url("icons/moon.svg"); source: @image-url("icons/moon.svg");
image-fit: contain; image-fit: contain;
} }
VerticalBox {
Text {
text: "\{weather.temperature}\{weather.temperature-unit}";
font-size: 36px;
font-weight: 700;
vertical-alignment: center;
}
Text {
text: weather.label;
font-size: 24px;
font-weight: 500;
vertical-alignment: center;
}
}
}
// Text {
// width: 150px;
// height: 32px;
// text: weather.outside-high;
// font-size: 20px;
// font-weight: 700;
// vertical-alignment: center;
// }
} }