View Draw API docs and code cleanup

This commit is contained in:
Tig
2024-10-26 16:46:24 -07:00
parent ee29ed87ed
commit 92dac0ecfb
7 changed files with 10 additions and 12 deletions

View File

@@ -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.

View File

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

View File

@@ -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);

View File

@@ -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)
{

View File

@@ -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 ()

View File

@@ -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???

View File

@@ -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);