mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-20 19:55:00 +00:00
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.
This commit is contained in:
parent
9ab602788a
commit
fa4caa2186
6 changed files with 127 additions and 3 deletions
|
@ -543,6 +543,21 @@ namespace SourceGit.Views
|
|||
{
|
||||
}
|
||||
|
||||
public void GotoFirstChange()
|
||||
{
|
||||
var blockNavigation = BlockNavigation;
|
||||
if (blockNavigation != null)
|
||||
{
|
||||
var prev = blockNavigation.GotoFirst();
|
||||
if (prev != null)
|
||||
{
|
||||
TextArea.Caret.Line = prev.Start;
|
||||
ScrollToLine(prev.Start);
|
||||
}
|
||||
}
|
||||
// NOTE: Not implemented (button hidden) for non-block navigation.
|
||||
}
|
||||
|
||||
public void GotoPrevChange()
|
||||
{
|
||||
var blockNavigation = BlockNavigation;
|
||||
|
@ -641,6 +656,21 @@ namespace SourceGit.Views
|
|||
}
|
||||
}
|
||||
|
||||
public void GotoLastChange()
|
||||
{
|
||||
var blockNavigation = BlockNavigation;
|
||||
if (blockNavigation != null)
|
||||
{
|
||||
var next = blockNavigation.GotoLast();
|
||||
if (next != null)
|
||||
{
|
||||
TextArea.Caret.Line = next.Start;
|
||||
ScrollToLine(next.Start);
|
||||
}
|
||||
}
|
||||
// NOTE: Not implemented (button hidden) for non-block navigation.
|
||||
}
|
||||
|
||||
public override void Render(DrawingContext context)
|
||||
{
|
||||
base.Render(context);
|
||||
|
@ -1682,6 +1712,19 @@ namespace SourceGit.Views
|
|||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void GotoFirstChange()
|
||||
{
|
||||
var presenter = this.FindDescendantOfType<ThemedTextDiffPresenter>();
|
||||
if (presenter == null)
|
||||
return;
|
||||
|
||||
presenter.GotoFirstChange();
|
||||
if (presenter is SingleSideTextDiffPresenter singleSide)
|
||||
singleSide.ForceSyncScrollOffset();
|
||||
|
||||
BlockNavigationIndicator = BlockNavigation?.Indicator ?? string.Empty;
|
||||
}
|
||||
|
||||
public void GotoPrevChange()
|
||||
{
|
||||
var presenter = this.FindDescendantOfType<ThemedTextDiffPresenter>();
|
||||
|
@ -1708,6 +1751,19 @@ namespace SourceGit.Views
|
|||
BlockNavigationIndicator = BlockNavigation?.Indicator ?? string.Empty;
|
||||
}
|
||||
|
||||
public void GotoLastChange()
|
||||
{
|
||||
var presenter = this.FindDescendantOfType<ThemedTextDiffPresenter>();
|
||||
if (presenter == null)
|
||||
return;
|
||||
|
||||
presenter.GotoLastChange();
|
||||
if (presenter is SingleSideTextDiffPresenter singleSide)
|
||||
singleSide.ForceSyncScrollOffset();
|
||||
|
||||
BlockNavigationIndicator = BlockNavigation?.Indicator ?? string.Empty;
|
||||
}
|
||||
|
||||
protected override void OnDataContextChanged(EventArgs e)
|
||||
{
|
||||
base.OnDataContextChanged(e);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue