expo: Support highlighting menu items
Expo normally uses a pointer to show the current item. Add support for
highlighting as well, since this makes it easier for the user to see the
current item.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/boot/scene_menu.c b/boot/scene_menu.c
index de433ec..8db6a2b 100644
--- a/boot/scene_menu.c
+++ b/boot/scene_menu.c
@@ -87,7 +87,7 @@
static int update_pointers(struct scene_obj_menu *menu, uint id, bool point)
{
struct scene *scn = menu->obj.scene;
- const bool stack = scn->expo->popup;
+ const bool stack = scn->expo->show_highlight;
const struct scene_menitem *item;
int ret;
@@ -108,9 +108,17 @@
}
if (stack) {
+ uint id;
+ int val;
+
point &= scn->highlight_id == menu->obj.id;
- scene_obj_flag_clrset(scn, item->label_id, SCENEOF_POINT,
- point ? SCENEOF_POINT : 0);
+ val = point ? SCENEOF_POINT : 0;
+ id = item->desc_id;
+ if (!id)
+ id = item->label_id;
+ if (!id)
+ id = item->key_id;
+ scene_obj_flag_clrset(scn, id, SCENEOF_POINT, val);
}
return 0;