fix(gui): content-based height for Files and Screenshots child panels

Files: child_h = min(max(len(files),1) * 28 + 40, 350)
Screenshots: shot_h = min(max(len(screenshots),1) * 28 + 40, 250)

Replaces (0, -40) which stretched to fill available space.
This commit is contained in:
2026-05-10 17:32:02 -04:00
parent 8bc4e6ca7c
commit 28146f96cc
+6 -2
View File
@@ -2921,7 +2921,9 @@ def hello():
r.destroy() r.destroy()
if d: self.ui_files_base_dir = d if d: self.ui_files_base_dir = d
imgui.separator() imgui.separator()
imgui.begin_child("f_paths", imgui.ImVec2(0, -40), True) row_count = max(len(self.files), 1)
child_h = min(row_count * 28 + 40, 350)
imgui.begin_child("f_paths", imgui.ImVec2(0, child_h), True)
if imgui.begin_table("files_table", 4, imgui.TableFlags_.resizable | imgui.TableFlags_.borders): 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("Actions", imgui.TableColumnFlags_.width_fixed, 40)
imgui.table_setup_column("File Path", imgui.TableColumnFlags_.width_stretch) imgui.table_setup_column("File Path", imgui.TableColumnFlags_.width_stretch)
@@ -2994,7 +2996,9 @@ def hello():
r.destroy() r.destroy()
if d: self.ui_shots_base_dir = d if d: self.ui_shots_base_dir = d
imgui.separator() imgui.separator()
imgui.begin_child("s_paths", imgui.ImVec2(0, -40), True) shot_count = max(len(self.screenshots), 1)
shot_h = min(shot_count * 28 + 40, 250)
imgui.begin_child("s_paths", imgui.ImVec2(0, shot_h), True)
for i, s in enumerate(self.screenshots): for i, s in enumerate(self.screenshots):
if imgui.button(f"x##s{i}"): if imgui.button(f"x##s{i}"):
self.screenshots.pop(i) self.screenshots.pop(i)