expo: Move menu-item selection into a function

The current implementation supports a 'pointer' object which points to
the currently highlighted menu item. We want to support highlighting the
label of the menu item instead, e.g. with inverse video. In this case we
will need to 'unhighlight' the old item and highlight the new one.

As a first step, move the pointer logic into a function. This fixes a
bug where the item is hidden when it should not be.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2023-06-01 10:22:54 -06:00
committed by Tom Rini
parent 2e59389704
commit 8872bc7f9d
2 changed files with 55 additions and 14 deletions

View File

@@ -378,7 +378,7 @@ static int expo_object_menu(struct unit_test_state *uts)
ut_asserteq(-4, prev1->obj.dim.x);
ut_asserteq(menu->obj.dim.y + 32, prev1->obj.dim.y);
ut_asserteq(false, prev1->obj.flags & SCENEOF_HIDE);
ut_asserteq(true, prev1->obj.flags & SCENEOF_HIDE);
expo_destroy(exp);