mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34:59 +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
|
@ -101,12 +101,12 @@ namespace SourceGit.ViewModels
|
|||
return (_current >= 0 && _current < Blocks.Count) ? Blocks[_current] : null;
|
||||
}
|
||||
|
||||
public Block GotoNext()
|
||||
public Block GotoFirst()
|
||||
{
|
||||
if (Blocks.Count == 0)
|
||||
return null;
|
||||
|
||||
Current = (_current + 1) % Blocks.Count;
|
||||
Current = 0;
|
||||
return Blocks[_current];
|
||||
}
|
||||
|
||||
|
@ -115,7 +115,29 @@ namespace SourceGit.ViewModels
|
|||
if (Blocks.Count == 0)
|
||||
return null;
|
||||
|
||||
Current = _current == -1 ? Blocks.Count - 1 : (_current - 1 + Blocks.Count) % Blocks.Count;
|
||||
if (_current == -1)
|
||||
Current = 0;
|
||||
else if (_current > 0)
|
||||
Current = _current - 1;
|
||||
return Blocks[_current];
|
||||
}
|
||||
|
||||
public Block GotoNext()
|
||||
{
|
||||
if (Blocks.Count == 0)
|
||||
return null;
|
||||
|
||||
if (_current < Blocks.Count - 1)
|
||||
Current = _current + 1;
|
||||
return Blocks[_current];
|
||||
}
|
||||
|
||||
public Block GotoLast()
|
||||
{
|
||||
if (Blocks.Count == 0)
|
||||
return null;
|
||||
|
||||
Current = Blocks.Count - 1;
|
||||
return Blocks[_current];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue