From 133e192b98968ec86bf68fc0baa77643e3a2afe2 Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Fri, 7 Apr 2023 11:04:52 -0500 Subject: [PATCH] Added the function of de-selecting items in content view and removed selecting first item --- Source/Editor/Windows/ContentWindow.Navigation.cs | 1 - Source/Editor/Windows/ContentWindow.cs | 11 +++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Source/Editor/Windows/ContentWindow.Navigation.cs b/Source/Editor/Windows/ContentWindow.Navigation.cs index 69104d6c8..ad690c2d0 100644 --- a/Source/Editor/Windows/ContentWindow.Navigation.cs +++ b/Source/Editor/Windows/ContentWindow.Navigation.cs @@ -69,7 +69,6 @@ namespace FlaxEditor.Windows // Update UI UpdateUI(); - _view.SelectFirstItem(); } } diff --git a/Source/Editor/Windows/ContentWindow.cs b/Source/Editor/Windows/ContentWindow.cs index 0323b9730..654eaa91d 100644 --- a/Source/Editor/Windows/ContentWindow.cs +++ b/Source/Editor/Windows/ContentWindow.cs @@ -941,6 +941,17 @@ namespace FlaxEditor.Windows return true; } + if (button == MouseButton.Left) + { + // Find control that is under the mouse + var c = GetChildAtRecursive(location); + if (c is ContentView) + { + _view.ClearSelection(); + return true; + } + } + return base.OnMouseUp(location, button); }