mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-28 16:58:01 +01:00
Ensures the HasFocus property only can be set by the SetHasFocus method. Removed unnecessary code in Menu.
This commit is contained in:
@@ -24,12 +24,11 @@ namespace Terminal.Gui {
|
||||
/// <value><c>true</c> if can focus; otherwise, <c>false</c>.</value>
|
||||
public virtual bool CanFocus { get; set; }
|
||||
|
||||
internal bool hasFocus;
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this <see cref="Responder"/> has focus.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if has focus; otherwise, <c>false</c>.</value>
|
||||
public virtual bool HasFocus { get { return hasFocus; } }
|
||||
public virtual bool HasFocus { get; }
|
||||
|
||||
// Key handling
|
||||
/// <summary>
|
||||
|
||||
@@ -895,6 +895,7 @@ namespace Terminal.Gui {
|
||||
}
|
||||
}
|
||||
|
||||
bool hasFocus;
|
||||
/// <inheritdoc/>
|
||||
public override bool HasFocus {
|
||||
get {
|
||||
|
||||
@@ -535,8 +535,6 @@ namespace Terminal.Gui {
|
||||
if (item == null || !item.IsEnabled ()) disabled = true;
|
||||
if (item != null && !disabled)
|
||||
current = me.Y - 1;
|
||||
hasFocus = true;
|
||||
SetNeedsDisplay ();
|
||||
CheckSubMenu ();
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user