expo: Allow manual positioning of menu items
Sometimes we want to position items individually rather than relying on the automatic scene layout. Provide a flag for this, expanding the type to cope. Also add an assertion that the flags fit in the available space. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
14
boot/scene.c
14
boot/scene.c
@@ -359,6 +359,18 @@ int scene_obj_set_hide(struct scene *scn, uint id, bool hide)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int scene_obj_set_manual(struct scene *scn, uint id, bool manual)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = scene_obj_flag_clrset(scn, id, SCENEOF_MANUAL,
|
||||
manual ? SCENEOF_MANUAL : 0);
|
||||
if (ret)
|
||||
return log_msg_ret("fla", ret);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int scene_obj_flag_clrset(struct scene *scn, uint id, uint clr, uint set)
|
||||
{
|
||||
struct scene_obj *obj;
|
||||
@@ -810,6 +822,8 @@ int scene_arrange(struct scene *scn)
|
||||
handle_alignment(obj->horiz, obj->vert, &obj->bbox, &obj->dims,
|
||||
xsize, ysize, &obj->ofs);
|
||||
|
||||
if (obj->flags & SCENEOF_MANUAL)
|
||||
continue;
|
||||
switch (obj->type) {
|
||||
case SCENEOBJT_NONE:
|
||||
case SCENEOBJT_IMAGE:
|
||||
|
||||
Reference in New Issue
Block a user