[Concept,06/16] expo: Allow applying the theme to just the display

Message ID 20251014111301.1059317-7-sjg@chromium.org
State New
Headers
Series boot: Separate out the boot-menu style |

Commit Message

Simon Glass Oct. 14, 2025, 11:12 a.m. UTC
  In some cases it is useful to apply the display-related theme elements
without touching the objects. Add an argument to expo_apply_theme() to
support this.

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

 boot/expo.c    | 16 +++++++++-------
 include/expo.h |  3 ++-
 2 files changed, 11 insertions(+), 8 deletions(-)
  

Patch

diff --git a/boot/expo.c b/boot/expo.c
index 432e81d3552..30f3cbeb9ef 100644
--- a/boot/expo.c
+++ b/boot/expo.c
@@ -432,7 +432,7 @@  int expo_action_get(struct expo *exp, struct expo_action *act)
 	return act->type == EXPOACT_NONE ? -EAGAIN : 0;
 }
 
-int expo_apply_theme(struct expo *exp)
+int expo_apply_theme(struct expo *exp, bool do_objs)
 {
 	struct expo_theme *theme = &exp->theme;
 	struct scene *scn;
@@ -440,12 +440,14 @@  int expo_apply_theme(struct expo *exp)
 	if (exp->display)
 		video_set_white_on_black(exp->display, theme->white_on_black);
 
-	list_for_each_entry(scn, &exp->scene_head, sibling) {
-		int ret;
+	if (do_objs) {
+		list_for_each_entry(scn, &exp->scene_head, sibling) {
+			int ret;
 
-		ret = scene_apply_theme(scn, theme);
-		if (ret)
-			return log_msg_ret("asn", ret);
+			ret = scene_apply_theme(scn, theme);
+			if (ret)
+				return log_msg_ret("asn", ret);
+		}
 	}
 
 	return 0;
@@ -468,7 +470,7 @@  int expo_setup_theme(struct expo *exp, ofnode node)
 			&theme->textline_label_margin_x);
 	theme->white_on_black = ofnode_read_bool(node, "white-on-black");
 
-	ret = expo_apply_theme(exp);
+	ret = expo_apply_theme(exp, true);
 	if (ret)
 		return log_msg_ret("asn", ret);
 
diff --git a/include/expo.h b/include/expo.h
index 7307c3aef98..454889d5db9 100644
--- a/include/expo.h
+++ b/include/expo.h
@@ -1163,9 +1163,10 @@  int expo_setup_theme(struct expo *exp, ofnode node);
  * The theme to be applied must be set up exp->theme
  *
  * @exp: Expo to update
+ * @do_objs: Apply theme to objects as well (normally this should be true)
  * Returns: 0 if OK, -ve on error
  */
-int expo_apply_theme(struct expo *exp);
+int expo_apply_theme(struct expo *exp, bool do_objs);
 
 /**
  * expo_build() - Build an expo from an FDT description