sourcegit/src/Views/DiffView.axaml.cs
Göran W fa4caa2186
enhance: add first/last buttons for block-nav, no wrapping (#1015) (#1016)
Added 2 new buttons (only visible in block-nav mode), with new icons and new (en_US) strings (First/Last Difference).
Implemented these new buttons, and disabled the automatic wrap-around for the prev/next buttons in block-nav mode.
2025-02-24 09:32:19 +08:00

42 lines
1.1 KiB
C#

using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.VisualTree;
namespace SourceGit.Views
{
public partial class DiffView : UserControl
{
public DiffView()
{
InitializeComponent();
}
private void OnGotoFirstChange(object _, RoutedEventArgs e)
{
var textDiff = this.FindDescendantOfType<TextDiffView>();
textDiff?.GotoFirstChange();
e.Handled = true;
}
private void OnGotoPrevChange(object _, RoutedEventArgs e)
{
var textDiff = this.FindDescendantOfType<TextDiffView>();
textDiff?.GotoPrevChange();
e.Handled = true;
}
private void OnGotoNextChange(object _, RoutedEventArgs e)
{
var textDiff = this.FindDescendantOfType<TextDiffView>();
textDiff?.GotoNextChange();
e.Handled = true;
}
private void OnGotoLastChange(object _, RoutedEventArgs e)
{
var textDiff = this.FindDescendantOfType<TextDiffView>();
textDiff?.GotoLastChange();
e.Handled = true;
}
}
}