Browse Source

Overlapped now comes to front when focused

Tig 11 months ago
parent
commit
de3068f7f6

+ 5 - 0
Terminal.Gui/Application/ApplicationNavigation.cs

@@ -78,6 +78,11 @@ public class ApplicationNavigation
 
         _focused = value;
 
+        if (_focused is { } && _focused.Arrangement.HasFlag (ViewArrangement.Overlapped))
+        {
+            _focused.SuperView?.MoveSubviewToStart (_focused);
+        }
+
         FocusedChanged?.Invoke (null, EventArgs.Empty);
     }
 

+ 5 - 0
UICatalog/Scenarios/Navigation.cs

@@ -127,6 +127,11 @@ public class Navigation : Scenario
                                     {
                                         overlappedView2.Visible = !overlappedView2.Visible;
                                         overlappedView2.Enabled = overlappedView2.Visible;
+
+                                        if (overlappedView2.Visible)
+                                        {
+                                            overlappedView2.SetFocus ();
+                                        }
                                     }
                        });
         overlappedView2.Add (statusBar);