From 109d4423bb66c60ebe5e71fe04d39e26cf120e68 Mon Sep 17 00:00:00 2001 From: xxSeys1 Date: Mon, 23 Jun 2025 20:14:18 +0200 Subject: [PATCH] add accent color strip to search item icons --- Source/Editor/Windows/Search/SearchItem.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Source/Editor/Windows/Search/SearchItem.cs b/Source/Editor/Windows/Search/SearchItem.cs index 5336c2855..4d610159e 100644 --- a/Source/Editor/Windows/Search/SearchItem.cs +++ b/Source/Editor/Windows/Search/SearchItem.cs @@ -20,6 +20,11 @@ namespace FlaxEditor.Windows.Search /// protected Image _icon; + /// + /// The color of the accent strip. + /// + protected Color _accentColor; + /// /// The item name. /// @@ -56,7 +61,7 @@ namespace FlaxEditor.Windows.Search var icon = new Image { Size = new Float2(logoSize), - Location = new Float2(5, (height - logoSize) / 2) + Location = new Float2(7, (height - logoSize) / 2) }; _icon = icon; @@ -146,6 +151,7 @@ namespace FlaxEditor.Windows.Search { _asset = item; _asset.AddReference(this); + _accentColor = Editor.Instance.ContentDatabase.GetProxy(item).AccentColor; } /// @@ -228,6 +234,10 @@ namespace FlaxEditor.Windows.Search // Draw icon var iconRect = _icon.Bounds; _asset.DrawThumbnail(ref iconRect); + + // Draw icon color strip + var rect = iconRect with { Width = 2, Height = Height, Location = Float2.Zero }; + Render2D.FillRectangle(rect, _accentColor); } ///