From ca19d65f0e61b4ab1089e65e16d481ba1de558d6 Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 20 Feb 2024 15:44:26 +0800 Subject: [PATCH] update: use official AvaloniaEdit instead of OneWare.AvaloniaEdit --- src/SourceGit.csproj | 5 +++-- src/Views/About.axaml | 2 +- src/Views/About.axaml.cs | 2 +- src/Views/TextDiffView.axaml.cs | 8 +++++--- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/SourceGit.csproj b/src/SourceGit.csproj index 08fcd17a..5505cb4f 100644 --- a/src/SourceGit.csproj +++ b/src/SourceGit.csproj @@ -21,10 +21,11 @@ + + - - + diff --git a/src/Views/About.axaml b/src/Views/About.axaml index 7bf8d601..c76dee78 100644 --- a/src/Views/About.axaml +++ b/src/Views/About.axaml @@ -73,7 +73,7 @@ - + diff --git a/src/Views/About.axaml.cs b/src/Views/About.axaml.cs index 90d047ef..b15e3842 100644 --- a/src/Views/About.axaml.cs +++ b/src/Views/About.axaml.cs @@ -27,7 +27,7 @@ namespace SourceGit.Views { } private void OnVisitAvaloniaEdit(object sender, PointerPressedEventArgs e) { - Native.OS.OpenBrowser("https://www.nuget.org/packages/OneWare.AvaloniaEdit"); + Native.OS.OpenBrowser("https://github.com/AvaloniaUI/AvaloniaEdit"); e.Handled = true; } diff --git a/src/Views/TextDiffView.axaml.cs b/src/Views/TextDiffView.axaml.cs index e84f16ec..74990a36 100644 --- a/src/Views/TextDiffView.axaml.cs +++ b/src/Views/TextDiffView.axaml.cs @@ -1,5 +1,6 @@ using Avalonia; using Avalonia.Controls; +using Avalonia.Controls.Primitives; using Avalonia.Interactivity; using Avalonia.Media; using Avalonia.Styling; @@ -517,7 +518,7 @@ namespace SourceGit.Views { } private void OnTextViewScrollOffsetChanged(object sender, EventArgs e) { - SyncScrollOffset = ScrollViewer.Offset; + SyncScrollOffset = TextArea.TextView.ScrollOffset; } private void OnTextViewContextRequested(object sender, ContextRequestedEventArgs e) { @@ -566,8 +567,9 @@ namespace SourceGit.Views { Text = string.Empty; } } else if (change.Property == SyncScrollOffsetProperty) { - if (ScrollViewer.Offset != SyncScrollOffset) { - ScrollViewer.Offset = SyncScrollOffset; + if (TextArea.TextView.ScrollOffset != SyncScrollOffset) { + IScrollable scrollable = TextArea.TextView; + scrollable.Offset = SyncScrollOffset; } } else if (change.Property.Name == "ActualThemeVariant" && change.NewValue != null && _textMate != null) { if (App.Current?.ActualThemeVariant == ThemeVariant.Dark) {