diff --git a/src/c/main.c b/src/c/main.c index 293a6c8..1e8a1a7 100644 --- a/src/c/main.c +++ b/src/c/main.c @@ -607,17 +607,23 @@ static void alarm_window_load() { (WindowHandlers){.load = drop_menu_window_load, .unload = drop_menu_window_unload}); // countdown + s_countdown_txt_layer = text_layer_create(GRect(0, (s_small_top_bar_height / 2) - PBL_IF_ROUND_ELSE(6, 10), PBL_DISPLAY_WIDTH, s_small_top_bar_height)); + text_layer_set_background_color(s_countdown_txt_layer, GColorClear); + text_layer_set_text_color(s_countdown_txt_layer, GColorWhite); + text_layer_set_text_alignment(s_countdown_txt_layer, GTextAlignmentCenter); + // this code forces recovery alarms to act as main alarms, even if the force quit was an awareness alarm; + // this is a "bug" I'm willing to accept for the sake of simplicity - all it does is punish the user more + // for force-quitting if (s_alarm_reason == WAKE_AWARENESS_ALARM) { - s_countdown_txt_layer = text_layer_create(GRect(0, (s_small_top_bar_height / 2) - PBL_IF_ROUND_ELSE(6, 10), PBL_DISPLAY_WIDTH, s_small_top_bar_height)); - text_layer_set_background_color(s_countdown_txt_layer, GColorClear); - text_layer_set_text_color(s_countdown_txt_layer, GColorWhite); - text_layer_set_text_alignment(s_countdown_txt_layer, GTextAlignmentCenter); text_layer_set_font(s_countdown_txt_layer, s_font_lecoish_small); s_awareness_countdown_int = settings.AwarenessTimeLimitSeconds; snprintf(s_awareness_countdown_buf, sizeof(s_awareness_countdown_buf), "%03u", s_awareness_countdown_int); text_layer_set_text(s_countdown_txt_layer, s_awareness_countdown_buf); - layer_add_child(window_layer, text_layer_get_layer(s_countdown_txt_layer)); + } else { + text_layer_set_font(s_countdown_txt_layer, s_font_mansalva_small); + text_layer_set_text(s_countdown_txt_layer, "🏁 hold select 🏁"); } + layer_add_child(window_layer, text_layer_get_layer(s_countdown_txt_layer)); // setup vibes s_vibe_segments[0] = (uint32_t)(s_triangle_layer->angle_A * 2); @@ -640,9 +646,7 @@ static void alarm_window_load() { static void alarm_window_unload() { tick_timer_service_unsubscribe(); - if (s_countdown_txt_layer != NULL) { - text_layer_destroy(s_countdown_txt_layer); - } + text_layer_destroy(s_countdown_txt_layer); window_destroy(s_drop_window); text_layer_destroy(s_side_a_txt_layer); text_layer_destroy(s_side_b_txt_layer);