瀏覽代碼

Converted TabStop to auto property

Tig 1 年之前
父節點
當前提交
5d1467dc2a
共有 1 個文件被更改,包括 4 次插入10 次删除
  1. 4 10
      Terminal.Gui/View/View.Navigation.cs

+ 4 - 10
Terminal.Gui/View/View.Navigation.cs

@@ -469,7 +469,7 @@ public partial class View // Focus and cross-view navigation management (TabStop
 
 
         foreach (View view in _tabIndexes.Where (v => !overlappedOnly || v.Arrangement.HasFlag (ViewArrangement.Overlapped)))
         foreach (View view in _tabIndexes.Where (v => !overlappedOnly || v.Arrangement.HasFlag (ViewArrangement.Overlapped)))
         {
         {
-            if (view.CanFocus && view._tabStop && view.Visible && view.Enabled)
+            if (view.CanFocus && view.TabStop && view.Visible && view.Enabled)
             {
             {
                 SetFocus (view);
                 SetFocus (view);
 
 
@@ -503,7 +503,7 @@ public partial class View // Focus and cross-view navigation management (TabStop
 
 
         foreach (View view in _tabIndexes.Where (v => !overlappedOnly || v.Arrangement.HasFlag (ViewArrangement.Overlapped)).Reverse ())
         foreach (View view in _tabIndexes.Where (v => !overlappedOnly || v.Arrangement.HasFlag (ViewArrangement.Overlapped)).Reverse ())
         {
         {
-            if (view.CanFocus && view._tabStop && view.Visible && view.Enabled)
+            if (view.CanFocus && view.TabStop && view.Visible && view.Enabled)
             {
             {
                 SetFocus (view);
                 SetFocus (view);
 
 
@@ -601,7 +601,7 @@ public partial class View // Focus and cross-view navigation management (TabStop
             }
             }
 
 
             // The subview does not have focus, but at least one other that can. Can this one be focused?
             // The subview does not have focus, but at least one other that can. Can this one be focused?
-            if (focusedFound && w.CanFocus && w._tabStop && w.Visible && w.Enabled)
+            if (focusedFound && w.CanFocus && w.TabStop && w.Visible && w.Enabled)
             {
             {
                 // Make Focused Leave
                 // Make Focused Leave
                 Focused.SetHasFocus (false, w);
                 Focused.SetHasFocus (false, w);
@@ -763,8 +763,6 @@ public partial class View // Focus and cross-view navigation management (TabStop
         }
         }
     }
     }
 
 
-    private bool _tabStop = true;
-
     /// <summary>
     /// <summary>
     ///     Gets or sets whether the view is a stop-point for keyboard navigation.
     ///     Gets or sets whether the view is a stop-point for keyboard navigation.
     /// </summary>
     /// </summary>
@@ -778,11 +776,7 @@ public partial class View // Focus and cross-view navigation management (TabStop
     ///     modifying the key bindings (see <see cref="KeyBindings.Add(Key, Command[])"/>) of the SuperView.
     ///     modifying the key bindings (see <see cref="KeyBindings.Add(Key, Command[])"/>) of the SuperView.
     /// </para>
     /// </para>
     /// </remarks>
     /// </remarks>
-    public bool TabStop
-    {
-        get => _tabStop;
-        set => _tabStop = value;
-    }
+    public bool TabStop { get; set; } = true;
 
 
     #endregion Tab/Focus Handling
     #endregion Tab/Focus Handling
 }
 }