Browse Source

Fixed Config editor 3

Tig 11 months ago
parent
commit
b51a985012

+ 0 - 7
Terminal.Gui/View/View.Navigation.cs

@@ -364,11 +364,6 @@ public partial class View // Focus and cross-view navigation management (TabStop
             return (false, true);
             return (false, true);
         }
         }
 
 
-        //// If we previously had a subview with focus (`Focused = subview`), we need to make sure that all subviews down the `subview`-hierarchy LeaveFocus.
-        //// LeaveFocus will recurse down the subview hierarchy and will also set PreviouslyMostFocused
-        //View focused = Focused;
-        //focused?.SetHasFocusFalse (this, true);
-
         // Make sure superviews up the superview hierarchy have focus.
         // Make sure superviews up the superview hierarchy have focus.
         // Any of them may cancel gaining focus. In which case we need to back out.
         // Any of them may cancel gaining focus. In which case we need to back out.
         if (SuperView is { HasFocus: false } sv)
         if (SuperView is { HasFocus: false } sv)
@@ -408,8 +403,6 @@ public partial class View // Focus and cross-view navigation management (TabStop
                     // Couldn't advance, so we're the most focused view in the application
                     // Couldn't advance, so we're the most focused view in the application
                     _previouslyMostFocused = null;
                     _previouslyMostFocused = null;
                     Application.Navigation?.SetFocused (this);
                     Application.Navigation?.SetFocused (this);
-
-                    //NotifyFocusChanged (HasFocus, previousFocusedView, this);
                 }
                 }
             }
             }
         }
         }

+ 5 - 1
UICatalog/Scenarios/ConfigurationEditor.cs

@@ -150,7 +150,11 @@ public class ConfigurationEditor : Scenario
                                         };
                                         };
         }
         }
 
 
-        _tileView.Tiles.ToArray () [1].ContentView.SetFocus ();
+        if (_tileView.Tiles.Count > 2)
+        {
+            _tileView.Tiles.ToArray () [1].ContentView.SetFocus ();
+        }
+
         Application.Top.LayoutSubviews ();
         Application.Top.LayoutSubviews ();
     }
     }