cursor blink in entry/editor

This commit is contained in:
2026-01-17 15:26:13 +00:00
parent 88679dfae8
commit f4422d4af1
2 changed files with 37 additions and 17 deletions

View File

@@ -197,17 +197,14 @@ public class LinuxApplication : IDisposable
{
if (_focusedView != value)
{
if (_focusedView != null)
{
_focusedView.IsFocused = false;
}
var oldFocus = _focusedView;
_focusedView = value;
if (_focusedView != null)
{
_focusedView.IsFocused = true;
}
// Call OnFocusLost on the old view (this sets IsFocused = false and invalidates)
oldFocus?.OnFocusLost();
// Call OnFocusGained on the new view (this sets IsFocused = true and invalidates)
_focusedView?.OnFocusGained();
}
}
}
@@ -783,11 +780,15 @@ public class LinuxApplication : IDisposable
private void UpdateAnimations()
{
// Update cursor blink for entry controls
// Update cursor blink for text input controls
if (_focusedView is SkiaEntry entry)
{
entry.UpdateCursorBlink();
}
else if (_focusedView is SkiaEditor editor)
{
editor.UpdateCursorBlink();
}
}
private void Render()