From 09f0477e181a3a87ea0f69b3c7ab42b5cf09ab93 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Mon, 14 Sep 2026 06:59:52 +0200 Subject: [PATCH] Add auto-expand for items list with a single category in use --- Source/Editor/GUI/ItemsListContextMenu.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Source/Editor/GUI/ItemsListContextMenu.cs b/Source/Editor/GUI/ItemsListContextMenu.cs index 5f09342c7..95a9a2164 100644 --- a/Source/Editor/GUI/ItemsListContextMenu.cs +++ b/Source/Editor/GUI/ItemsListContextMenu.cs @@ -52,7 +52,7 @@ namespace FlaxEditor.GUI public float SortScore; /// - /// Wether the query highlights should be draw. + /// Whether the query highlights should be drawn. /// public bool DrawHighlights = true; @@ -261,6 +261,11 @@ namespace FlaxEditor.GUI /// public readonly VerticalPanel ItemsPanel; + /// + /// Gets a list of panels with item categories. + /// + public IEnumerable CategoryPanels => (IEnumerable)_categoryPanels ?? Array.Empty(); + /// /// Initializes a new instance of the class. /// @@ -504,6 +509,12 @@ namespace FlaxEditor.GUI category.Visible = true; category.Close(false); } + + if (_categoryPanels.Count == 1 && items.Count == 1) + { + // Expand the only category if there are no items outside of it + _categoryPanels[0].Open(false); + } } _searchBox?.Clear();