From 5e1700744f6d49b338cc4589919d0fb485167ec2 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Sun, 10 May 2026 16:37:11 -0400 Subject: [PATCH] fix(gui): improve tool preset manager adaptive sizing - When both sections open: use min(h, max(200, rem_y*0.3)) for tools, min(h, max(150, rem_y*0.5)) for bias - Single section open: cap at 400px instead of hard small values - This preserves split ratio while ensuring minimum readable sizes --- src/gui_2.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/gui_2.py b/src/gui_2.py index 2a0cfc7..1b1420f 100644 --- a/src/gui_2.py +++ b/src/gui_2.py @@ -1760,12 +1760,18 @@ class App: imgui.end_table() rem_y = imgui.get_content_region_avail().y - 80 - if self._tool_list_open and self._bias_list_open: h1, h2 = rem_y * self._tool_split_v, rem_y - (rem_y * self._tool_split_v) - 10 - elif self._tool_list_open: h1, h2 = rem_y, 0 - elif self._bias_list_open: h1, h2 = 0, rem_y - else: h1, h2 = 0, 0 - h1 = min(h1, 250) - h2 = min(h2, 200) + if self._tool_list_open and self._bias_list_open: + h1, h2 = rem_y * self._tool_split_v, rem_y - (rem_y * self._tool_split_v) - 10 + h1 = min(h1, max(200, rem_y * 0.3)) + h2 = min(h2, max(150, rem_y * 0.5)) + elif self._tool_list_open: + h1 = min(rem_y, 400) + h2 = 0 + elif self._bias_list_open: + h1 = 0 + h2 = min(rem_y, 400) + else: + h1, h2 = 0, 0 imgui.dummy(imgui.ImVec2(0, 4)) opened_t = imgui.collapsing_header("Categories & Tools", imgui.TreeNodeFlags_.default_open)