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:
@@ -68,7 +68,7 @@ void repetition_minute_face_activate(movement_settings_t *settings, void *contex
|
||||
|
||||
if (watch_tick_animation_is_running()) watch_stop_tick_animation();
|
||||
|
||||
if (settings->bit.clock_mode_24h) watch_set_indicator(WATCH_INDICATOR_24H);
|
||||
if (settings->bit.clock_mode_24h && !settings->bit.clock_24h_leading_zero) watch_set_indicator(WATCH_INDICATOR_24H);
|
||||
|
||||
// handle chime indicator
|
||||
if (state->signal_enabled) watch_set_indicator(WATCH_INDICATOR_BELL);
|
||||
@@ -112,6 +112,7 @@ bool repetition_minute_face_loop(movement_event_t event, movement_settings_t *se
|
||||
// ...and set the LAP indicator if low.
|
||||
if (state->battery_low) watch_set_indicator(WATCH_INDICATOR_LAP);
|
||||
|
||||
bool set_leading_zero = false;
|
||||
if ((date_time.reg >> 6) == (previous_date_time >> 6) && event.event_type != EVENT_LOW_ENERGY_UPDATE) {
|
||||
// everything before seconds is the same, don't waste cycles setting those segments.
|
||||
watch_display_character_lp_seconds('0' + date_time.unit.second / 10, 8);
|
||||
@@ -132,6 +133,8 @@ bool repetition_minute_face_loop(movement_event_t event, movement_settings_t *se
|
||||
}
|
||||
date_time.unit.hour %= 12;
|
||||
if (date_time.unit.hour == 0) date_time.unit.hour = 12;
|
||||
} else if (settings->bit.clock_24h_leading_zero && date_time.unit.hour < 10) {
|
||||
set_leading_zero = true;
|
||||
}
|
||||
pos = 0;
|
||||
if (event.event_type == EVENT_LOW_ENERGY_UPDATE) {
|
||||
@@ -142,6 +145,8 @@ bool repetition_minute_face_loop(movement_event_t event, movement_settings_t *se
|
||||
}
|
||||
}
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user