Tig 1 år sedan
förälder
incheckning
34ac8c8038
1 ändrade filer med 26 tillägg och 28 borttagningar
  1. 26 28
      Terminal.Gui/View/ViewDrawing.cs

+ 26 - 28
Terminal.Gui/View/ViewDrawing.cs

@@ -80,31 +80,9 @@ public partial class View
         Driver.AddRune (ch);
     }
 
-    /// <summary>Clears the <see cref="Frame"/> with the normal background color.</summary>
-    /// <remarks>
-    ///     <para>This clears the Bounds used by this view.</para>
-    /// </remarks>
-    public void ClearFrame ()
-    {
-        if (IsInitialized)
-        {
-            if (Driver is null)
-            {
-                return;
-            }
-
-            Attribute prev = Driver.SetAttribute (GetNormalColor ());
-            Driver.FillRect (FrameToScreen());
-            Driver.SetAttribute (prev);
-        }
-    }
-
     /// <summary>Clears <see cref="Bounds"/> with the normal background.</summary>
     /// <remarks></remarks>
-    public void Clear ()
-    {
-        Clear (Bounds);
-    }
+    public void Clear () { Clear (Bounds); }
 
     /// <summary>Clears the specified <see cref="Bounds"/>-relative rectangle with the normal background.</summary>
     /// <remarks></remarks>
@@ -117,12 +95,32 @@ public partial class View
         }
 
         Attribute prev = Driver.SetAttribute (GetNormalColor ());
+
         // Clamp the region to the bounds of the view
         contentArea = Rectangle.Intersect (contentArea, Bounds);
-        Driver.FillRect (BoundsToScreen(contentArea));
+        Driver.FillRect (BoundsToScreen (contentArea));
         Driver.SetAttribute (prev);
     }
 
+    /// <summary>Clears the <see cref="Frame"/> with the normal background color.</summary>
+    /// <remarks>
+    ///     <para>This clears the Bounds used by this view.</para>
+    /// </remarks>
+    public void ClearFrame ()
+    {
+        if (IsInitialized)
+        {
+            if (Driver is null)
+            {
+                return;
+            }
+
+            Attribute prev = Driver.SetAttribute (GetNormalColor ());
+            Driver.FillRect (FrameToScreen ());
+            Driver.SetAttribute (prev);
+        }
+    }
+
     /// <summary>Expands the <see cref="ConsoleDriver"/>'s clip region to include <see cref="Bounds"/>.</summary>
     /// <returns>
     ///     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 <see cref="Remove(View)"/> have been completed
     ///     drawing.
     /// </remarks>
-    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
     /// <summary>