fix(gui): limit Files & Media collapsible child height to reasonable max

The begin_child() was using (0, -40) which made it stretch to fill parent.
Changed to (0, min(len(items) * 30 + 50, 300)) so it:
- Sizes to content (30px per row + 50px header)
- Caps at 300px max height
- Allows scrolling when content overflows
This commit is contained in:
2026-05-10 16:30:54 -04:00
parent 0f180e8c4b
commit d28fd58f03
3 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -2921,7 +2921,7 @@ def hello():
r.destroy()
if d: self.ui_files_base_dir = d
imgui.separator()
imgui.begin_child("f_paths", imgui.ImVec2(0, -40), True)
imgui.begin_child("f_paths", imgui.ImVec2(0, min(len(self.files) * 30 + 50, 300)), True)
if imgui.begin_table("files_table", 4, imgui.TableFlags_.resizable | imgui.TableFlags_.borders):
imgui.table_setup_column("Actions", imgui.TableColumnFlags_.width_fixed, 40)
imgui.table_setup_column("File Path", imgui.TableColumnFlags_.width_stretch)
@@ -2994,7 +2994,7 @@ def hello():
r.destroy()
if d: self.ui_shots_base_dir = d
imgui.separator()
imgui.begin_child("s_paths", imgui.ImVec2(0, -40), True)
imgui.begin_child("s_paths", imgui.ImVec2(0, min(len(self.screenshots) * 30 + 50, 300)), True)
for i, s in enumerate(self.screenshots):
if imgui.button(f"x##s{i}"):
self.screenshots.pop(i)