1786192304
This commit is contained in:
@@ -5,7 +5,7 @@ in property <string> : "CONNECTING";
|
||||
in property <string> : "cloud";
|
||||
*/
|
||||
|
||||
import { Palette } from "std-widgets.slint";
|
||||
import { Palette, HorizontalBox, VerticalBox } from "std-widgets.slint";
|
||||
export struct WeatherData {
|
||||
kind: string,
|
||||
label: string,
|
||||
@@ -31,29 +31,7 @@ export component Climate inherits Rectangle {
|
||||
in property <WeatherData> weather;
|
||||
in property <bool> is-night;
|
||||
|
||||
Text {
|
||||
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;
|
||||
// }
|
||||
|
||||
HorizontalBox {
|
||||
if weather.kind == "sun": Image {
|
||||
colorize: Palette.foreground;
|
||||
width: 120px;
|
||||
@@ -124,4 +102,30 @@ export component Climate inherits Rectangle {
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
// }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user