From ff2e0d792827448d89c52adf5981e0b7879839de Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 21 Mar 2024 18:08:24 +0800 Subject: [PATCH] fix: indicator line does not use editor's FontFamily (#30) --- src/SourceGit/Views/TextDiffView.axaml.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/SourceGit/Views/TextDiffView.axaml.cs b/src/SourceGit/Views/TextDiffView.axaml.cs index 9e32c5b2..a321d81e 100644 --- a/src/SourceGit/Views/TextDiffView.axaml.cs +++ b/src/SourceGit/Views/TextDiffView.axaml.cs @@ -160,7 +160,6 @@ namespace SourceGit.Views public LineStyleTransformer(CombinedTextDiffPresenter editor) { _editor = editor; - _indicatorTypeface = new Typeface(editor.FontFamily, FontStyle.Italic); } protected override void ColorizeLine(DocumentLine line) @@ -174,7 +173,7 @@ namespace SourceGit.Views ChangeLinePart(line.Offset, line.EndOffset, v => { v.TextRunProperties.SetForegroundBrush(_editor.SecondaryFG); - v.TextRunProperties.SetTypeface(_indicatorTypeface); + v.TextRunProperties.SetTypeface(new Typeface(_editor.FontFamily, FontStyle.Italic)); }); return; @@ -194,7 +193,6 @@ namespace SourceGit.Views } private readonly CombinedTextDiffPresenter _editor; - private readonly Typeface _indicatorTypeface = Typeface.Default; } public static readonly StyledProperty DiffDataProperty = @@ -520,7 +518,6 @@ namespace SourceGit.Views public LineStyleTransformer(SingleSideTextDiffPresenter editor) { _editor = editor; - _indicatorTypeface = new Typeface(editor.FontFamily, FontStyle.Italic); } protected override void ColorizeLine(DocumentLine line) @@ -535,7 +532,7 @@ namespace SourceGit.Views ChangeLinePart(line.Offset, line.EndOffset, v => { v.TextRunProperties.SetForegroundBrush(_editor.SecondaryFG); - v.TextRunProperties.SetTypeface(_indicatorTypeface); + v.TextRunProperties.SetTypeface(new Typeface(_editor.FontFamily, FontStyle.Italic)); }); return; @@ -555,7 +552,6 @@ namespace SourceGit.Views } private readonly SingleSideTextDiffPresenter _editor; - private readonly Typeface _indicatorTypeface = Typeface.Default; } public static readonly StyledProperty IsOldProperty =