]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
expo: Drop the special theme code for bootflow_menu
authorSimon Glass <sjg@chromium.org>
Fri, 2 May 2025 14:46:58 +0000 (08:46 -0600)
committerSimon Glass <sjg@chromium.org>
Fri, 30 May 2025 08:49:33 +0000 (09:49 +0100)
The expo now has all that is needed to apply a suitable theme, so drop
this unnecessary code. Any further tweaks can be added to the generic
expo code.

Signed-off-by: Simon Glass <sjg@chromium.org>
boot/bootflow_menu.c
test/boot/bootflow.c

index 43f074f19f5c3889173a13c226db540a6caa735d..4a442e168507c07c0efc28ea12f3426bcc66b396 100644 (file)
@@ -215,43 +215,6 @@ int bootflow_menu_add_all(struct expo *exp)
        return 0;
 }
 
-int bootflow_menu_apply_theme(struct expo *exp, ofnode node)
-{
-       struct menu_priv *priv = exp->priv;
-       struct scene *scn;
-       u32 font_size;
-       int ret;
-
-       log_debug("Applying theme %s\n", ofnode_get_name(node));
-       scn = expo_lookup_scene_id(exp, MAIN);
-       if (!scn)
-               return log_msg_ret("scn", -ENOENT);
-
-       /* Avoid error-checking optional items */
-       if (!ofnode_read_u32(node, "font-size", &font_size)) {
-               int i;
-
-               log_debug("font size %d\n", font_size);
-               scene_txt_set_font(scn, OBJ_PROMPT1A, NULL, font_size);
-               scene_txt_set_font(scn, OBJ_POINTER, NULL, font_size);
-               for (i = 0; i < priv->num_bootflows; i++) {
-                       ret = scene_txt_set_font(scn, ITEM_DESC + i, NULL,
-                                                font_size);
-                       if (ret)
-                               return log_msg_ret("des", ret);
-                       scene_txt_set_font(scn, ITEM_KEY + i, NULL, font_size);
-                       scene_txt_set_font(scn, ITEM_LABEL + i, NULL,
-                                          font_size);
-               }
-       }
-
-       ret = scene_arrange(scn);
-       if (ret)
-               return log_msg_ret("arr", ret);
-
-       return 0;
-}
-
 int bootflow_menu_setup(struct bootstd_priv *std, bool text_mode,
                        struct expo **expp)
 {
@@ -263,12 +226,6 @@ int bootflow_menu_setup(struct bootstd_priv *std, bool text_mode,
        if (ret)
                return log_msg_ret("bmn", ret);
 
-       if (ofnode_valid(std->theme)) {
-               ret = bootflow_menu_apply_theme(exp, std->theme);
-               if (ret)
-                       return log_msg_ret("thm", ret);
-       }
-
        /* For now we only support a video console */
        ret = uclass_first_device_err(UCLASS_VIDEO, &dev);
        if (ret)
index 6eeb59aaa46add62614a3149bc9d28a698be1781..8de5a310add38798f3a52ea6cd796bdffdb16bd6 100644 (file)
@@ -881,7 +881,7 @@ static int bootflow_menu_theme(struct unit_test_state *uts)
        ut_assertok(bootflow_menu_add_all(exp));
        node = ofnode_path("/bootstd/theme");
        ut_assert(ofnode_valid(node));
-       ut_assertok(bootflow_menu_apply_theme(exp, node));
+       ut_assertok(expo_apply_theme(exp, node));
 
        scn = expo_lookup_scene_id(exp, MAIN);
        ut_assertnonnull(scn);
@@ -892,8 +892,8 @@ static int bootflow_menu_theme(struct unit_test_state *uts)
         *
         * Check both menu items, since there are two bootflows
         */
-       ut_assertok(check_font(uts, scn, OBJ_PROMPT1A, font_size));
-       ut_assertok(check_font(uts, scn, OBJ_POINTER, font_size));
+       for (i = OBJ_PROMPT1A; i <= OBJ_AUTOBOOT; i++)
+               ut_assertok(check_font(uts, scn, i, font_size));
        for (i = 0; i < 2; i++) {
                ut_assertok(check_font(uts, scn, ITEM_DESC + i, font_size));
                ut_assertok(check_font(uts, scn, ITEM_KEY + i, font_size));