diff --git a/Terminal.Gui/View/ViewDrawing.cs b/Terminal.Gui/View/ViewDrawing.cs index ff2d8d412..ac6017d21 100644 --- a/Terminal.Gui/View/ViewDrawing.cs +++ b/Terminal.Gui/View/ViewDrawing.cs @@ -80,6 +80,28 @@ public partial class View Driver.AddRune (ch); } + /// Clears with the normal background. + /// + public void Clear () { Clear (Bounds); } + + /// Clears the specified -relative rectangle with the normal background. + /// + /// The Bounds-relative rectangle to clear. + public void Clear (Rectangle contentArea) + { + if (Driver is null) + { + return; + } + + Attribute prev = Driver.SetAttribute (GetNormalColor ()); + + // Clamp the region to the bounds of the view + contentArea = Rectangle.Intersect (contentArea, Bounds); + Driver.FillRect (BoundsToScreen (contentArea)); + Driver.SetAttribute (prev); + } + /// Clears the with the normal background color. /// /// This clears the Bounds used by this view. @@ -94,35 +116,11 @@ public partial class View } Attribute prev = Driver.SetAttribute (GetNormalColor ()); - Driver.FillRect (FrameToScreen()); + Driver.FillRect (FrameToScreen ()); Driver.SetAttribute (prev); } } - /// Clears with the normal background. - /// - public void Clear () - { - Clear (Bounds); - } - - /// Clears the specified -relative rectangle with the normal background. - /// - /// The Bounds-relative rectangle to clear. - public void Clear (Rectangle contentArea) - { - if (Driver is null) - { - return; - } - - Attribute prev = Driver.SetAttribute (GetNormalColor ()); - // Clamp the region to the bounds of the view - contentArea = Rectangle.Intersect (contentArea, Bounds); - Driver.FillRect (BoundsToScreen(contentArea)); - Driver.SetAttribute (prev); - } - /// Expands the 's clip region to include . /// /// The current screen-relative clip region, which can be then re-applied by setting @@ -294,7 +292,7 @@ public partial class View if (ColorScheme is null) { - cs = new ColorScheme (); + cs = new (); } return Enabled ? cs.Focus : cs.Disabled; @@ -312,7 +310,7 @@ public partial class View if (ColorScheme is null) { - cs = new ColorScheme (); + cs = new (); } return Enabled ? cs.HotNormal : cs.Disabled; @@ -330,7 +328,7 @@ public partial class View if (ColorScheme is null) { - cs = new ColorScheme (); + cs = new (); } return Enabled ? cs.Normal : cs.Disabled; @@ -447,7 +445,7 @@ public partial class View /// This method will be called after any subviews removed with have been completed /// drawing. /// - public virtual void OnDrawContentComplete (Rectangle contentArea) { DrawContentComplete?.Invoke (this, new DrawEventArgs (contentArea)); } + public virtual void OnDrawContentComplete (Rectangle contentArea) { DrawContentComplete?.Invoke (this, new (contentArea)); } // TODO: Make this cancelable ///