Private
Public Access
0
0

fix(palette): auto-focus input via set_next_window_focus + apply(theme) + try/except for actions

Added imgui.set_next_window_focus() on open so the palette window itself gets focus. The input field then gets focus on the next drawn widget. Wrapped action calls in try/except so a buggy command does not break the imgui.end_child/end pairing (was causing IM_ASSERT crash). Fixed theme_2 calls: apply_dark_theme and apply_light_theme do not exist; use theme_2.apply(palette_name). switch_to_dark_theme uses apply 10x Dark. switch_to_light_theme uses apply ImGui Light. switch_to_nerv_theme uses apply NERV instead of apply_nerv() from src.theme_nerv.
This commit is contained in:
2026-06-02 22:33:05 -04:00
parent 592f816caf
commit 9cfd7b0d12
3 changed files with 21 additions and 10 deletions
+2
View File
@@ -738,6 +738,8 @@ class App:
self._command_palette_query = ""
if hasattr(self, '_command_palette_selected'):
self._command_palette_selected = 0
if hasattr(self, '_command_palette_input_focused'):
self._command_palette_input_focused = False
def _test_callback_func_write_to_file(self, data: str) -> None:
"""A dummy function that a custom_callback would execute for testing."""