Repository: FlaxEngine/FlaxEngine
File: Source/Editor/Windows/DebugLogWindow.cs (C#)

Code before:
                base.Draw();

                // Cache data
                var style = Style.Current;
                var index = IndexInParent;
                var clientRect = new Rectangle(Float2.Zero, Size);

                // Background
                if (_window._selected == this)
                    Render2D.FillRectangle(clientRect, IsFocused ? style.BackgroundSelected : style.LightBackground);
                else if (IsMouseOver)
                    Render2D.FillRectangle(clientRect, style.BackgroundHighlighted);
                else if (index % 2 == 0)
                    Render2D.FillRectangle(clientRect, style.Background * 0.9f);

                // Icon
                var iconColor = Group == LogGroup.Error ? Color.Red : (Group == LogGroup.Warning ? Color.Yellow : style.Foreground);
                Render2D.DrawSprite(Icon, new Rectangle(5, 0, 32, 32), iconColor);

                // Title
                var textRect = new Rectangle(38, 2, clientRect.Width - 40, clientRect.Height - 10);
                Render2D.PushClip(ref clientRect);
                string countText = string.Empty;
                if (LogCount > 1)
                {
                    countText = $" ({LogCount})";
                }
                Render2D.DrawText(style.FontMedium, Desc.Title + countText, textRect, style.Foreground);
                Render2D.PopClip();
            }

            /// <inheritdoc />
            public override void OnGotFocus()
            {
                base.OnGotFocus();

                _window.Selected = this;
            }

            /// <inheritdoc />
            protected override void OnVisibleChanged()
            {
                // Deselect on hide
                if (!Visible && _window.Selected == this)
                    _window.Selected = null;

                base.OnVisibleChanged();
            }

            /// <inheritdoc />
            public override bool OnKeyDown(KeyboardKeys key)

Review comment (suggestion):
If `LogCount == 1` which is in most cases,we should skip string `+` operation when drawing so contact strings only when count is actually used.

Code after:
                base.Draw();

                // Cache data
                var style = Style.Current;
                var index = IndexInParent;
                var clientRect = new Rectangle(Float2.Zero, Size);

                // Background
                if (_window._selected == this)
                    Render2D.FillRectangle(clientRect, IsFocused ? style.BackgroundSelected : style.LightBackground);
                else if (IsMouseOver)
                    Render2D.FillRectangle(clientRect, style.BackgroundHighlighted);
                else if (index % 2 == 0)
                    Render2D.FillRectangle(clientRect, style.Background * 0.9f);

                // Icon
                var iconColor = Group == LogGroup.Error ? Color.Red : (Group == LogGroup.Warning ? Color.Yellow : style.Foreground);
                Render2D.DrawSprite(Icon, new Rectangle(5, 0, 32, 32), iconColor);

                // Title
                var textRect = new Rectangle(38, 2, clientRect.Width - 40, clientRect.Height - 10);
                Render2D.PushClip(ref clientRect);
                if (LogCount == 1)
                {
                    Render2D.DrawText(style.FontMedium, Desc.Title, textRect, style.Foreground);
                }
                else if (LogCount > 1)
                {
                    Render2D.DrawText(style.FontMedium, $"{Desc.Title} ({LogCount})", textRect, style.Foreground);
                }
                Render2D.PopClip();
            }

            /// <inheritdoc />
            public override void OnGotFocus()
            {
                base.OnGotFocus();

                _window.Selected = this;
            }

            /// <inheritdoc />
            protected override void OnVisibleChanged()
            {
                // Deselect on hide
                if (!Visible && _window.Selected == this)
                    _window.Selected = null;

                base.OnVisibleChanged();
            }