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:
@@ -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."""
|
||||
|
||||
Reference in New Issue
Block a user