From f2479bee4f0634fc7325f73858350b5f2778d1fe Mon Sep 17 00:00:00 2001 From: Matheus Afonso Martins Moreira Date: Mon, 16 Sep 2024 14:50:42 -0300 Subject: [PATCH] faces/simple_clock: clear segments if not in 024h There was an issue where the simple clock's display would remain in 024h mode even after switching back to 12h/24h mode because it only took into account the leading zero bit, whose value is meaningless unless the 24h mode bit is also set. The issue is fixed by taking both bits into account. Closes #476. Reported-by: CarpeNoctem GitHub-Issue: https://github.com/joeycastillo/Sensor-Watch/issues/476 --- movement/watch_faces/clock/simple_clock_face.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/movement/watch_faces/clock/simple_clock_face.c b/movement/watch_faces/clock/simple_clock_face.c index fe46077..68e1ccd 100644 --- a/movement/watch_faces/clock/simple_clock_face.c +++ b/movement/watch_faces/clock/simple_clock_face.c @@ -124,7 +124,7 @@ bool simple_clock_face_loop(movement_event_t event, movement_settings_t *setting } #endif - if (settings->bit.clock_24h_leading_zero && date_time.unit.hour < 10) { + if (settings->bit.clock_mode_24h && settings->bit.clock_24h_leading_zero && date_time.unit.hour < 10) { set_leading_zero = true; } @@ -137,8 +137,10 @@ bool simple_clock_face_loop(movement_event_t event, movement_settings_t *setting } } watch_display_string(buf, pos); + if (set_leading_zero) watch_display_string("0", 4); + // handle alarm indicator if (state->alarm_enabled != settings->bit.alarm_enabled) _update_alarm_indicator(settings->bit.alarm_enabled, state); break;