summaryrefslogtreecommitdiff
path: root/boot/scene.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-10-01 19:13:27 -0600
committerTom Rini <trini@konsulko.com>2023-10-11 15:43:55 -0400
commitd88edd2bda2150b253fac702dd26ec4c01ccf988 (patch)
tree09e53e68c98f74c8b2960b383719570e6f5adefa /boot/scene.c
parent408011c2a4b7a7f68cf55876252446a570b3827a (diff)
expo: Allow highlighting other scene-object types
So far only menus can be highlighted. With the coming addition of text lines we need to be able to highlight other objects. Add a function to determine whether an object can be highlighted. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'boot/scene.c')
-rw-r--r--boot/scene.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/boot/scene.c b/boot/scene.c
index 8e5d3aa7dc0..4d7cabd75f4 100644
--- a/boot/scene.c
+++ b/boot/scene.c
@@ -516,7 +516,7 @@ static void send_key_obj(struct scene *scn, struct scene_obj *obj, int key,
sibling)) {
obj = list_entry(obj->sibling.prev,
struct scene_obj, sibling);
- if (obj->type == SCENEOBJT_MENU) {
+ if (scene_obj_can_highlight(obj)) {
event->type = EXPOACT_POINT_OBJ;
event->select.id = obj->id;
log_debug("up to obj %d\n", event->select.id);
@@ -528,7 +528,7 @@ static void send_key_obj(struct scene *scn, struct scene_obj *obj, int key,
while (!list_is_last(&obj->sibling, &scn->obj_head)) {
obj = list_entry(obj->sibling.next, struct scene_obj,
sibling);
- if (obj->type == SCENEOBJT_MENU) {
+ if (scene_obj_can_highlight(obj)) {
event->type = EXPOACT_POINT_OBJ;
event->select.id = obj->id;
log_debug("down to obj %d\n", event->select.id);
@@ -537,7 +537,7 @@ static void send_key_obj(struct scene *scn, struct scene_obj *obj, int key,
}
break;
case BKEY_SELECT:
- if (obj->type == SCENEOBJT_MENU) {
+ if (scene_obj_can_highlight(obj)) {
event->type = EXPOACT_OPEN;
event->select.id = obj->id;
log_debug("open obj %d\n", event->select.id);
@@ -685,12 +685,9 @@ void scene_highlight_first(struct scene *scn)
struct scene_obj *obj;
list_for_each_entry(obj, &scn->obj_head, sibling) {
- switch (obj->type) {
- case SCENEOBJT_MENU:
+ if (scene_obj_can_highlight(obj)) {
scene_set_highlight_id(scn, obj->id);
return;
- default:
- break;
}
}
}