fix naming and treat unfolded category items as normal items

This commit is contained in:
Saas
2025-07-10 20:07:52 +02:00
parent 50871d8885
commit 33b540ed9e

View File

@@ -514,15 +514,15 @@ namespace FlaxEditor.GUI
var items = ItemsPanel.Children; var items = ItemsPanel.Children;
for (int i = 0; i < items.Count; i++) for (int i = 0; i < items.Count; i++)
{ {
var item = items[i]; var currentItem = items[i];
if (item is Item item1 && item1.Visible) if (currentItem is Item item && item.Visible)
result.Add(item1); result.Add(item);
else if (!ignoreFoldedCategories && item is DropPanel panel && item.Visible) else if (currentItem is DropPanel category && (!ignoreFoldedCategories || !category.IsClosed) && currentItem.Visible)
{ {
for (int j = 0; j < panel.Children.Count; j++) for (int j = 0; j < category.Children.Count; j++)
{ {
if (panel.Children[j] is Item item2 && item2.Visible) if (category.Children[j] is Item categoryItem && categoryItem.Visible)
result.Add(item2); result.Add(categoryItem);
} }
} }
} }