Update font and positioning for top bar clock/progress indicator

This commit is contained in:
RandyTheSilly committed 2026-11-12 18:24:58 -05:00
1 parent e09b719615
commit 5e1ef0b110
1 file changed
+14 -7
+14 -7
View File
@@ -880,13 +880,20 @@ static void alarm_window_load() {
s_drop_window, s_drop_window,
(WindowHandlers){.load = drop_menu_window_load, .unload = drop_menu_window_unload}); (WindowHandlers){.load = drop_menu_window_load, .unload = drop_menu_window_unload});
// clock // clock
#ifdef PBL_ROUND
#define TOP_BAR_ITEM_X_OFFSET -8
#define TOP_BAR_ITEM_Y_OFFSET 14
#else
#define TOP_BAR_ITEM_X_OFFSET 0
#define TOP_BAR_ITEM_Y_OFFSET 4
#endif
static const uint16_t s_top_bar_edge_margin = (PBL_DISPLAY_WIDTH - 44) / 2; // 44 is the width of the countdown ((3*16)-4) static const uint16_t s_top_bar_edge_margin = (PBL_DISPLAY_WIDTH - 44) / 2; // 44 is the width of the countdown ((3*16)-4)
s_clock_txt_layer = text_layer_create(GRect(0, 4, s_top_bar_edge_margin, s_small_top_bar_height)); s_clock_txt_layer = text_layer_create(GRect(TOP_BAR_ITEM_X_OFFSET, TOP_BAR_ITEM_Y_OFFSET, s_top_bar_edge_margin, s_small_top_bar_height));
text_layer_set_background_color(s_clock_txt_layer, GColorClear); text_layer_set_background_color(s_clock_txt_layer, GColorClear);
text_layer_set_text_color(s_clock_txt_layer, GColorWhite); text_layer_set_text_color(s_clock_txt_layer, GColorWhite);
text_layer_set_text_alignment(s_clock_txt_layer, GTextAlignmentCenter); text_layer_set_text_alignment(s_clock_txt_layer, PBL_IF_ROUND_ELSE(GTextAlignmentRight, GTextAlignmentCenter));
text_layer_set_font(s_clock_txt_layer, fonts_get_system_font(FONT_KEY_LECO_20_BOLD_NUMBERS)); text_layer_set_font(s_clock_txt_layer, fonts_get_system_font(FONT_KEY_GOTHIC_18_BOLD));
layer_add_child(window_layer, text_layer_get_layer(s_clock_txt_layer)); layer_add_child(window_layer, text_layer_get_layer(s_clock_txt_layer));
// countdown // countdown
@@ -898,11 +905,11 @@ static void alarm_window_load() {
layer_add_child(window_layer, text_layer_get_layer(s_countdown_txt_layer)); layer_add_child(window_layer, text_layer_get_layer(s_countdown_txt_layer));
// progress // progress
s_progress_txt_layer = text_layer_create(GRect(PBL_DISPLAY_WIDTH - s_top_bar_edge_margin, 4, s_top_bar_edge_margin, s_small_top_bar_height)); s_progress_txt_layer = text_layer_create(GRect(PBL_DISPLAY_WIDTH - s_top_bar_edge_margin - TOP_BAR_ITEM_X_OFFSET, TOP_BAR_ITEM_Y_OFFSET, s_top_bar_edge_margin, s_small_top_bar_height));
text_layer_set_background_color(s_progress_txt_layer, GColorClear); text_layer_set_background_color(s_progress_txt_layer, GColorClear);
text_layer_set_text_color(s_progress_txt_layer, GColorWhite); text_layer_set_text_color(s_progress_txt_layer, GColorWhite);
text_layer_set_text_alignment(s_progress_txt_layer, GTextAlignmentCenter); text_layer_set_text_alignment(s_progress_txt_layer, PBL_IF_ROUND_ELSE(GTextAlignmentLeft, GTextAlignmentCenter));
text_layer_set_font(s_progress_txt_layer, fonts_get_system_font(FONT_KEY_LECO_20_BOLD_NUMBERS)); text_layer_set_font(s_progress_txt_layer, fonts_get_system_font(FONT_KEY_GOTHIC_18_BOLD));
layer_add_child(window_layer, text_layer_get_layer(s_progress_txt_layer)); layer_add_child(window_layer, text_layer_get_layer(s_progress_txt_layer));
// door layers // door layers