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
This commit is contained in:
2026-05-10 16:37:11 -04:00
parent e0f1d7840f
commit 5e1700744f
+12 -6
View File
@@ -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)