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 <cryptomax@pm.me>
GitHub-Issue: https://github.com/joeycastillo/Sensor-Watch/issues/476
This commit is contained in:
Matheus Afonso Martins Moreira 2024-09-16 14:50:42 -03:00
parent 831aadddea
commit f2479bee4f

View file

@ -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;