improve time zone selection, show offset on odd ticks
This commit is contained in:
parent
fb5a2d9ba4
commit
0e35afcbb2
2
utz
2
utz
@ -1 +1 @@
|
||||
Subproject commit 1969e6167e1c0d19872e1c5a1d7a88e259651d07
|
||||
Subproject commit 8c9447e1bc0eb8946800d5d7fa30b1383df324b0
|
||||
@ -33,6 +33,7 @@
|
||||
const char set_time_face_titles[SET_TIME_FACE_NUM_SETTINGS][3] = {"HR", "M1", "SE", "YR", "MO", "DA", " "};
|
||||
|
||||
static bool _quick_ticks_running;
|
||||
static int32_t current_offset;
|
||||
|
||||
static void _handle_alarm_button(watch_date_time date_time, uint8_t current_page) {
|
||||
// handles short or long pressing of the alarm button
|
||||
@ -60,6 +61,7 @@ static void _handle_alarm_button(watch_date_time date_time, uint8_t current_page
|
||||
case 6: // time zone
|
||||
movement_set_timezone_index(movement_get_timezone_index() + 1);
|
||||
if (movement_get_timezone_index() >= NUM_ZONE_NAMES) movement_set_timezone_index(0);
|
||||
current_offset = movement_get_current_timezone_offset_for_zone(movement_get_timezone_index());
|
||||
break;
|
||||
}
|
||||
if (date_time.unit.day > days_in_month(date_time.unit.month, date_time.unit.year + WATCH_RTC_REFERENCE_YEAR))
|
||||
@ -83,6 +85,7 @@ void set_time_face_activate(void *context) {
|
||||
*((uint8_t *)context) = 0;
|
||||
movement_request_tick_frequency(4);
|
||||
_quick_ticks_running = false;
|
||||
current_offset = movement_get_current_timezone_offset();
|
||||
}
|
||||
|
||||
bool set_time_face_loop(movement_event_t event, void *context) {
|
||||
@ -145,11 +148,17 @@ bool set_time_face_loop(movement_event_t event, void *context) {
|
||||
sprintf(buf, "%2d%02d%02d", date_time.unit.year + 20, date_time.unit.month, date_time.unit.day);
|
||||
} else {
|
||||
watch_display_text(WATCH_POSITION_TOP_RIGHT, " Z");
|
||||
if (current_offset < 0) watch_display_text(WATCH_POSITION_TOP_LEFT, "- ");
|
||||
else watch_display_text(WATCH_POSITION_TOP_LEFT, "* ");
|
||||
if (event.subsecond % 2) {
|
||||
memset(buf, ' ', sizeof(buf));
|
||||
uint8_t hours = abs(current_offset) / 3600;
|
||||
uint8_t minutes = (abs(current_offset) % 3600) / 60;
|
||||
|
||||
sprintf(buf, "%2d%02d ", hours % 100, minutes % 100);
|
||||
watch_set_colon();
|
||||
} else {
|
||||
watch_display_text(WATCH_POSITION_TOP_LEFT, (char *) (zone_names + 11 * movement_get_timezone_index()));
|
||||
sprintf(buf, "%s", (char *) (3 + zone_names + 11 * movement_get_timezone_index()));
|
||||
watch_clear_colon();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user