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:
+2
-2
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user