diff --git a/Source/Editor/Modules/ContentFindingModule.cs b/Source/Editor/Modules/ContentFindingModule.cs index b8f7f74a0..0669f3dd9 100644 --- a/Source/Editor/Modules/ContentFindingModule.cs +++ b/Source/Editor/Modules/ContentFindingModule.cs @@ -153,17 +153,16 @@ namespace FlaxEditor.Modules }; } } + Profiler.BeginEvent("ContentFinding.Search"); string type = ".*"; string name = charsToFind.Trim(); - if (charsToFind.Contains(':')) { var args = charsToFind.Split(':'); type = ".*" + args[1].Trim() + ".*"; name = ".*" + args[0].Trim() + ".*"; } - if (name.Equals(string.Empty)) name = ".*"; @@ -173,17 +172,28 @@ namespace FlaxEditor.Modules foreach (var project in Editor.Instance.ContentDatabase.Projects) { + Profiler.BeginEvent(project.Project.Name); ProcessItems(nameRegex, typeRegex, project.Folder.Children, matches); + Profiler.EndEvent(); } //ProcessSceneNodes(nameRegex, typeRegex, Editor.Instance.Scene.Root, matches); - ProcessActors(nameRegex, typeRegex, Editor.Instance.Scene.Root, matches); - - _quickActions.ForEach(action => { - if (nameRegex.Match(action.Name).Success && typeRegex.Match("Quick Action").Success) - matches.Add(new SearchResult { Name = action.Name, Type = "Quick Action", Item = action }); - }); + Profiler.BeginEvent("Actors"); + ProcessActors(nameRegex, typeRegex, Editor.Instance.Scene.Root, matches); + Profiler.EndEvent(); + } + { + Profiler.BeginEvent("QuickActions"); + _quickActions.ForEach(action => + { + if (nameRegex.Match(action.Name).Success && typeRegex.Match("Quick Action").Success) + matches.Add(new SearchResult { Name = action.Name, Type = "Quick Action", Item = action }); + }); + Profiler.EndEvent(); + } + + Profiler.EndEvent(); return matches; } diff --git a/Source/Editor/Surface/ContextMenu/ContentFinder.cs b/Source/Editor/Surface/ContextMenu/ContentFinder.cs index fc0f43472..3fe939468 100644 --- a/Source/Editor/Surface/ContextMenu/ContentFinder.cs +++ b/Source/Editor/Surface/ContextMenu/ContentFinder.cs @@ -107,14 +107,18 @@ namespace FlaxEditor.Surface.ContextMenu private void BuildList(List items) { _resultPanel.DisposeChildren(); + LockChildrenRecursive(); var dpiScale = DpiScale; + var window = RootWindow.Window; if (items.Count == 0) { Height = _searchBox.Height + 1; _resultPanel.ScrollBars = ScrollBars.None; - RootWindow.Window.ClientSize = new Vector2(RootWindow.Window.ClientSize.X, Height * dpiScale); + window.ClientSize = new Vector2(window.ClientSize.X, Height * dpiScale); + UnlockChildrenRecursive(); + PerformLayout(); return; } @@ -148,8 +152,9 @@ namespace FlaxEditor.Surface.ContextMenu MatchedItems.Add(searchItem); } - RootWindow.Window.ClientSize = new Vector2(RootWindow.Window.ClientSize.X, Height * dpiScale); + window.ClientSize = new Vector2(window.ClientSize.X, Height * dpiScale); + UnlockChildrenRecursive(); PerformLayout(); }