mirror of
https://github.com/firewalkwithm3/Sensor-Watch.git
synced 2024-11-22 11:10:29 +08:00
faces/clock: clear segments if not in 024h mode
There was an issue where the 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:
parent
f2479bee4f
commit
ea5efb4d82
|
@ -60,6 +60,10 @@ static bool clock_is_in_24h_mode(movement_settings_t *settings) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool clock_should_set_leading_zero(movement_settings_t *settings) {
|
||||||
|
return clock_is_in_24h_mode(settings) && settings->bit.clock_24h_leading_zero;
|
||||||
|
}
|
||||||
|
|
||||||
static void clock_indicate(WatchIndicatorSegment indicator, bool on) {
|
static void clock_indicate(WatchIndicatorSegment indicator, bool on) {
|
||||||
if (on) {
|
if (on) {
|
||||||
watch_set_indicator(indicator);
|
watch_set_indicator(indicator);
|
||||||
|
@ -180,7 +184,7 @@ static void clock_display_clock(movement_settings_t *settings, clock_state_t *cl
|
||||||
clock_indicate_pm(settings, current);
|
clock_indicate_pm(settings, current);
|
||||||
current = clock_24h_to_12h(current);
|
current = clock_24h_to_12h(current);
|
||||||
}
|
}
|
||||||
clock_display_all(current, settings->bit.clock_24h_leading_zero);
|
clock_display_all(current, clock_should_set_leading_zero(settings));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue