فهرست منبع

Fixed more cases

Tig 8 ماه پیش
والد
کامیت
88f3d05a19

+ 1 - 0
CommunityToolkitExample/LoginView.cs

@@ -59,6 +59,7 @@ internal partial class LoginView : IRecipient<Message<LoginActions>>
                 }
         }
         SetText();
+        // BUGBUG: This should not be needed:
         Application.LayoutAndDraw ();
     }
 

+ 1 - 1
Terminal.Gui/Application/Application.Keyboard.cs

@@ -205,7 +205,7 @@ public static partial class Application // Keyboard handling
                     Command.Refresh,
                     static () =>
                     {
-                        LayoutAndDraw ();
+                        LayoutAndDraw (true);
 
                         return true;
                     }

+ 0 - 1
Terminal.Gui/Application/Application.Run.cs

@@ -508,7 +508,6 @@ public static partial class Application // Run (Begin, Run, End, Stop)
         if (ClearScreenNextIteration)
         {
             forceDraw = true;
-            ClearScreenNextIteration = false;
         }
         if (forceDraw)
         {

+ 1 - 1
Terminal.Gui/Application/Application.Screen.cs

@@ -63,7 +63,7 @@ public static partial class Application // Screen related stuff
             t.SetNeedsLayout ();
         }
 
-        LayoutAndDraw ();
+        LayoutAndDraw (true);
 
         return true;
     }

+ 8 - 1
Terminal.Gui/View/View.cs

@@ -369,7 +369,14 @@ public partial class View : IDisposable, ISupportInitializeNotification
             SetNeedsLayout ();
             SuperView?.SetNeedsLayout ();
             SetNeedsDraw ();
-            SuperView?.SetNeedsDraw ();
+            if (SuperView is { })
+            {
+                SuperView?.SetNeedsDraw ();
+            }
+            else
+            {
+                Application.ClearScreenNextIteration = true;
+            }
         }
     }
 

+ 1 - 2
Terminal.Gui/Views/Menu/Menu.cs

@@ -608,8 +608,7 @@ internal sealed class Menu : View
 
         Application.UngrabMouse ();
         _host.CloseAllMenus ();
-        Application.Driver!.ClearContents ();
-        Application.LayoutAndDraw ();
+        Application.LayoutAndDraw (true);
 
         _host.Run (action);
     }

+ 1 - 1
Terminal.Gui/Views/Menu/MenuBar.cs

@@ -1117,7 +1117,7 @@ public class MenuBar : View, IDesignable
 
         Application.UngrabMouse ();
         CloseAllMenus ();
-        Application.LayoutAndDraw ();
+        Application.LayoutAndDraw (true);
         _openedByAltKey = true;
 
         return Run (item.Action);