mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
fix: the highlight background not updated while scrolling using mouse wheel without focus the text editor control (#448)
This commit is contained in:
parent
24301751d3
commit
32c0aa61cd
1 changed files with 7 additions and 0 deletions
|
@ -234,6 +234,7 @@ namespace SourceGit.Views
|
||||||
TextArea.LeftMargins.Add(new CommitInfoMargin(this) { Margin = new Thickness(8, 0) });
|
TextArea.LeftMargins.Add(new CommitInfoMargin(this) { Margin = new Thickness(8, 0) });
|
||||||
TextArea.LeftMargins.Add(new VerticalSeperatorMargin(this));
|
TextArea.LeftMargins.Add(new VerticalSeperatorMargin(this));
|
||||||
TextArea.LayoutUpdated += OnTextAreaLayoutUpdated;
|
TextArea.LayoutUpdated += OnTextAreaLayoutUpdated;
|
||||||
|
TextArea.PointerWheelChanged += OnTextAreaPointerWheelChanged;
|
||||||
TextArea.TextView.ContextRequested += OnTextViewContextRequested;
|
TextArea.TextView.ContextRequested += OnTextViewContextRequested;
|
||||||
TextArea.TextView.VisualLinesChanged += OnTextViewVisualLinesChanged;
|
TextArea.TextView.VisualLinesChanged += OnTextViewVisualLinesChanged;
|
||||||
TextArea.TextView.Margin = new Thickness(4, 0);
|
TextArea.TextView.Margin = new Thickness(4, 0);
|
||||||
|
@ -333,6 +334,12 @@ namespace SourceGit.Views
|
||||||
InvalidateVisual();
|
InvalidateVisual();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnTextAreaPointerWheelChanged(object sender, PointerWheelEventArgs e)
|
||||||
|
{
|
||||||
|
if (!TextArea.IsFocused)
|
||||||
|
Focus();
|
||||||
|
}
|
||||||
|
|
||||||
private void OnTextViewContextRequested(object sender, ContextRequestedEventArgs e)
|
private void OnTextViewContextRequested(object sender, ContextRequestedEventArgs e)
|
||||||
{
|
{
|
||||||
var selected = SelectedText;
|
var selected = SelectedText;
|
||||||
|
|
Loading…
Reference in a new issue