From 1dadad7775d1a7ffdfe1cc86c5c5ec9633e644d0 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 10 Apr 2024 11:02:33 +0800 Subject: [PATCH] ux: disable TextEditor hyperlinks (#65) --- src/Views/Blame.axaml.cs | 2 ++ src/Views/RevisionFiles.axaml.cs | 2 ++ src/Views/TextDiffView.axaml.cs | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/src/Views/Blame.axaml.cs b/src/Views/Blame.axaml.cs index 1c23d82d..d8226487 100644 --- a/src/Views/Blame.axaml.cs +++ b/src/Views/Blame.axaml.cs @@ -227,6 +227,8 @@ namespace SourceGit.Views TextArea.TextView.ContextRequested += OnTextViewContextRequested; TextArea.TextView.VisualLinesChanged += OnTextViewVisualLinesChanged; TextArea.TextView.Margin = new Thickness(4, 0); + TextArea.TextView.Options.EnableHyperlinks = false; + TextArea.TextView.Options.EnableEmailHyperlinks = false; } public void OnCommitSHAClicked(string sha) diff --git a/src/Views/RevisionFiles.axaml.cs b/src/Views/RevisionFiles.axaml.cs index 39701493..5d9966ab 100644 --- a/src/Views/RevisionFiles.axaml.cs +++ b/src/Views/RevisionFiles.axaml.cs @@ -121,6 +121,8 @@ namespace SourceGit.Views TextArea.LeftMargins[0].Margin = new Thickness(8, 0); TextArea.TextView.Margin = new Thickness(4, 0); + TextArea.TextView.Options.EnableHyperlinks = false; + TextArea.TextView.Options.EnableEmailHyperlinks = false; } protected override void OnLoaded(RoutedEventArgs e) diff --git a/src/Views/TextDiffView.axaml.cs b/src/Views/TextDiffView.axaml.cs index 92ca9dbe..1f107138 100644 --- a/src/Views/TextDiffView.axaml.cs +++ b/src/Views/TextDiffView.axaml.cs @@ -260,6 +260,8 @@ namespace SourceGit.Views TextArea.TextView.Margin = new Thickness(4, 0); TextArea.TextView.BackgroundRenderers.Add(new LineBackgroundRenderer(this)); TextArea.TextView.LineTransformers.Add(_lineStyleTransformer); + TextArea.TextView.Options.EnableHyperlinks = false; + TextArea.TextView.Options.EnableEmailHyperlinks = false; } protected override void OnLoaded(RoutedEventArgs e) @@ -638,6 +640,8 @@ namespace SourceGit.Views TextArea.TextView.Margin = new Thickness(4, 0); TextArea.TextView.BackgroundRenderers.Add(new LineBackgroundRenderer(this)); TextArea.TextView.LineTransformers.Add(_lineStyleTransformer); + TextArea.TextView.Options.EnableHyperlinks = false; + TextArea.TextView.Options.EnableEmailHyperlinks = false; } protected override void OnLoaded(RoutedEventArgs e)