mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-05-05 04:36:13 +02:00
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 <sjg@chromium.org>
This commit is contained in:
parent
e3c3f83cb6
commit
5ea2b533ed
@ -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];
|
||||
|
||||
@ -576,6 +576,36 @@ static int expo_render_image(struct unit_test_state *uts)
|
||||
ut_asserteq(50 + 29, obj->bbox.x1);
|
||||
ut_asserteq(454 + 18, obj->bbox.y1);
|
||||
|
||||
/* same for the key */
|
||||
obj = scene_obj_find(scn, ITEM1_KEY, SCENEOBJT_NONE);
|
||||
ut_assertnonnull(obj);
|
||||
ut_asserteq(280, obj->bbox.x0);
|
||||
ut_asserteq(436, obj->bbox.y0);
|
||||
ut_asserteq(280 + 9, obj->bbox.x1);
|
||||
ut_asserteq(436 + 18, obj->bbox.y1);
|
||||
|
||||
obj = scene_obj_find(scn, ITEM2_KEY, SCENEOBJT_NONE);
|
||||
ut_assertnonnull(obj);
|
||||
ut_asserteq(280, obj->bbox.x0);
|
||||
ut_asserteq(454, obj->bbox.y0);
|
||||
ut_asserteq(280 + 9, obj->bbox.x1);
|
||||
ut_asserteq(454 + 18, obj->bbox.y1);
|
||||
|
||||
/* and the description */
|
||||
obj = scene_obj_find(scn, ITEM1_DESC, SCENEOBJT_NONE);
|
||||
ut_assertnonnull(obj);
|
||||
ut_asserteq(330, obj->bbox.x0);
|
||||
ut_asserteq(436, obj->bbox.y0);
|
||||
ut_asserteq(330 + 89, obj->bbox.x1);
|
||||
ut_asserteq(436 + 18, obj->bbox.y1);
|
||||
|
||||
obj = scene_obj_find(scn, ITEM2_DESC, SCENEOBJT_NONE);
|
||||
ut_assertnonnull(obj);
|
||||
ut_asserteq(330, obj->bbox.x0);
|
||||
ut_asserteq(454, obj->bbox.y0);
|
||||
ut_asserteq(330 + 89, obj->bbox.x1);
|
||||
ut_asserteq(454 + 18, obj->bbox.y1);
|
||||
|
||||
/* check dimensions of menu */
|
||||
obj = scene_obj_find(scn, OBJ_MENU, SCENEOBJT_NONE);
|
||||
ut_assertnonnull(obj);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user