Skip to content

Commit beef5d9

Browse files
authored
Time fix for home-auto demo (slint-ui#8473)
* Landscape time was not hidden in portrait * Apply landscape time fix to portrait
1 parent a33c598 commit beef5d9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

demos/home-automation/ui/components/mainView/mainScreen.slint

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export component MainScreen inherits Rectangle {
118118
]
119119
}
120120

121-
Rectangle {
121+
if AppState.orientation == Orientation.landscape: Rectangle {
122122
property <bool> showing-time: true;
123123
property <length> margin: AppState.graphics-accelerator-available ? 5px : 20px;
124124
width: 200px;
@@ -184,7 +184,7 @@ export component MainScreen inherits Rectangle {
184184
}
185185
}
186186
}
187-
if AppState.orientation == Orientation.portrait: HorizontalLayout {
187+
if AppState.orientation == Orientation.portrait: HorizontalLayout {
188188
y: root.height - self.height - 10px;
189189
alignment: center;
190190
spacing: 30px;
@@ -208,7 +208,7 @@ export component MainScreen inherits Rectangle {
208208
}
209209
HorizontalLayout {
210210
HaText {
211-
text: Api.current-time.hour.mod(12);
211+
text: Api.current-time.hour.mod(12) == 0 ? 12 : Api.current-time.hour.mod(12);
212212
horizontal-alignment: center;
213213
vertical-alignment: center;
214214
color: Palette.info-foreground;

0 commit comments

Comments
 (0)