Apply the theme, calculate dimensions, highlight the menu and arrange
the scene correctly, so that everything is ready to go when the expo
is rendered.

Signed-off-by: Simon Glass <s...@chromium.org>
---

 boot/bootflow_menu.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/boot/bootflow_menu.c b/boot/bootflow_menu.c
index 4fe5d985064..03ea24f4778 100644
--- a/boot/bootflow_menu.c
+++ b/boot/bootflow_menu.c
@@ -208,10 +208,6 @@ int bootflow_menu_add_all(struct expo *exp)
                LOGR("bao", bootflow_menu_add(exp, bflow, i, &scn));
        }
 
-       ret = scene_arrange(scn);
-       if (ret)
-               return log_msg_ret("arr", ret);
-
        return 0;
 }
 
@@ -290,7 +286,9 @@ int bootflow_menu_setup(struct bootstd_priv *std, bool 
text_mode,
 int bootflow_menu_start(struct bootstd_priv *std, bool text_mode,
                        struct expo **expp)
 {
+       struct scene *scn;
        struct expo *exp;
+       uint scene_id;
        int ret;
 
        LOGR("bmn", bootflow_menu_setup(std, text_mode, &exp));
@@ -305,6 +303,18 @@ int bootflow_menu_start(struct bootstd_priv *std, bool 
text_mode,
 
        LOGR("bmd", expo_calc_dims(exp));
 
+       ret = expo_first_scene_id(exp);
+       if (ret < 0)
+               return log_msg_ret("scn", ret);
+       scene_id = ret;
+       scn = expo_lookup_scene_id(exp, scene_id);
+
+       scene_set_highlight_id(scn, OBJ_MENU);
+
+       ret = scene_arrange(scn);
+       if (ret)
+               return log_msg_ret("arr", ret);
+
        *expp = exp;
 
        return 0;
-- 
2.43.0

Reply via email to