2
0
Эх сурвалжийг харах

View Draw API docs and code cleanup

Tig 9 сар өмнө
parent
commit
92dac0ecfb

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

@@ -199,7 +199,7 @@ public class Adornment : View, IDesignable
     }
 
     /// <inheritdoc/>
-    protected override bool OnDrawComplete (Rectangle viewport) { return Thickness == Thickness.Empty; }
+    protected override void OnDrawComplete () { }
 
     /// <summary>
     ///     Indicates whether the specified Parent's SuperView-relative coordinates are within the Adornment's Thickness.

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

@@ -51,7 +51,7 @@ public partial class View // Drawing APIs
         ClearNeedsDisplay ();
 
         // We're done
-        DoDrawComplete (Viewport);
+        DoDrawComplete ();
     }
 
     #region DrawAdornments

+ 1 - 1
Terminal.Gui/Views/FileDialog.cs

@@ -461,7 +461,7 @@ public class FileDialog : Dialog
             AllowedTypeMenuClicked (0);
 
             // TODO: Using v1's menu bar here is a hack. Need to upgrade this.
-            _allowedTypeMenuBar.DrawComplete += (s, e) =>
+            _allowedTypeMenuBar.DrawingContent += (s, e) =>
                                                        {
                                                            _allowedTypeMenuBar.Move (e.NewViewport.Width - 1, 0);
                                                            Driver.AddRune (Glyphs.DownArrow);

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

@@ -394,7 +394,7 @@ internal sealed class Menu : View
     }
 
     // By doing this we draw last, over everything else.
-    private void Top_DrawComplete (object? sender, DrawEventArgs e)
+    private void Top_DrawComplete (object? sender, EventArgs e)
     {
         if (!Visible)
         {

+ 3 - 3
Terminal.Gui/Views/TabView.cs

@@ -660,11 +660,11 @@ public class TabView : View
             return true;
         }
 
-        protected override bool OnDrawComplete (Rectangle viewport)
+        protected override void OnDrawComplete ()
         {
             if (_host._tabLocations is null)
             {
-                return true;
+                return;
             }
 
             TabToRender [] tabLocations = _host._tabLocations;
@@ -1193,7 +1193,7 @@ public class TabView : View
                 tab.DrawAdornments ();
             }
 
-            return true;
+            return;
         }
 
         private int GetUnderlineYPosition ()

+ 2 - 4
Terminal.Gui/Views/TileView.cs

@@ -180,12 +180,10 @@ public class TileView : View
     protected override bool OnRenderingLineCanvas () { return false; }
 
     /// <inheritdoc/>
-    protected override bool OnDrawComplete (Rectangle viewport)
+    protected override void OnDrawComplete ()
     {
         Driver?.SetAttribute (ColorScheme.Normal);
 
-        //Clear ();
-
         var lc = new LineCanvas ();
 
         List<TileViewLineView> allLines = GetAllLineViewsRecursively (this);
@@ -275,7 +273,7 @@ public class TileView : View
             }
         }
 
-        return false;
+        return;
     }
 
     //// BUGBUG: Why is this not handled by a key binding???

+ 1 - 1
UnitTests/Views/ToplevelTests.cs

@@ -964,7 +964,7 @@ public partial class ToplevelTests (ITestOutputHelper output)
                                Application.Top!.DrawComplete += OnDrawContentComplete;
                                top.Add (viewAddedToTop);
 
-                               void OnDrawContentComplete (object sender, DrawEventArgs e)
+                               void OnDrawContentComplete (object sender, EventArgs _)
                                {
                                    Assert.Equal (new (1, 3, 18, 16), viewAddedToTop.Frame);