diff --git a/Source/Editor/Content/Tree/ContentTreeNode.cs b/Source/Editor/Content/Tree/ContentTreeNode.cs
index 8629296fc..ca629000d 100644
--- a/Source/Editor/Content/Tree/ContentTreeNode.cs
+++ b/Source/Editor/Content/Tree/ContentTreeNode.cs
@@ -175,15 +175,13 @@ namespace FlaxEditor.Content
}
}
- bool isExpanded = isAnyChildVisible;
-
- if (isExpanded)
+ if (!noFilter)
{
- Expand(true);
- }
- else
- {
- Collapse(true);
+ bool isExpanded = isAnyChildVisible;
+ if (isExpanded)
+ Expand(true);
+ else
+ Collapse(true);
}
Visible = isThisVisible | isAnyChildVisible;
diff --git a/Source/Editor/SceneGraph/GUI/ActorTreeNode.cs b/Source/Editor/SceneGraph/GUI/ActorTreeNode.cs
index 5f56e918a..4607a4f63 100644
--- a/Source/Editor/SceneGraph/GUI/ActorTreeNode.cs
+++ b/Source/Editor/SceneGraph/GUI/ActorTreeNode.cs
@@ -324,13 +324,12 @@ namespace FlaxEditor.SceneGraph.GUI
isExpanded = Editor.Instance.ProjectCache.IsExpandedActor(ref id);
}
- if (isExpanded)
+ if (!noFilter)
{
- Expand(true);
- }
- else
- {
- Collapse(true);
+ if (isExpanded)
+ Expand(true);
+ else
+ Collapse(true);
}
Visible = isThisVisible | isAnyChildVisible;
diff --git a/Source/Editor/Windows/ContentWindow.Search.cs b/Source/Editor/Windows/ContentWindow.Search.cs
index f28dc4834..5a0ed63aa 100644
--- a/Source/Editor/Windows/ContentWindow.Search.cs
+++ b/Source/Editor/Windows/ContentWindow.Search.cs
@@ -115,6 +115,7 @@ namespace FlaxEditor.Windows
var root = _root;
root.LockChildrenRecursive();
+ PerformLayout();
// Update tree
var query = _foldersSearchBox.Text;
diff --git a/Source/Editor/Windows/ContentWindow.cs b/Source/Editor/Windows/ContentWindow.cs
index 9b92b380f..6313a91b0 100644
--- a/Source/Editor/Windows/ContentWindow.cs
+++ b/Source/Editor/Windows/ContentWindow.cs
@@ -1126,6 +1126,8 @@ namespace FlaxEditor.Windows
if (Editor.ContentDatabase.Find(_lastViewedFolderBeforeReload) is ContentFolder folder)
_tree.Select(folder.Node);
}
+
+ OnFoldersSearchBoxTextChanged();
}
private void Refresh()
diff --git a/Source/Editor/Windows/SceneTreeWindow.cs b/Source/Editor/Windows/SceneTreeWindow.cs
index d9ba67aa3..72b7c0f57 100644
--- a/Source/Editor/Windows/SceneTreeWindow.cs
+++ b/Source/Editor/Windows/SceneTreeWindow.cs
@@ -68,6 +68,7 @@ namespace FlaxEditor.Windows
TooltipText = "Search the scene tree.\n\nYou can prefix your search with different search operators:\ns: -> Actor with script of type\na: -> Actor type\nc: -> Control type",
};
_searchBox.TextChanged += OnSearchBoxTextChanged;
+ ScriptsBuilder.ScriptsReloadEnd += OnSearchBoxTextChanged;
// Scene tree panel
_sceneTreePanel = new Panel
@@ -112,7 +113,7 @@ namespace FlaxEditor.Windows
InputActions.Add(options => options.LockFocusSelection, () => Editor.Windows.EditWin.Viewport.LockFocusSelection());
InputActions.Add(options => options.Rename, RenameSelection);
}
-
+
///
public override void OnPlayBeginning()
{
@@ -125,6 +126,7 @@ namespace FlaxEditor.Windows
{
base.OnPlayBegin();
_blockSceneTreeScroll = false;
+ OnSearchBoxTextChanged();
}
///
@@ -139,6 +141,7 @@ namespace FlaxEditor.Windows
{
base.OnPlayEnd();
_blockSceneTreeScroll = true;
+ OnSearchBoxTextChanged();
}
///
@@ -174,6 +177,7 @@ namespace FlaxEditor.Windows
return;
_tree.LockChildrenRecursive();
+ PerformLayout();
// Update tree
var query = _searchBox.Text;
@@ -600,6 +604,7 @@ namespace FlaxEditor.Windows
_dragHandlers = null;
_tree = null;
_searchBox = null;
+ ScriptsBuilder.ScriptsReloadEnd -= OnSearchBoxTextChanged;
base.OnDestroy();
}