mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-30 09:47:58 +01:00
code cleanup.
This commit is contained in:
@@ -320,24 +320,26 @@ public partial class View // Focus and cross-view navigation management (TabStop
|
||||
{
|
||||
set
|
||||
{
|
||||
if (HasFocus != value)
|
||||
if (HasFocus == value)
|
||||
{
|
||||
if (value)
|
||||
{
|
||||
// NOTE: If Application.Navigation is null, we pass null to FocusChanging. For unit tests.
|
||||
(bool focusSet, bool _) = SetHasFocusTrue (Application.Navigation?.GetFocused ());
|
||||
return;
|
||||
}
|
||||
|
||||
if (focusSet)
|
||||
{
|
||||
// The change happened
|
||||
// HasFocus is now true
|
||||
}
|
||||
}
|
||||
else
|
||||
if (value)
|
||||
{
|
||||
// NOTE: If Application.Navigation is null, we pass null to FocusChanging. For unit tests.
|
||||
(bool focusSet, bool _) = SetHasFocusTrue (Application.Navigation?.GetFocused ());
|
||||
|
||||
if (focusSet)
|
||||
{
|
||||
SetHasFocusFalse (null);
|
||||
// The change happened
|
||||
// HasFocus is now true
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SetHasFocusFalse (null);
|
||||
}
|
||||
}
|
||||
get => _hasFocus;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user