summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShelley Chen <shchen@chromium.org>2017-02-27 15:58:22 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-03-02 22:02:21 -0800
commit50d1282e856953616d3d3e7be31aa0f9fefd0f9a (patch)
treeca8374390b111826c60354bd067916870aafd71d
parent97a8aa97c3e73d6a9ce2b305920413a042d74351 (diff)
downloadvboot-stabilize-M58-9334.41.0.B.tar.gz
BUG=b:35585623 BRANCH=None TEST=reboot and make sure menu is centered in fw screen CQ-DEPEND=CL:447818 Change-Id: I7ce5063adab978338af18ad2befe65107fdea21f Signed-off-by: Shelley Chen <shchen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/447838 Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--firmware/lib/vboot_ui_menu.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/firmware/lib/vboot_ui_menu.c b/firmware/lib/vboot_ui_menu.c
index ee81c29d..2e4975f1 100644
--- a/firmware/lib/vboot_ui_menu.c
+++ b/firmware/lib/vboot_ui_menu.c
@@ -332,12 +332,16 @@ VbError_t vb2_print_current_menu()
static char **m = NULL;
int highlight = 0;
// TODO: We probably want to center this text.
- int xindex = 50;
- int yindex = 30;
+ uint32_t xindex, yindex;
// TODO: need to check for error code.
vb2_get_current_menu_size(current_menu, &m, &size);
+ /* Center block of text */
+ VbExDisplayGetDimension(&xindex, &yindex);
+ xindex = xindex/2 - strlen(m[0])/2;
+ yindex = yindex/2 - size/2;
+
// TODO: do clear screen here.
/* Create menu string */
for (i = 0; i < size; i++) {