Merge PR #299 - leading zero representation
Adds a movement-wide leading zero 024h representation mode that's toggleable in the preferences watch face. Also adds support for the new display mode to existing faces. I modified the logic a bit to ensure the 24h indicator remains lit in the simple clock face even when in 024h mode. I also added support to the more advanced clock face. In the future I will add a compile time toggle to it as well. Reviewed-by: Matheus Afonso Martins Moreira <matheus@matheusmoreira.com> GitHub-Pull-Request: https://github.com/joeycastillo/Sensor-Watch/pull/299
This commit is contained in:
@@ -124,13 +124,13 @@ static void clock_toggle_time_signal(clock_state_t *clock) {
|
||||
clock_indicate_time_signal(clock);
|
||||
}
|
||||
|
||||
static void clock_display_all(watch_date_time date_time) {
|
||||
static void clock_display_all(watch_date_time date_time, bool leading_zero) {
|
||||
char buf[10 + 1];
|
||||
|
||||
snprintf(
|
||||
buf,
|
||||
sizeof(buf),
|
||||
"%s%2d%2d%02d%02d",
|
||||
leading_zero? "%s%02d%02d%02d%02d" : "%s%2d%2d%02d%02d",
|
||||
watch_utility_get_weekday(date_time),
|
||||
date_time.unit.day,
|
||||
date_time.unit.hour,
|
||||
@@ -180,7 +180,7 @@ static void clock_display_clock(movement_settings_t *settings, clock_state_t *cl
|
||||
clock_indicate_pm(settings, current);
|
||||
current = clock_24h_to_12h(current);
|
||||
}
|
||||
clock_display_all(current);
|
||||
clock_display_all(current, settings->bit.clock_24h_leading_zero);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user