Skip to content

Commit

Permalink
ui: center align text in ui_pr_err
Browse files Browse the repository at this point in the history
When mute is active during boot, we use ui_pr_err to inform the user
that unmute is required to continue. At this point, lbl_ln3 text is
center aligned, but lbl_ln4 text is left aligned.

As we want the error messages to draw attention, let's always center
align text in those 2 labels in ui_pr_err.
  • Loading branch information
stintel committed Nov 22, 2023
1 parent 487eb7f commit c20f536
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main/ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,14 @@ void ui_pr_err(char *ln3, char *ln4)
lv_obj_add_flag(lbl_ln3, LV_OBJ_FLAG_HIDDEN);
} else {
lv_label_set_text(lbl_ln3, ln3);
lv_obj_set_style_text_align(lbl_ln3, LV_TEXT_ALIGN_CENTER, 0);
lv_obj_clear_flag(lbl_ln3, LV_OBJ_FLAG_HIDDEN);
}
if (ln4 == NULL) {
lv_obj_add_flag(lbl_ln4, LV_OBJ_FLAG_HIDDEN);
} else {
lv_label_set_text(lbl_ln4, ln4);
lv_obj_set_style_text_align(lbl_ln4, LV_TEXT_ALIGN_CENTER, 0);
lv_obj_clear_flag(lbl_ln4, LV_OBJ_FLAG_HIDDEN);
}

Expand Down

0 comments on commit c20f536

Please sign in to comment.