fix(gui): replace self with app in render_theme_panel
render_theme_panel is a module-level function that takes app as its parameter, but two lines still referenced 'self' (line 6373 and 6376). The function was converted from a method (_render_theme_panel) to a module-level function in the module_taxonomy_refactor_20260627 Phase 1.3 (commit3dd153f7), but the self -> app substitution was missed. Symptom: on every frame, render_theme_panel called imgui.begin('Theme', ...) which pushed the Theme window onto the imgui stack. Then the 'getattr(self, ...)' raised NameError. The exception was swallowed by _render_main_interface_result's try/except, but the imgui.end() call at the end of the function was never reached. The Theme window stayed pushed on the stack, and HelloImGui's auto-managed MainDockSpace asserted 'Missing End()' on every frame. The bug was masked earlier by commit71028dad, which fixed a stale 'from src.command_palette import' in render_main_interface. Before that fix, render_main_interface aborted entirely every frame, so the Theme window's never-reached end() was hidden behind a different error. Bisect confirmed: disabling any other default-visible window left the error; only disabling Theme made /api/gui_health report healthy=True. Verification: - tests/test_default_layout_install.py: 3/3 PASS (install behavior unchanged) - tests/test_api_hooks_gui_health_live.py: 1/1 PASS (was failing) - tests/test_command_palette_sim.py: 7/7 PASS - tests/test_saved_presets_sim.py: 2/2 PASS
This commit is contained in:
+2
-2
@@ -6370,10 +6370,10 @@ def render_theme_panel(app: App) -> None:
|
||||
ch_ct, ctrans = imgui.slider_float("##ctrans", theme.get_child_transparency(), 0.1, 1.0, "%.2f")
|
||||
if ch_ct:
|
||||
theme.set_child_transparency(ctrans)
|
||||
bg_enabled = getattr(self, 'bg_shader_enabled', False)
|
||||
bg_enabled = getattr(app, 'bg_shader_enabled', False)
|
||||
ch_bg, new_bg = imgui.checkbox("Animated Background Shader", bg_enabled)
|
||||
if ch_bg and new_bg != bg_enabled:
|
||||
self.bg_shader_enabled = new_bg
|
||||
app.bg_shader_enabled = new_bg
|
||||
gui_cfg = app.config.setdefault("gui", {})
|
||||
gui_cfg["bg_shader_enabled"] = new_bg
|
||||
if hasattr(app, "_flush_to_config"): app._flush_to_config()
|
||||
|
||||
Reference in New Issue
Block a user