From 70512915f987d6a7c0966e469bc76361c1e85e32 Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 6 Feb 2024 19:12:40 +0800 Subject: [PATCH] style: reduce required width of NameHighlightedTextBlock --- src/Views/NameHighlightedTextBlock.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Views/NameHighlightedTextBlock.cs b/src/Views/NameHighlightedTextBlock.cs index a4ea98b6..82eb5269 100644 --- a/src/Views/NameHighlightedTextBlock.cs +++ b/src/Views/NameHighlightedTextBlock.cs @@ -55,7 +55,8 @@ namespace SourceGit.Views { typeface, FontSize, Foreground); - return new Size(formatted.Width, formatted.Height); + + return new Size(formatted.Width - 16, formatted.Height); } public override void Render(DrawingContext context) { @@ -90,7 +91,9 @@ namespace SourceGit.Views { context.DrawLine(underlinePen, new Point(offsetX, lineY), new Point(offsetX + formatted.Width, lineY)); offsetX += formatted.Width; } else { - offsetX += formatted.Width + 4; + offsetX += formatted.Width; + if (part.StartsWith(' ')) offsetX += 2; + if (part.EndsWith(' ')) offsetX += 4; } isName = !isName;