Browse Source
Fixed blinking caret (#12846)
Co-authored-by: Herman Kirshin <herman.kirshin@jetbrains.com>
pull/12851/head
Herman K
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
7 additions and
1 deletions
-
src/Avalonia.Controls/Presenters/TextPresenter.cs
|
|
|
@ -97,7 +97,6 @@ namespace Avalonia.Controls.Presenters |
|
|
|
public TextPresenter() |
|
|
|
{ |
|
|
|
_caretTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(500) }; |
|
|
|
_caretTimer.Tick += CaretTimerTick; |
|
|
|
} |
|
|
|
|
|
|
|
public event EventHandler? CaretBoundsChanged; |
|
|
|
@ -814,6 +813,13 @@ namespace Avalonia.Controls.Presenters |
|
|
|
return _caretBounds; |
|
|
|
} |
|
|
|
|
|
|
|
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e) |
|
|
|
{ |
|
|
|
base.OnAttachedToVisualTree(e); |
|
|
|
|
|
|
|
_caretTimer.Tick += CaretTimerTick; |
|
|
|
} |
|
|
|
|
|
|
|
protected override void OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs e) |
|
|
|
{ |
|
|
|
base.OnDetachedFromVisualTree(e); |
|
|
|
|