Update font and positioning for top bar clock/progress indicator
This commit is contained in:
1 parent
e09b719615
commit
5e1ef0b110
1 file changed
+14
-7
+14
-7
@@ -880,13 +880,20 @@ static void alarm_window_load() {
|
||||
s_drop_window,
|
||||
(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)
|
||||
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_text_color(s_clock_txt_layer, GColorWhite);
|
||||
text_layer_set_text_alignment(s_clock_txt_layer, GTextAlignmentCenter);
|
||||
text_layer_set_font(s_clock_txt_layer, fonts_get_system_font(FONT_KEY_LECO_20_BOLD_NUMBERS));
|
||||
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_GOTHIC_18_BOLD));
|
||||
layer_add_child(window_layer, text_layer_get_layer(s_clock_txt_layer));
|
||||
|
||||
// countdown
|
||||
@@ -898,11 +905,11 @@ static void alarm_window_load() {
|
||||
layer_add_child(window_layer, text_layer_get_layer(s_countdown_txt_layer));
|
||||
|
||||
// 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_text_color(s_progress_txt_layer, GColorWhite);
|
||||
text_layer_set_text_alignment(s_progress_txt_layer, GTextAlignmentCenter);
|
||||
text_layer_set_font(s_progress_txt_layer, fonts_get_system_font(FONT_KEY_LECO_20_BOLD_NUMBERS));
|
||||
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_GOTHIC_18_BOLD));
|
||||
layer_add_child(window_layer, text_layer_get_layer(s_progress_txt_layer));
|
||||
|
||||
// door layers
|
||||
|
||||
Reference in new issue
Block a user