Fix regression in type search highlights from #2268

This commit is contained in:
Wojtek Figat
2024-02-28 20:48:11 +01:00
parent 119a1e2b03
commit dce0274a1c

View File

@@ -122,6 +122,10 @@ namespace FlaxEditor.GUI
if (IsMouseOver || IsFocused) if (IsMouseOver || IsFocused)
Render2D.FillRectangle(new Rectangle(Float2.Zero, Size), style.BackgroundHighlighted); Render2D.FillRectangle(new Rectangle(Float2.Zero, Size), style.BackgroundHighlighted);
// Indent for drop panel items is handled by drop panel margin
if (Parent is not DropPanel)
textRect.Location += new Float2(Editor.Instance.Icons.ArrowRight12.Size.X + 2, 0);
// Draw all highlights // Draw all highlights
if (_highlights != null) if (_highlights != null)
{ {
@@ -134,13 +138,9 @@ namespace FlaxEditor.GUI
Render2D.FillRectangle(rect, color); Render2D.FillRectangle(rect, color);
} }
} }
// Indent for drop panel items is handled by drop panel margin
var indent = Float2.Zero;
if (Parent is not DropPanel)
indent = new Float2(Editor.Instance.Icons.ArrowRight12.Size.X + 2, 0);
// Draw name // Draw name
Render2D.DrawText(style.FontSmall, Name, textRect + indent, TintColor * (Enabled ? style.Foreground : style.ForegroundDisabled), TextAlignment.Near, TextAlignment.Center); Render2D.DrawText(style.FontSmall, Name, textRect, TintColor * (Enabled ? style.Foreground : style.ForegroundDisabled), TextAlignment.Near, TextAlignment.Center);
} }
/// <inheritdoc /> /// <inheritdoc />