From 5525527ecd1fbc5a01bbf7a3e399eb0e1bbeb920 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Wed, 11 May 2022 19:08:01 +0200 Subject: [PATCH] Add `No Results` node to Content Search if nothing found --- Source/Editor/Windows/Search/ContentSearchWindow.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Source/Editor/Windows/Search/ContentSearchWindow.cs b/Source/Editor/Windows/Search/ContentSearchWindow.cs index 695fc335a..ac8f44d81 100644 --- a/Source/Editor/Windows/Search/ContentSearchWindow.cs +++ b/Source/Editor/Windows/Search/ContentSearchWindow.cs @@ -411,6 +411,17 @@ namespace FlaxEngine.Windows.Search try { SearchAsyncInner(); + + lock (_pendingResults) + { + if (!_token.IsCancellationRequested && _resultsTreeRoot.ChildrenCount == 0 && _pendingResults.Count == 0) + { + _pendingResults.Add(new SearchResultTreeNode + { + Text = "No results", + }); + } + } } catch (Exception ex) {