mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
fix: unable to access the Stage/Unstage
buttons in diff viewer when line wrap is enabled (#481)
* disable line wrap in side-by-side diff mode
This commit is contained in:
parent
bc633e4085
commit
934d784d40
2 changed files with 12 additions and 2 deletions
|
@ -45,7 +45,7 @@
|
||||||
IndicatorForeground="{DynamicResource Brush.FG2}"
|
IndicatorForeground="{DynamicResource Brush.FG2}"
|
||||||
FontFamily="{DynamicResource Fonts.Monospace}"
|
FontFamily="{DynamicResource Fonts.Monospace}"
|
||||||
UseSyntaxHighlighting="{Binding Source={x:Static vm:Preference.Instance}, Path=UseSyntaxHighlighting}"
|
UseSyntaxHighlighting="{Binding Source={x:Static vm:Preference.Instance}, Path=UseSyntaxHighlighting}"
|
||||||
WordWrap="{Binding Source={x:Static vm:Preference.Instance}, Path=EnableDiffViewWordWrap}"
|
WordWrap="False"
|
||||||
ShowHiddenSymbols="{Binding Source={x:Static vm:Preference.Instance}, Path=ShowHiddenSymbolsInDiffView}"
|
ShowHiddenSymbols="{Binding Source={x:Static vm:Preference.Instance}, Path=ShowHiddenSymbolsInDiffView}"
|
||||||
EnableChunkSelection="{Binding #ThisControl.EnableChunkSelection}"
|
EnableChunkSelection="{Binding #ThisControl.EnableChunkSelection}"
|
||||||
SelectedChunk="{Binding #ThisControl.SelectedChunk, Mode=TwoWay}"/>
|
SelectedChunk="{Binding #ThisControl.SelectedChunk, Mode=TwoWay}"/>
|
||||||
|
@ -65,7 +65,7 @@
|
||||||
IndicatorForeground="{DynamicResource Brush.FG2}"
|
IndicatorForeground="{DynamicResource Brush.FG2}"
|
||||||
FontFamily="{DynamicResource Fonts.Monospace}"
|
FontFamily="{DynamicResource Fonts.Monospace}"
|
||||||
UseSyntaxHighlighting="{Binding Source={x:Static vm:Preference.Instance}, Path=UseSyntaxHighlighting}"
|
UseSyntaxHighlighting="{Binding Source={x:Static vm:Preference.Instance}, Path=UseSyntaxHighlighting}"
|
||||||
WordWrap="{Binding Source={x:Static vm:Preference.Instance}, Path=EnableDiffViewWordWrap}"
|
WordWrap="False"
|
||||||
ShowHiddenSymbols="{Binding Source={x:Static vm:Preference.Instance}, Path=ShowHiddenSymbolsInDiffView}"
|
ShowHiddenSymbols="{Binding Source={x:Static vm:Preference.Instance}, Path=ShowHiddenSymbolsInDiffView}"
|
||||||
EnableChunkSelection="{Binding #ThisControl.EnableChunkSelection}"
|
EnableChunkSelection="{Binding #ThisControl.EnableChunkSelection}"
|
||||||
SelectedChunk="{Binding #ThisControl.SelectedChunk, Mode=TwoWay}"/>
|
SelectedChunk="{Binding #ThisControl.SelectedChunk, Mode=TwoWay}"/>
|
||||||
|
|
|
@ -519,8 +519,18 @@ namespace SourceGit.Views
|
||||||
private void OnTextViewPointerMoved(object sender, PointerEventArgs e)
|
private void OnTextViewPointerMoved(object sender, PointerEventArgs e)
|
||||||
{
|
{
|
||||||
if (EnableChunkSelection && sender is TextView view)
|
if (EnableChunkSelection && sender is TextView view)
|
||||||
|
{
|
||||||
|
var chunk = SelectedChunk;
|
||||||
|
if (chunk != null)
|
||||||
|
{
|
||||||
|
var rect = new Rect(0, chunk.Y, Bounds.Width, chunk.Height);
|
||||||
|
if (rect.Contains(e.GetPosition(this)))
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
UpdateSelectedChunk(e.GetPosition(view).Y + view.VerticalOffset);
|
UpdateSelectedChunk(e.GetPosition(view).Y + view.VerticalOffset);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void OnTextViewPointerWheelChanged(object sender, PointerWheelEventArgs e)
|
private void OnTextViewPointerWheelChanged(object sender, PointerWheelEventArgs e)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue