mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 12:15:00 +00:00
enhance: only raise BlockNavigationChangedEvent
when UseBlockNavigation
enabled
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
9590f96a44
commit
d335cac167
2 changed files with 12 additions and 6 deletions
|
@ -37,7 +37,7 @@ namespace SourceGit.Views
|
||||||
|
|
||||||
private void OnBlockNavigationChanged(object sender, RoutedEventArgs e)
|
private void OnBlockNavigationChanged(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (sender is TextDiffView { UseBlockNavigation: true } textDiff)
|
if (sender is TextDiffView textDiff)
|
||||||
BlockNavigationIndicator.Text = textDiff.BlockNavigation?.Indicator ?? string.Empty;
|
BlockNavigationIndicator.Text = textDiff.BlockNavigation?.Indicator ?? string.Empty;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1746,25 +1746,25 @@ namespace SourceGit.Views
|
||||||
public void GotoFirstChange()
|
public void GotoFirstChange()
|
||||||
{
|
{
|
||||||
this.FindDescendantOfType<ThemedTextDiffPresenter>()?.GotoFirstChange();
|
this.FindDescendantOfType<ThemedTextDiffPresenter>()?.GotoFirstChange();
|
||||||
RaiseEvent(new RoutedEventArgs(BlockNavigationChangedEvent));
|
TryRaiseBlockNavigationChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void GotoPrevChange()
|
public void GotoPrevChange()
|
||||||
{
|
{
|
||||||
this.FindDescendantOfType<ThemedTextDiffPresenter>()?.GotoPrevChange();
|
this.FindDescendantOfType<ThemedTextDiffPresenter>()?.GotoPrevChange();
|
||||||
RaiseEvent(new RoutedEventArgs(BlockNavigationChangedEvent));
|
TryRaiseBlockNavigationChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void GotoNextChange()
|
public void GotoNextChange()
|
||||||
{
|
{
|
||||||
this.FindDescendantOfType<ThemedTextDiffPresenter>()?.GotoNextChange();
|
this.FindDescendantOfType<ThemedTextDiffPresenter>()?.GotoNextChange();
|
||||||
RaiseEvent(new RoutedEventArgs(BlockNavigationChangedEvent));
|
TryRaiseBlockNavigationChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void GotoLastChange()
|
public void GotoLastChange()
|
||||||
{
|
{
|
||||||
this.FindDescendantOfType<ThemedTextDiffPresenter>()?.GotoLastChange();
|
this.FindDescendantOfType<ThemedTextDiffPresenter>()?.GotoLastChange();
|
||||||
RaiseEvent(new RoutedEventArgs(BlockNavigationChangedEvent));
|
TryRaiseBlockNavigationChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnDataContextChanged(EventArgs e)
|
protected override void OnDataContextChanged(EventArgs e)
|
||||||
|
@ -1818,7 +1818,7 @@ namespace SourceGit.Views
|
||||||
else
|
else
|
||||||
BlockNavigation = null;
|
BlockNavigation = null;
|
||||||
|
|
||||||
RaiseEvent(new RoutedEventArgs(BlockNavigationChangedEvent));
|
TryRaiseBlockNavigationChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnStageChunk(object _1, RoutedEventArgs _2)
|
private void OnStageChunk(object _1, RoutedEventArgs _2)
|
||||||
|
@ -1990,5 +1990,11 @@ namespace SourceGit.Views
|
||||||
repo.MarkWorkingCopyDirtyManually();
|
repo.MarkWorkingCopyDirtyManually();
|
||||||
repo.SetWatcherEnabled(true);
|
repo.SetWatcherEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void TryRaiseBlockNavigationChanged()
|
||||||
|
{
|
||||||
|
if (UseBlockNavigation)
|
||||||
|
RaiseEvent(new RoutedEventArgs(BlockNavigationChangedEvent));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue