feat(ui): Implement _render_selectable_label helper and complete UI audit

This commit is contained in:
2026-03-08 21:26:59 -04:00
parent b7a0c4fa7e
commit ef942bb2a2
2 changed files with 65 additions and 0 deletions

View File

@@ -222,6 +222,22 @@ class App:
imgui.text_unformatted(content)
# ---------------------------------------------------------------- gui
def _render_selectable_label(self, label: str, value: str, width: float = 0.0, multiline: bool = False, height: float = 0.0, color: Optional[imgui.ImVec4] = None) -> None:
imgui.push_id(label + str(hash(value)))
pops = 2
imgui.push_style_color(imgui.Col_.frame_bg, vec4(0, 0, 0, 0))
imgui.push_style_color(imgui.Col_.border, vec4(0, 0, 0, 0))
if color:
imgui.push_style_color(imgui.Col_.text, color)
pops += 1
if multiline:
imgui.input_text_multiline("##" + label, value, imgui.ImVec2(width, height), imgui.InputTextFlags_.read_only)
else:
if width > 0: imgui.set_next_item_width(width)
imgui.input_text("##" + label, value, imgui.InputTextFlags_.read_only)
imgui.pop_style_color(pops)
imgui.pop_id()
def _show_menus(self) -> None:
if imgui.begin_menu("manual slop"):
if imgui.menu_item("Quit", "Ctrl+Q", False)[0]: