[Concept,16/24] bootctl: Re-apply the theme when showing the UI

Message ID 20251018084117.1798704-17-sjg@u-boot.org
State New
Headers
Series bootctl: Expand bootctl to include a new UI |

Commit Message

Simon Glass Oct. 18, 2025, 8:41 a.m. UTC
  From: Simon Glass <sjg@chromium.org>

If a different UI is used then the theme may have changed, so re-apply
the theme when showing the UI.

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

 boot/bootctl/simple_ui.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)
  

Patch

diff --git a/boot/bootctl/simple_ui.c b/boot/bootctl/simple_ui.c
index 3ef00651c05..7fb59c8b8c3 100644
--- a/boot/bootctl/simple_ui.c
+++ b/boot/bootctl/simple_ui.c
@@ -60,6 +60,7 @@  static int simple_ui_show(struct udevice *dev)
 {
 	struct bc_ui_priv *upriv = dev_get_uclass_priv(dev);
 	struct logic_priv *lpriv = upriv->lpriv;
+	struct expo_theme *theme;
 	struct bootstd_priv *std;
 	struct scene *scn;
 	struct abuf *buf;
@@ -107,6 +108,12 @@  static int simple_ui_show(struct udevice *dev)
 		if (ret)
 			return log_msg_ret("thm", ret);
 	}
+	theme = &upriv->expo->theme;
+	theme->white_on_black = true;
+
+	ret = expo_apply_theme(upriv->expo, true);
+	if (ret)
+		return log_msg_ret("asn", ret);
 
 	ret = scene_arrange(scn);
 	if (ret)
@@ -144,11 +151,11 @@  static int simple_ui_add(struct udevice *dev, struct osinfo *info)
 	ret = bootstd_get_priv(&std);
 	if (ret)
 		return log_msg_ret("sup", ret);
-	if (ofnode_valid(std->theme)) {
-		ret = expo_setup_theme(upriv->expo, std->theme);
-		if (ret)
-			return log_msg_ret("thm", ret);
-	}
+
+	ret = expo_apply_theme(upriv->expo, true);
+	if (ret)
+		return log_msg_ret("asn", ret);
+
 	ret = expo_calc_dims(upriv->expo);
 	if (ret)
 		return log_msg_ret("ecd", ret);