-
Notifications
You must be signed in to change notification settings - Fork 0
/
forecastwidget.slint
71 lines (63 loc) · 1.67 KB
/
forecastwidget.slint
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import { VerticalBox, HorizontalBox } from "std-widgets.slint";
export struct Forecast {
temp: string,
icon: image,
precipitation: string,
}
component ForecastCell {
in property <Forecast> forecast;
in property <string> heading;
VerticalBox {
HorizontalBox {
alignment: center;
Image {
max-height: 8.75rem;
max-width: 8.75rem;
source: forecast.icon;
}
VerticalBox {
Text {
color: #FEFBE6;
text: forecast.temp + "°";
font-size: 4rem;
horizontal-alignment: center;
}
Text {
color: #FEFBE6;
text: forecast.precipitation + "mm";
font-size: 1.5rem;
horizontal-alignment: center;
}
}
}
Text {
color: #FEFBE6;
text: heading;
font-size: 2.5rem;
horizontal-alignment: center;
}
}
}
export component ForecastWidget {
in property <Forecast> today: {
temp: "-1",
precipitation: "2",
icon: @image-url("../img/weather/partlycloudy_day.png")
};
in property <Forecast> tomorrow: {
temp: "-1",
precipitation: "2",
icon: @image-url("../img/weather/partlycloudy_day.png")
};
HorizontalBox {
width: 100%;
ForecastCell {
forecast: today;
heading: "I dag";
}
ForecastCell {
forecast: tomorrow;
heading: "I morgen";
}
}
}