From 5ea2b533ed037b8f6f89c33f13dcf6188ba9162d Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 2 May 2025 08:46:36 -0600 Subject: expo: Line up all menu objects At present labels are lined up vertically. Do the same with keys and descriptions, since it looks nicer. Signed-off-by: Simon Glass --- boot/scene_menu.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'boot') diff --git a/boot/scene_menu.c b/boot/scene_menu.c index e99f4426281..96ac726ebcd 100644 --- a/boot/scene_menu.c +++ b/boot/scene_menu.c @@ -190,14 +190,20 @@ int scene_menu_calc_dims(struct scene_obj_menu *menu) scene_menu_calc_bbox(menu, bbox); - /* Make all labels the same size */ - cur = &bbox[SCENEBB_label]; - if (cur->valid) { - list_for_each_entry(item, &menu->item_head, sibling) { - scene_obj_set_size(menu->obj.scene, item->label_id, - cur->x1 - cur->x0, - cur->y1 - cur->y0); - } + /* Make all field types the same width */ + list_for_each_entry(item, &menu->item_head, sibling) { + cur = &bbox[SCENEBB_label]; + if (cur->valid) + scene_obj_set_width(menu->obj.scene, item->label_id, + cur->x1 - cur->x0); + cur = &bbox[SCENEBB_key]; + if (cur->valid) + scene_obj_set_width(menu->obj.scene, item->key_id, + cur->x1 - cur->x0); + cur = &bbox[SCENEBB_desc]; + if (cur->valid) + scene_obj_set_width(menu->obj.scene, item->desc_id, + cur->x1 - cur->x0); } cur = &bbox[SCENEBB_all]; -- cgit v1.3.1