set date first, then time zone, then time
This commit is contained in:
parent
60914647b1
commit
55df80c3d9
@ -30,8 +30,8 @@
|
||||
#include "zones.h"
|
||||
|
||||
#define SET_TIME_FACE_NUM_SETTINGS (7)
|
||||
const char set_time_face_titles[SET_TIME_FACE_NUM_SETTINGS][6] = {" ", "Year ", "Month", "Day ", "Hour ", "Minut", "Secnd"};
|
||||
const char set_time_face_fallback_titles[SET_TIME_FACE_NUM_SETTINGS][3] = {" ", "YR", "MO", "DA", "HR", "M1", "SE"};
|
||||
const char set_time_face_titles[SET_TIME_FACE_NUM_SETTINGS][6] = {"Year ", "Month", "Day ", " ", "Hour ", "Minut", "Secnd"};
|
||||
const char set_time_face_fallback_titles[SET_TIME_FACE_NUM_SETTINGS][3] = {"YR", "MO", "DA", " ", "HR", "M1", "SE"};
|
||||
|
||||
static bool _quick_ticks_running;
|
||||
static int32_t current_offset;
|
||||
@ -40,18 +40,18 @@ static void _handle_alarm_button(watch_date_time_t date_time, uint8_t current_pa
|
||||
// handles short or long pressing of the alarm button
|
||||
|
||||
switch (current_page) {
|
||||
case 0: // time zone
|
||||
case 3: // 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;
|
||||
case 1: // year
|
||||
case 0: // year
|
||||
date_time.unit.year = ((date_time.unit.year % 60) + 1);
|
||||
break;
|
||||
case 2: // month
|
||||
case 1: // month
|
||||
date_time.unit.month = (date_time.unit.month % 12) + 1;
|
||||
break;
|
||||
case 3: { // day
|
||||
case 2: { // day
|
||||
date_time.unit.day = (date_time.unit.day % watch_utility_days_in_month(date_time.unit.month, date_time.unit.year + WATCH_RTC_REFERENCE_YEAR)) + 1;
|
||||
break;
|
||||
case 4: // hour
|
||||
@ -130,7 +130,7 @@ bool set_time_face_loop(movement_event_t event, void *context) {
|
||||
char buf[11];
|
||||
watch_display_text(WATCH_POSITION_TOP_RIGHT, " ");
|
||||
watch_display_text_with_fallback(WATCH_POSITION_TOP, (char *) set_time_face_titles[current_page], (char *) set_time_face_fallback_titles[current_page]);
|
||||
if (current_page < 1) {
|
||||
if (current_page == 3) {
|
||||
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, "* ");
|
||||
@ -144,7 +144,7 @@ bool set_time_face_loop(movement_event_t event, void *context) {
|
||||
sprintf(buf, "%s", watch_utility_time_zone_name_at_index(movement_get_timezone_index()));
|
||||
watch_clear_colon();
|
||||
}
|
||||
} else if (current_page < 4) {
|
||||
} else if (current_page < 3) {
|
||||
watch_clear_colon();
|
||||
watch_clear_indicator(WATCH_INDICATOR_24H);
|
||||
watch_clear_indicator(WATCH_INDICATOR_PM);
|
||||
@ -166,15 +166,15 @@ bool set_time_face_loop(movement_event_t event, void *context) {
|
||||
// blink up the parameter we're setting
|
||||
if (event.subsecond % 2 && !_quick_ticks_running) {
|
||||
switch (current_page) {
|
||||
case 1:
|
||||
case 0:
|
||||
case 4:
|
||||
watch_display_text(WATCH_POSITION_HOURS, " ");
|
||||
break;
|
||||
case 2:
|
||||
case 1:
|
||||
case 5:
|
||||
watch_display_text(WATCH_POSITION_MINUTES, " ");
|
||||
break;
|
||||
case 3:
|
||||
case 2:
|
||||
case 6:
|
||||
watch_display_text(WATCH_POSITION_SECONDS, " ");
|
||||
break;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user