diff --git a/src/displayapp/screens/Navigation.cpp b/src/displayapp/screens/Navigation.cpp index ee9f2a0002..ee4b586bb2 100644 --- a/src/displayapp/screens/Navigation.cpp +++ b/src/displayapp/screens/Navigation.cpp @@ -200,35 +200,37 @@ Navigation::Navigation(Pinetime::Controllers::NavigationService& nav) : navServi lv_img_set_offset_y(imgFlag, image.offset); lv_obj_set_style_local_image_recolor_opa(imgFlag, LV_IMG_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_COVER); lv_obj_set_style_local_image_recolor(imgFlag, LV_IMG_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_CYAN); - lv_obj_align(imgFlag, nullptr, LV_ALIGN_CENTER, 0, -60); - - txtNarrative = lv_label_create(lv_scr_act(), nullptr); - lv_label_set_long_mode(txtNarrative, LV_LABEL_LONG_DOT); - lv_obj_set_width(txtNarrative, LV_HOR_RES); - lv_obj_set_height(txtNarrative, 80); - lv_label_set_text_static(txtNarrative, "Navigation"); - lv_label_set_align(txtNarrative, LV_LABEL_ALIGN_CENTER); - lv_obj_align(txtNarrative, nullptr, LV_ALIGN_CENTER, 0, 30); + lv_obj_align(imgFlag, nullptr, LV_ALIGN_IN_TOP_MID, 0, 2); txtManDist = lv_label_create(lv_scr_act(), nullptr); lv_label_set_long_mode(txtManDist, LV_LABEL_LONG_BREAK); - lv_obj_set_style_local_text_color(txtManDist, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GREEN); + lv_obj_set_style_local_text_color(txtManDist, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_YELLOW); lv_obj_set_style_local_text_font(txtManDist, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_42); lv_obj_set_width(txtManDist, LV_HOR_RES); lv_label_set_text_static(txtManDist, "--M"); lv_label_set_align(txtManDist, LV_LABEL_ALIGN_CENTER); - lv_obj_align(txtManDist, nullptr, LV_ALIGN_CENTER, 0, 90); + lv_obj_align(txtManDist, imgFlag, LV_ALIGN_OUT_BOTTOM_MID, 0, 2); // Route Progress barProgress = lv_bar_create(lv_scr_act(), nullptr); - lv_obj_set_size(barProgress, 200, 20); - lv_obj_align(barProgress, nullptr, LV_ALIGN_IN_BOTTOM_MID, 0, -10); + lv_obj_set_size(barProgress, LV_HOR_RES - 4, 20); + lv_obj_align(barProgress, nullptr, LV_ALIGN_IN_BOTTOM_MID, 0, -2); lv_obj_set_style_local_bg_color(barProgress, LV_BAR_PART_BG, LV_STATE_DEFAULT, lv_color_hex(0x222222)); lv_obj_set_style_local_bg_color(barProgress, LV_BAR_PART_INDIC, LV_STATE_DEFAULT, LV_COLOR_ORANGE); lv_bar_set_anim_time(barProgress, 500); lv_bar_set_range(barProgress, 0, 100); lv_bar_set_value(barProgress, 0, LV_ANIM_OFF); + txtNarrative = lv_label_create(lv_scr_act(), nullptr); + lv_label_set_long_mode(txtNarrative, LV_LABEL_LONG_DOT); + lv_obj_set_width(txtNarrative, LV_HOR_RES); + lv_label_set_text(txtNarrative, "Navigation"); + lv_label_set_align(txtNarrative, LV_LABEL_ALIGN_CENTER); + lv_obj_align(txtNarrative, txtManDist, LV_ALIGN_OUT_BOTTOM_MID, 0, 2); + + // Set Narrative-height dynamically by progress-bar-y with 2px distance added + lv_obj_set_height(txtNarrative, lv_obj_get_y(barProgress) - lv_obj_get_y(txtNarrative) - 2); + taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this); }