Add auto-expand for items list with a single category in use
This commit is contained in:
@@ -52,7 +52,7 @@ namespace FlaxEditor.GUI
|
||||
public float SortScore;
|
||||
|
||||
/// <summary>
|
||||
/// Wether the query highlights should be draw.
|
||||
/// Whether the query highlights should be drawn.
|
||||
/// </summary>
|
||||
public bool DrawHighlights = true;
|
||||
|
||||
@@ -261,6 +261,11 @@ namespace FlaxEditor.GUI
|
||||
/// </summary>
|
||||
public readonly VerticalPanel ItemsPanel;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of panels with item categories.
|
||||
/// </summary>
|
||||
public IEnumerable<DropPanel> CategoryPanels => (IEnumerable<DropPanel>)_categoryPanels ?? Array.Empty<DropPanel>();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ItemsListContextMenu"/> class.
|
||||
/// </summary>
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user