diff --git a/examples/13_theming.py b/examples/13_theming.py index 3101e9be2..2eaa93b3b 100644 --- a/examples/13_theming.py +++ b/examples/13_theming.py @@ -51,8 +51,11 @@ brand_color = server.add_gui_rgb("Brand color", (230, 180, 30)) synchronize = server.add_gui_button("Apply theme", icon=viser.Icon.CHECK) +gui_theme_code = server.add_gui_markdown("no theme applied yet") + def synchronize_theme() -> None: + global gui_theme_code server.configure_theme( dark_mode=dark_mode.value, titlebar_content=titlebar_theme if titlebar.value else None, @@ -61,6 +64,21 @@ def synchronize_theme() -> None: ) server.world_axes.visible = True + gui_theme_code.remove() + gui_theme_code = server.add_gui_markdown( + f""" + ### Current applied theme + ``` + server.configure_theme( + dark_mode={dark_mode.value}, + titlebar_content={"titlebar_content" if titlebar.value else None}, + control_layout="{control_layout.value}", + brand_color={brand_color.value}, + ) + ``` + """ + ) + synchronize.on_click(lambda _: synchronize_theme()) synchronize_theme()