fix(gui): Use theme colors in External Editor panel

This commit is contained in:
2026-05-07 19:48:06 -04:00
parent 630c9abd3a
commit f78042969d
+12 -16
View File
@@ -4851,27 +4851,26 @@ def hello():
self.controller.event_queue.put('click', 'btn_rebuild_rag_index')
def _render_external_editor_panel(self) -> None:
from src.external_editor import get_default_launcher, create_temp_modified_file
import os
imgui.text_colored(vec4(0.7, 0.7, 0.7, 1), "External Editor for Diff Viewing")
from src.external_editor import get_default_launcher
imgui.text("External Editor for Diff Viewing")
imgui.separator()
try:
launcher = get_default_launcher()
editors = launcher.config.editors
default_name = launcher.config.default_editor
if not editors:
imgui.text_colored(vec4(1, 0.5, 0, 1), " No editors configured")
imgui.text_colored(C_REQ, " No editors configured")
imgui.text("")
imgui.text_colored(vec4(0.6, 0.6, 0.6, 1), "Add editors in config.toml:")
imgui.text_colored(vec4(0.5, 0.8, 1, 1), ' [tools.text_editors.vscode]')
imgui.text("Add editors in config.toml:")
imgui.text(" [tools.text_editors.vscode]")
imgui.text(' path = "C:\\\\path\\\\to\\\\code.exe"')
imgui.text(' diff_args = ["--diff"]')
imgui.text("")
imgui.text_colored(vec4(0.5, 0.8, 1, 1), ' [tools.text_editors.notepadpp]')
imgui.text(" [tools.text_editors.notepadpp]")
imgui.text(' path = "C:\\\\path\\\\to\\\\notepad++.exe"')
imgui.text(' diff_args = ["-multiInst", "-nosession"]')
imgui.text("")
imgui.text_colored(vec4(0.6, 0.6, 0.6, 1), "Then set default in [tools.default_editor]")
imgui.text("Then set default in [tools.default_editor]")
else:
imgui.text("Default Editor:")
editor_names = sorted(list(editors.keys()))
@@ -4882,9 +4881,6 @@ def hello():
changed, new_idx = imgui.combo("##editor_combo", current_idx, editor_names)
if changed:
self._set_external_editor_default(editor_names[new_idx])
launcher = get_default_launcher()
editors = launcher.config.editors
default_name = launcher.config.default_editor
imgui.text("")
imgui.text("Configured Editors:")
imgui.separator()
@@ -4895,17 +4891,17 @@ def hello():
is_default = name == default_name
marker = " (default)" if is_default else ""
if is_default:
imgui.text_colored(vec4(0.3, 0.9, 0.3, 1), f" {name}{marker}")
imgui.text_colored(C_IN, f" {name}{marker}")
else:
imgui.text(f" {name}{marker}")
imgui.text(f" {editor.path}")
if editor.diff_args:
imgui.text_colored(vec4(0.5, 0.5, 0.5, 1), f" diff: {editor.diff_args}")
imgui.textDisabled(f" diff: {editor.diff_args}")
imgui.text("")
imgui.text_colored(vec4(0.6, 0.6, 0.6, 1), "Config: config.toml [tools.text_editors]")
imgui.text_colored(vec4(0.6, 0.6, 0.6, 1), "Override: manual_slop.toml default_editor")
imgui.text("Config: config.toml [tools.text_editors]")
imgui.text("Override: manual_slop.toml default_editor")
except Exception as e:
imgui.text_colored(vec4(1, 0.3, 0.3, 1), f"Error: {str(e)}")
imgui.text_colored(C_TC, f"Error: {str(e)}")
def _render_agent_tools_panel(self) -> None:
if imgui.collapsing_header("Active Tool Presets & Biases", imgui.TreeNodeFlags_.default_open):