Selaa lähdekoodia

Reamed Bounds -> Viewport in comments

Tig 1 vuosi sitten
vanhempi
commit
3a40dec249
34 muutettua tiedostoa jossa 140 lisäystä ja 140 poistoa
  1. 3 3
      Terminal.Gui/Application.cs
  2. 1 1
      Terminal.Gui/ConsoleDrivers/ConsoleDriver.cs
  3. 11 11
      Terminal.Gui/Drawing/LineCanvas.cs
  4. 2 2
      Terminal.Gui/Drawing/StraightLine.cs
  5. 1 1
      Terminal.Gui/View/Adornment/Adornment.cs
  6. 20 20
      Terminal.Gui/View/Layout/ViewLayout.cs
  7. 1 1
      Terminal.Gui/View/View.cs
  8. 4 4
      Terminal.Gui/View/ViewDrawing.cs
  9. 3 3
      Terminal.Gui/View/ViewText.cs
  10. 1 1
      Terminal.Gui/Views/FileDialog.cs
  11. 1 1
      Terminal.Gui/Views/GraphView/Annotations.cs
  12. 6 6
      Terminal.Gui/Views/HexView.cs
  13. 1 1
      Terminal.Gui/Views/Menu/ContextMenu.cs
  14. 2 2
      Terminal.Gui/Views/Menu/MenuBar.cs
  15. 1 1
      Terminal.Gui/Views/ProgressBar.cs
  16. 4 4
      Terminal.Gui/Views/Slider.cs
  17. 1 1
      Terminal.Gui/Views/TextField.cs
  18. 1 1
      Terminal.Gui/Views/Toplevel.cs
  19. 1 1
      UICatalog/Scenarios/Buttons.cs
  20. 4 4
      UICatalog/Scenarios/CharacterMap.cs
  21. 3 3
      UICatalog/Scenarios/ViewExperiments.cs
  22. 3 3
      UnitTests/Application/MouseTests.cs
  23. 18 18
      UnitTests/Drawing/LineCanvasTests.cs
  24. 2 2
      UnitTests/Drawing/StraightLineTests.cs
  25. 1 1
      UnitTests/View/Adornment/ToScreenTests.cs
  26. 5 5
      UnitTests/View/DrawTests.cs
  27. 14 14
      UnitTests/View/Layout/AbsoluteLayoutTests.cs
  28. 1 1
      UnitTests/View/Layout/BoundsTests.cs
  29. 1 1
      UnitTests/View/Layout/DimTests.cs
  30. 2 2
      UnitTests/View/Layout/PosTests.cs
  31. 18 18
      UnitTests/View/SubviewTests.cs
  32. 1 1
      UnitTests/View/ViewTests.cs
  33. 1 1
      UnitTests/Views/ScrollBarViewTests.cs
  34. 1 1
      UnitTests/Views/TextViewTests.cs

+ 3 - 3
Terminal.Gui/Application.cs

@@ -296,7 +296,7 @@ public static partial class Application
         Current = Top;
 
         // Ensure Top's layout is up to date.
-        Current.SetRelativeLayout (Driver.Bounds);
+        Current.SetRelativeLayout (Driver.Viewport);
 
         SupportedCultures = GetSupportedCultures ();
         _mainThreadId = Thread.CurrentThread.ManagedThreadId;
@@ -487,7 +487,7 @@ public static partial class Application
         }
 
         //if (Toplevel.LayoutStyle == LayoutStyle.Computed) {
-        Toplevel.SetRelativeLayout (Driver.Bounds);
+        Toplevel.SetRelativeLayout (Driver.Viewport);
 
         //}
 
@@ -1408,7 +1408,7 @@ public static partial class Application
         if (MouseGrabView is { })
         {
             // If the mouse is grabbed, send the event to the view that grabbed it.
-            // The coordinates are relative to the Bounds of the view that grabbed the mouse.
+            // The coordinates are relative to the Viewport of the view that grabbed the mouse.
             Point frameLoc = MouseGrabView.ScreenToFrame (a.MouseEvent.X, a.MouseEvent.Y);
 
             var viewRelativeMouseEvent = new MouseEvent

+ 1 - 1
Terminal.Gui/ConsoleDrivers/ConsoleDriver.cs

@@ -19,7 +19,7 @@ public abstract class ConsoleDriver
     internal bool [] _dirtyLines;
 
     /// <summary>Gets the dimensions of the terminal.</summary>
-    public Rectangle Bounds => new (0, 0, Cols, Rows);
+    public Rectangle Viewport => new (0, 0, Cols, Rows);
 
     /// <summary>
     ///     Gets or sets the clip rectangle that <see cref="AddRune(Rune)"/> and <see cref="AddStr(string)"/> are subject

+ 11 - 11
Terminal.Gui/Drawing/LineCanvas.cs

@@ -67,7 +67,7 @@ public class LineCanvas : IDisposable
     ///     Gets the rectangle that describes the bounds of the canvas. Location is the coordinates of the line that is
     ///     furthest left/top and Size is defined by the line that extends the furthest right/bottom.
     /// </summary>
-    public Rectangle Bounds
+    public Rectangle Viewport
     {
         get
         {
@@ -78,11 +78,11 @@ public class LineCanvas : IDisposable
                     return _cachedBounds;
                 }
 
-                Rectangle bounds = _lines [0].Bounds;
+                Rectangle bounds = _lines [0].Viewport;
 
                 for (var i = 1; i < _lines.Count; i++)
                 {
-                    bounds = Rectangle.Union (bounds, _lines [i].Bounds);
+                    bounds = Rectangle.Union (bounds, _lines [i].Viewport);
                 }
 
                 if (bounds is {Width: 0} or {Height: 0})
@@ -170,9 +170,9 @@ public class LineCanvas : IDisposable
         Dictionary<Point, Cell> map = new ();
 
         // walk through each pixel of the bitmap
-        for (int y = Bounds.Y; y < Bounds.Y + Bounds.Height; y++)
+        for (int y = Viewport.Y; y < Viewport.Y + Viewport.Height; y++)
         {
-            for (int x = Bounds.X; x < Bounds.X + Bounds.Width; x++)
+            for (int x = Viewport.X; x < Viewport.X + Viewport.Width; x++)
             {
                 IntersectionDefinition? [] intersects = _lines
                                                         .Select (l => l.Intersects (x, y))
@@ -232,7 +232,7 @@ public class LineCanvas : IDisposable
     ///     intersection symbols.
     /// </summary>
     /// <returns>A map of all the points within the canvas.</returns>
-    public Dictionary<Point, Rune> GetMap () { return GetMap (Bounds); }
+    public Dictionary<Point, Rune> GetMap () { return GetMap (Viewport); }
 
     /// <summary>Merges one line canvas into this one.</summary>
     /// <param name="lineCanvas"></param>
@@ -260,13 +260,13 @@ public class LineCanvas : IDisposable
 
     /// <summary>
     ///     Returns the contents of the line canvas rendered to a string. The string will include all columns and rows,
-    ///     even if <see cref="Bounds"/> has negative coordinates. For example, if the canvas contains a single line that
+    ///     even if <see cref="Viewport"/> has negative coordinates. For example, if the canvas contains a single line that
     ///     starts at (-1,-1) with a length of 2, the rendered string will have a length of 2.
     /// </summary>
     /// <returns>The canvas rendered to a string.</returns>
     public override string ToString ()
     {
-        if (Bounds.IsEmpty)
+        if (Viewport.IsEmpty)
         {
             return string.Empty;
         }
@@ -275,13 +275,13 @@ public class LineCanvas : IDisposable
         Dictionary<Point, Rune> runeMap = GetMap ();
 
         // Create the rune canvas
-        Rune [,] canvas = new Rune [Bounds.Height, Bounds.Width];
+        Rune [,] canvas = new Rune [Viewport.Height, Viewport.Width];
 
         // Copy the rune map to the canvas, adjusting for any negative coordinates
         foreach (KeyValuePair<Point, Rune> kvp in runeMap)
         {
-            int x = kvp.Key.X - Bounds.X;
-            int y = kvp.Key.Y - Bounds.Y;
+            int x = kvp.Key.X - Viewport.X;
+            int y = kvp.Key.Y - Viewport.Y;
             canvas [y, x] = kvp.Value;
         }
 

+ 2 - 2
Terminal.Gui/Drawing/StraightLine.cs

@@ -45,8 +45,8 @@ public class StraightLine
     ///     Gets the rectangle that describes the bounds of the canvas. Location is the coordinates of the line that is
     ///     furthest left/top and Size is defined by the line that extends the furthest right/bottom.
     /// </summary>
-    // PERF: Probably better to store the rectangle rather than make a new one on every single access to Bounds.
-    internal Rectangle Bounds
+    // PERF: Probably better to store the rectangle rather than make a new one on every single access to Viewport.
+    internal Rectangle Viewport
     {
         get
         {

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

@@ -112,7 +112,7 @@ public class Adornment : View
     public override Rectangle Viewport
     {
         get => Frame with { Location = Point.Empty };
-        set => throw new InvalidOperationException ("It makes no sense to set Bounds of a Thickness.");
+        set => throw new InvalidOperationException ("It makes no sense to set Viewport of a Thickness.");
     }
 
     /// <inheritdoc/>

+ 20 - 20
Terminal.Gui/View/Layout/ViewLayout.cs

@@ -284,7 +284,7 @@ public partial class View
 
     #endregion Frame
 
-    #region Bounds
+    #region Viewport
 
     /// <summary>
     ///     The bounds represent the View-relative rectangle used for this view; the area inside the view where
@@ -293,16 +293,16 @@ public partial class View
     /// <value>The rectangle describing the location and size of the area where the views' subviews and content are drawn.</value>
     /// <remarks>
     ///     <para>
-    ///         If <see cref="LayoutStyle"/> is <see cref="LayoutStyle.Computed"/> the value of Bounds is indeterminate until
+    ///         If <see cref="LayoutStyle"/> is <see cref="LayoutStyle.Computed"/> the value of Viewport is indeterminate until
     ///         the view has been initialized ( <see cref="IsInitialized"/> is true) and <see cref="LayoutSubviews"/> has been
     ///         called.
     ///     </para>
     ///     <para>
-    ///         Updates to the Bounds updates <see cref="Frame"/>, and has the same effect as updating the
+    ///         Updates to the Viewport updates <see cref="Frame"/>, and has the same effect as updating the
     ///         <see cref="Frame"/>.
     ///     </para>
     ///     <para>
-    ///         Altering the Bounds will eventually (when the view is next laid out) cause the
+    ///         Altering the Viewport will eventually (when the view is next laid out) cause the
     ///         <see cref="LayoutSubview(View, Rectangle)"/> and <see cref="OnDrawContent(Rectangle)"/> methods to be called.
     ///     </para>
     ///     <para>
@@ -319,7 +319,7 @@ public partial class View
             if (LayoutStyle == LayoutStyle.Computed && !IsInitialized)
             {
                 Debug.WriteLine (
-                                 $"WARNING: Bounds is being accessed before the View has been initialized. This is likely a bug in {this}"
+                                 $"WARNING: Viewport is being accessed before the View has been initialized. This is likely a bug in {this}"
                                 );
             }
 #endif // DEBUG
@@ -341,13 +341,13 @@ public partial class View
         }
         set
         {
-            // TODO: Should we enforce Bounds.X/Y == 0? The code currently ignores value.X/Y which is
+            // TODO: Should we enforce Viewport.X/Y == 0? The code currently ignores value.X/Y which is
             // TODO: correct behavior, but is silent. Perhaps an exception?
 #if DEBUG
             if (value.Location != Point.Empty)
             {
                 Debug.WriteLine (
-                                 $"WARNING: Bounds.Location must always be 0,0. Location ({value.Location}) is ignored. {this}"
+                                 $"WARNING: Viewport.Location must always be 0,0. Location ({value.Location}) is ignored. {this}"
                                 );
             }
 #endif // DEBUG
@@ -365,7 +365,7 @@ public partial class View
     /// <summary>Converts a <see cref="Viewport"/>-relative rectangle to a screen-relative rectangle.</summary>
     public Rectangle BoundsToScreen (in Rectangle bounds)
     {
-        // Translate bounds to Frame (our SuperView's Bounds-relative coordinates)
+        // Translate bounds to Frame (our SuperView's Viewport-relative coordinates)
         Rectangle screen = FrameToScreen ();
         Point boundsOffset = GetBoundsOffset ();
         screen.Offset (boundsOffset.X + bounds.X, boundsOffset.Y + bounds.Y);
@@ -387,12 +387,12 @@ public partial class View
     }
 
     /// <summary>
-    ///     Helper to get the X and Y offset of the Bounds from the Frame. This is the sum of the Left and Top properties
+    ///     Helper to get the X and Y offset of the Viewport from the Frame. This is the sum of the Left and Top properties
     ///     of <see cref="Margin"/>, <see cref="Border"/> and <see cref="Padding"/>.
     /// </summary>
     public Point GetBoundsOffset () { return Padding is null ? Point.Empty : Padding.Thickness.GetInside (Padding.Frame).Location; }
 
-    #endregion Bounds
+    #endregion Viewport
 
     #region AutoSize
 
@@ -573,7 +573,7 @@ public partial class View
     /// <summary>Resizes the View to fit the specified size. Factors in the HotKey.</summary>
     /// <remarks>ResizeBoundsToFit can only be called when AutoSize is true (or being set to true).</remarks>
     /// <param name="size"></param>
-    /// <returns>whether the Bounds was changed or not</returns>
+    /// <returns>whether the Viewport was changed or not</returns>
     private bool ResizeBoundsToFit (Size size)
     {
         //if (AutoSize == false) {
@@ -728,7 +728,7 @@ public partial class View
 #nullable restore
 
     /// <summary>
-    ///     Gets a new location of the <see cref="View"/> that is within the Bounds of the <paramref name="viewToMove"/>'s
+    ///     Gets a new location of the <see cref="View"/> that is within the Viewport of the <paramref name="viewToMove"/>'s
     ///     <see cref="View.SuperView"/> (e.g. for dragging a Window). The `out` parameters are the new X and Y coordinates.
     /// </summary>
     /// <remarks>
@@ -765,7 +765,7 @@ public partial class View
         }
         else
         {
-            // Use the SuperView's Bounds, not Frame
+            // Use the SuperView's Viewport, not Frame
             maxDimension = viewToMove.SuperView.Viewport.Width;
             superView = viewToMove.SuperView;
         }
@@ -972,11 +972,11 @@ public partial class View
     {
         // TODO: Identify a real-world use-case where this API should be virtual. 
         // TODO: Until then leave it `internal` and non-virtual
-        // First try SuperView.Bounds, then Application.Top, then Driver.Bounds.
+        // First try SuperView.Viewport, then Application.Top, then Driver.Viewport.
         // Finally, if none of those are valid, use int.MaxValue (for Unit tests).
         Rectangle relativeBounds = SuperView is { IsInitialized: true } ? SuperView.Viewport :
                                    Application.Top is { } && Application.Top.IsInitialized ? Application.Top.Viewport :
-                                   Application.Driver?.Bounds ?? new Rectangle (0, 0, int.MaxValue, int.MaxValue);
+                                   Application.Driver?.Viewport ?? new Rectangle (0, 0, int.MaxValue, int.MaxValue);
         SetRelativeLayout (relativeBounds);
 
         // TODO: Determine what, if any of the below is actually needed here.
@@ -1018,12 +1018,12 @@ public partial class View
 
     /// <summary>
     ///     Applies the view's position (<see cref="X"/>, <see cref="Y"/>) and dimension (<see cref="Width"/>, and
-    ///     <see cref="Height"/>) to <see cref="Frame"/>, given a rectangle describing the SuperView's Bounds (nominally the
-    ///     same as <c>this.SuperView.Bounds</c>).
+    ///     <see cref="Height"/>) to <see cref="Frame"/>, given a rectangle describing the SuperView's Viewport (nominally the
+    ///     same as <c>this.SuperView.Viewport</c>).
     /// </summary>
     /// <param name="superviewBounds">
-    ///     The rectangle describing the SuperView's Bounds (nominally the same as
-    ///     <c>this.SuperView.Bounds</c>).
+    ///     The rectangle describing the SuperView's Viewport (nominally the same as
+    ///     <c>this.SuperView.Viewport</c>).
     /// </param>
     internal void SetRelativeLayout (Rectangle superviewBounds)
     {
@@ -1047,7 +1047,7 @@ public partial class View
         // TODO: View.AutoSize stuff is removed.
 
         // Returns the new dimension (width or height) and location (x or y) for the View given
-        //   the superview's Bounds
+        //   the superview's Viewport
         //   the current Pos (View.X or View.Y)
         //   the current Dim (View.Width or View.Height)
         // This method is called recursively if pos is Pos.PosCombine

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

@@ -234,7 +234,7 @@ public partial class View : Responder, ISupportInitializeNotification
 
         // TODO: Move these into ViewText.cs as EndInit_Text() to consolodate.
         // TODO: Verify UpdateTextDirection really needs to be called here.
-        // These calls were moved from BeginInit as they access Bounds which is indeterminate until EndInit is called.
+        // These calls were moved from BeginInit as they access Viewport which is indeterminate until EndInit is called.
         UpdateTextDirection (TextDirection);
         UpdateTextFormatterText ();
         OnResizeNeeded ();

+ 4 - 4
Terminal.Gui/View/ViewDrawing.cs

@@ -86,7 +86,7 @@ public partial class View
 
     /// <summary>Clears the specified <see cref="Viewport"/>-relative rectangle with the normal background.</summary>
     /// <remarks></remarks>
-    /// <param name="contentArea">The Bounds-relative rectangle to clear.</param>
+    /// <param name="contentArea">The Viewport-relative rectangle to clear.</param>
     public void Clear (Rectangle contentArea)
     {
         if (Driver is null)
@@ -141,7 +141,7 @@ public partial class View
     ///     </para>
     ///     <para>
     ///         Overrides of <see cref="OnDrawContent(Rectangle)"/> must ensure they do not set <c>Driver.Clip</c> to a clip
-    ///         region larger than the <ref name="Bounds"/> property, as this will cause the driver to clip the entire region.
+    ///         region larger than the <ref name="Viewport"/> property, as this will cause the driver to clip the entire region.
     ///     </para>
     /// </remarks>
     public void Draw ()
@@ -443,7 +443,7 @@ public partial class View
         }
 
         // If we have a SuperView, it'll render our frames.
-        if (!SuperViewRendersLineCanvas && LineCanvas.Bounds != Rectangle.Empty)
+        if (!SuperViewRendersLineCanvas && LineCanvas.Viewport != Rectangle.Empty)
         {
             foreach (KeyValuePair<Point, Cell> p in LineCanvas.GetCellMap ())
             {
@@ -501,7 +501,7 @@ public partial class View
     ///     If the view has not been initialized (<see cref="IsInitialized"/> is <see langword="false"/>), the area to be
     ///     redrawn will be the <paramref name="region"/>.
     /// </remarks>
-    /// <param name="region">The Bounds-relative region that needs to be redrawn.</param>
+    /// <param name="region">The Viewport-relative region that needs to be redrawn.</param>
     public virtual void SetNeedsDisplay (Rectangle region)
     {
         if (!IsInitialized)

+ 3 - 3
Terminal.Gui/View/ViewText.cs

@@ -304,12 +304,12 @@ public partial class View
             throw new InvalidOperationException ("SetFrameToFitText can only be called when AutoSize is true");
         }
 
-        // BUGBUG: This API is broken - should not assume Frame.Height == Bounds.Height
+        // BUGBUG: This API is broken - should not assume Frame.Height == Viewport.Height
         // <summary>
         // Gets the minimum dimensions required to fit the View's <see cref="Text"/>, factoring in <see cref="TextDirection"/>.
         // </summary>
         // <param name="sizeRequired">The minimum dimensions required.</param>
-        // <returns><see langword="true"/> if the dimensions fit within the View's <see cref="Bounds"/>, <see langword="false"/> otherwise.</returns>
+        // <returns><see langword="true"/> if the dimensions fit within the View's <see cref="Viewport"/>, <see langword="false"/> otherwise.</returns>
         // <remarks>
         // Always returns <see langword="false"/> if <see cref="AutoSize"/> is <see langword="true"/> or
         // if <see cref="Height"/> (Horizontal) or <see cref="Width"/> (Vertical) are not not set or zero.
@@ -336,7 +336,7 @@ public partial class View
                 case true:
                     int colWidth = TextFormatter.GetWidestLineLength (new List<string> { TextFormatter.Text }, 0, 1);
 
-                    // TODO: v2 - This uses frame.Width; it should only use Bounds
+                    // TODO: v2 - This uses frame.Width; it should only use Viewport
                     if (_frame.Width < colWidth
                         && (Width is null || (Viewport.Width >= 0 && Width is Dim.DimAbsolute && Width.Anchor (0) >= 0 && Width.Anchor (0) < colWidth)))
                     {

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

@@ -778,7 +778,7 @@ public class FileDialog : Dialog
                - _btnCancel.Viewport.Width
                - 1
 
-               // TODO: Fiddle factor, seems the Bounds are wrong for someone
+               // TODO: Fiddle factor, seems the Viewport are wrong for someone
                - 2;
     }
 

+ 1 - 1
Terminal.Gui/Views/GraphView/Annotations.cs

@@ -62,7 +62,7 @@ public class TextAnnotation : IAnnotation
 
     /// <summary>
     ///     Draws the <see cref="Text"/> at the given coordinates with truncation to avoid spilling over
-    ///     <see name="View.Bounds"/> of the <paramref name="graph"/>
+    ///     <see name="View.Viewport"/> of the <paramref name="graph"/>
     /// </summary>
     /// <param name="graph"></param>
     /// <param name="x">Screen x position to start drawing string</param>

+ 6 - 6
Terminal.Gui/Views/HexView.cs

@@ -264,7 +264,7 @@ public class HexView : View
     /// <inheritdoc/>
     protected internal override bool OnMouseEvent  (MouseEvent me)
     {
-        // BUGBUG: Test this with a border! Assumes Frame == Bounds!
+        // BUGBUG: Test this with a border! Assumes Frame == Viewport!
 
         if (!me.Flags.HasFlag (MouseFlags.Button1Clicked)
             && !me.Flags.HasFlag (MouseFlags.Button1DoubleClicked)
@@ -358,7 +358,7 @@ public class HexView : View
         Driver.SetAttribute (current);
         Move (0, 0);
 
-        // BUGBUG: Bounds!!!!
+        // BUGBUG: Viewport!!!!
         Rectangle frame = Frame;
 
         int nblocks = bytesPerLine / bsize;
@@ -619,7 +619,7 @@ public class HexView : View
 
     private bool MoveDown (int bytes)
     {
-        // BUGBUG: Bounds!
+        // BUGBUG: Viewport!
         RedisplayLine (position);
 
         if (position + bytes < source.Length)
@@ -657,7 +657,7 @@ public class HexView : View
     {
         position = source.Length;
 
-        // BUGBUG: Bounds!
+        // BUGBUG: Viewport!
         if (position >= DisplayStart + bytesPerLine * Frame.Height)
         {
             SetDisplayStart (position);
@@ -744,7 +744,7 @@ public class HexView : View
             position++;
         }
 
-        // BUGBUG: Bounds!
+        // BUGBUG: Viewport!
         if (position >= DisplayStart + bytesPerLine * Frame.Height)
         {
             SetDisplayStart (DisplayStart + bytesPerLine);
@@ -793,7 +793,7 @@ public class HexView : View
         var delta = (int)(pos - DisplayStart);
         int line = delta / bytesPerLine;
 
-        // BUGBUG: Bounds!
+        // BUGBUG: Viewport!
         SetNeedsDisplay (new (0, line, Frame.Width, 1));
     }
 

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

@@ -142,7 +142,7 @@ public sealed class ContextMenu : IDisposable
 
         _container = Application.Current;
         _container.Closing += Container_Closing;
-        Rectangle frame = Application.Driver.Bounds;
+        Rectangle frame = Application.Driver.Viewport;
         Point position = Position;
 
         if (Host is { })

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

@@ -825,7 +825,7 @@ public class MenuBar : View
             return Point.Empty;
         }
 
-        Rectangle superViewFrame = SuperView is null ? Driver.Bounds : SuperView.Frame;
+        Rectangle superViewFrame = SuperView is null ? Driver.Viewport : SuperView.Frame;
         View sv = SuperView is null ? Application.Current : SuperView;
         Point boundsOffset = sv.GetBoundsOffset ();
 
@@ -842,7 +842,7 @@ public class MenuBar : View
     /// <returns>The location offset.</returns>
     internal Point GetScreenOffsetFromCurrent ()
     {
-        Rectangle screen = Driver.Bounds;
+        Rectangle screen = Driver.Viewport;
         Rectangle currentFrame = Application.Current.Frame;
         Point boundsOffset = Application.Top.GetBoundsOffset ();
 

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

@@ -291,7 +291,7 @@ public class ProgressBar : View
 
     private void SetInitialProperties ()
     {
-        Height = 1; // This will be updated when Bounds is updated in ProgressBar_LayoutStarted
+        Height = 1; // This will be updated when Viewport is updated in ProgressBar_LayoutStarted
         CanFocus = false;
         _fraction = 0;
         LayoutStarted += ProgressBar_LayoutStarted;

+ 4 - 4
Terminal.Gui/Views/Slider.cs

@@ -374,7 +374,7 @@ public class Slider<T> : View
     }
 
     /// <summary>
-    ///     If <see langword="true"/> the slider will be sized to fit the available space (the Bounds of the the
+    ///     If <see langword="true"/> the slider will be sized to fit the available space (the Viewport of the the
     ///     SuperView).
     /// </summary>
     /// <remarks>
@@ -663,10 +663,10 @@ public class Slider<T> : View
 
         if (AutoSize)
         {
-            // Max size is SuperView's Bounds. Min Size is size that will fit.
+            // Max size is SuperView's Viewport. Min Size is size that will fit.
             if (SuperView is { })
             {
-                // Calculate the size of the slider based on the size of the SuperView's Bounds.
+                // Calculate the size of the slider based on the size of the SuperView's Viewport.
                 if (_config._sliderOrientation == Orientation.Horizontal)
                 {
                     size = int.Min (SuperView.Viewport.Width, CalcBestLength ());
@@ -686,7 +686,7 @@ public class Slider<T> : View
         }
         else
         {
-            // Fit Slider to the Bounds
+            // Fit Slider to the Viewport
             if (_config._sliderOrientation == Orientation.Horizontal)
             {
                 size = Viewport.Width;

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

@@ -1746,7 +1746,7 @@ public class TextField : View
         }
     }
 
-    // BUGBUG: This assumes Frame == Bounds. It's also not clear what the intention is. For now, changed to always return 0.
+    // BUGBUG: This assumes Frame == Viewport. It's also not clear what the intention is. For now, changed to always return 0.
     private int OffSetBackground ()
     {
         var offB = 0;

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

@@ -297,7 +297,7 @@ public partial class Toplevel : View
             // This is causing the menus drawn incorrectly if UseSubMenusSingleFrame is true
             //if (this.MenuBar is { } && this.MenuBar.IsMenuOpen && this.MenuBar.openMenu is { }) {
             //	// TODO: Hack until we can get compositing working right.
-            //	this.MenuBar.openMenu.Redraw (this.MenuBar.openMenu.Bounds);
+            //	this.MenuBar.openMenu.Redraw (this.MenuBar.openMenu.Viewport);
             //}
         }
     }

+ 1 - 1
UICatalog/Scenarios/Buttons.cs

@@ -48,7 +48,7 @@ public class Buttons : Scenario
 
         View prev = colorButtonsLabel;
 
-        //With this method there is no need to call Application.TopReady += () => Application.TopRedraw (Top.Bounds);
+        //With this method there is no need to call Application.TopReady += () => Application.TopRedraw (Top.Viewport);
         Pos x = Pos.Right (colorButtonsLabel) + 2;
 
         foreach (KeyValuePair<string, ColorScheme> colorScheme in Colors.ColorSchemes)

+ 4 - 4
UICatalog/Scenarios/CharacterMap.cs

@@ -529,21 +529,21 @@ internal class CharMap : ScrollView
         //if (ShowHorizontalScrollIndicator && ContentSize.Height < (int)(MaxCodePoint / 16 + 2)) {
         //	//ContentSize = new (CharMap.RowWidth, (int)(MaxCodePoint / 16 + 2));
         //	//ContentSize = new (CharMap.RowWidth, (int)(MaxCodePoint / 16) * _rowHeight + 2);
-        //	var width = (Bounds.Width / COLUMN_WIDTH * COLUMN_WIDTH) - (ShowVerticalScrollIndicator ? RowLabelWidth + 1 : RowLabelWidth);
+        //	var width = (Viewport.Width / COLUMN_WIDTH * COLUMN_WIDTH) - (ShowVerticalScrollIndicator ? RowLabelWidth + 1 : RowLabelWidth);
         //	if (Cursor.X + ContentOffset.X >= width) {
         //		// Snap to the selected glyph.
         //		ContentOffset = new (
         //			Math.Min (Cursor.X, Cursor.X - width + COLUMN_WIDTH),
-        //			ContentOffset.Y == -ContentSize.Height + Bounds.Height ? ContentOffset.Y - 1 : ContentOffset.Y);
+        //			ContentOffset.Y == -ContentSize.Height + Viewport.Height ? ContentOffset.Y - 1 : ContentOffset.Y);
         //	} else {
         //		ContentOffset = new (
         //			ContentOffset.X - Cursor.X,
-        //			ContentOffset.Y == -ContentSize.Height + Bounds.Height ? ContentOffset.Y - 1 : ContentOffset.Y);
+        //			ContentOffset.Y == -ContentSize.Height + Viewport.Height ? ContentOffset.Y - 1 : ContentOffset.Y);
         //	}
         //} else if (!ShowHorizontalScrollIndicator && ContentSize.Height > (int)(MaxCodePoint / 16 + 1)) {
         //	//ContentSize = new (CharMap.RowWidth, (int)(MaxCodePoint / 16 + 1));
         //	// Snap 1st column into view if it's been scrolled horizontally
-        //	ContentOffset = new (0, ContentOffset.Y < -ContentSize.Height + Bounds.Height ? ContentOffset.Y - 1 : ContentOffset.Y);
+        //	ContentOffset = new (0, ContentOffset.Y < -ContentSize.Height + Viewport.Height ? ContentOffset.Y - 1 : ContentOffset.Y);
         //}
         base.OnDrawContent (contentArea);
     }

+ 3 - 3
UICatalog/Scenarios/ViewExperiments.cs

@@ -217,17 +217,17 @@ public class ViewExperiments : Scenario
                                    containerLabel.Text =
                                        $"Container.Frame: {
                                            Application.Top.Frame
-                                       } .Bounds: {
+                                       } .Viewport: {
                                            Application.Top.Viewport
                                        }\nView.Frame: {
                                            view.Frame
-                                       } .Bounds: {
+                                       } .Viewport: {
                                            view.Viewport
                                        } .BoundsOffset: {
                                            view.GetBoundsOffset ()
                                        }\n .Padding.Frame: {
                                            view.Padding.Frame
-                                       } .Padding.Bounds: {
+                                       } .Padding.Viewport: {
                                            view.Padding.Viewport
                                        }";
                                };

+ 3 - 3
UnitTests/Application/MouseTests.cs

@@ -61,7 +61,7 @@ public class MouseTests
 
     /// <summary>
     ///     Tests that the mouse coordinates passed to the focused view are correct when the mouse is clicked. No adornments;
-    ///     Frame == Bounds
+    ///     Frame == Viewport
     /// </summary>
     [Theory]
     [AutoInitShutdown]
@@ -134,7 +134,7 @@ public class MouseTests
 
     /// <summary>
     ///     Tests that the mouse coordinates passed to the focused view are correct when the mouse is clicked. With
-    ///     Frames; Frame != Bounds
+    ///     Frames; Frame != Viewport
     /// </summary>
     [AutoInitShutdown]
     [Theory]
@@ -206,7 +206,7 @@ public class MouseTests
 
         var view = new View { X = pos.X, Y = pos.Y, Width = size.Width, Height = size.Height };
 
-        // Give the view a border. With PR #2920, mouse clicks are only passed if they are inside the view's Bounds.
+        // Give the view a border. With PR #2920, mouse clicks are only passed if they are inside the view's Viewport.
         view.BorderStyle = LineStyle.Single;
         view.CanFocus = true;
 

+ 18 - 18
UnitTests/Drawing/LineCanvasTests.cs

@@ -380,7 +380,7 @@ public class LineCanvasTests
         canvas.AddLine (new Point (x, y), length, Orientation.Horizontal, LineStyle.Single);
         canvas.AddLine (new Point (x, y), length, Orientation.Vertical, LineStyle.Single);
 
-        Assert.Equal (new Rectangle (expectedX, expectedY, expectedWidth, expectedHeight), canvas.Bounds);
+        Assert.Equal (new Rectangle (expectedX, expectedY, expectedWidth, expectedHeight), canvas.Viewport);
     }
 
     [InlineData (
@@ -461,7 +461,7 @@ public class LineCanvasTests
         var canvas = new LineCanvas ();
         canvas.AddLine (new Point (x, y), length, Orientation.Horizontal, LineStyle.Single);
 
-        Assert.Equal (new Rectangle (expectedX, expectedY, expectedWidth, expectedHeight), canvas.Bounds);
+        Assert.Equal (new Rectangle (expectedX, expectedY, expectedWidth, expectedHeight), canvas.Viewport);
     }
 
     [Fact]
@@ -483,27 +483,27 @@ public class LineCanvasTests
 
         // Add a short horiz line for ╔╡
         lc.AddLine (new Point (x, y), 2, Orientation.Horizontal, LineStyle.Double);
-        Assert.Equal (new Rectangle (x, y, 2, 1), lc.Bounds);
+        Assert.Equal (new Rectangle (x, y, 2, 1), lc.Viewport);
 
         //LHS line down
         lc.AddLine (new Point (x, y), height, Orientation.Vertical, LineStyle.Double);
-        Assert.Equal (new Rectangle (x, y, 2, 2), lc.Bounds);
+        Assert.Equal (new Rectangle (x, y, 2, 2), lc.Viewport);
 
         //Vertical line before Title, results in a ╡
         lc.AddLine (new Point (x + 1, y), 0, Orientation.Vertical, LineStyle.Single);
-        Assert.Equal (new Rectangle (x, y, 2, 2), lc.Bounds);
+        Assert.Equal (new Rectangle (x, y, 2, 2), lc.Viewport);
 
         //Vertical line after Title, results in a ╞
         lc.AddLine (new Point (x + 2, y), 0, Orientation.Vertical, LineStyle.Single);
-        Assert.Equal (new Rectangle (x, y, 3, 2), lc.Bounds);
+        Assert.Equal (new Rectangle (x, y, 3, 2), lc.Viewport);
 
         // remainder of top line
         lc.AddLine (new Point (x + 2, y), width - 1, Orientation.Horizontal, LineStyle.Double);
-        Assert.Equal (new Rectangle (x, y, 4, 2), lc.Bounds);
+        Assert.Equal (new Rectangle (x, y, 4, 2), lc.Viewport);
 
         //RHS line down
         lc.AddLine (new Point (x + width, y), height, Orientation.Vertical, LineStyle.Double);
-        Assert.Equal (new Rectangle (x, y, 4, 2), lc.Bounds);
+        Assert.Equal (new Rectangle (x, y, 4, 2), lc.Viewport);
 
         TestHelpers.AssertEqual (
                                  output,
@@ -533,27 +533,27 @@ public class LineCanvasTests
 
         // Add a short horiz line for ╔╡
         lc.AddLine (new Point (x, y), 2, Orientation.Horizontal, LineStyle.Double);
-        Assert.Equal (new Rectangle (x, y, 2, 1), lc.Bounds);
+        Assert.Equal (new Rectangle (x, y, 2, 1), lc.Viewport);
 
         //LHS line down
         lc.AddLine (new Point (x, y), height, Orientation.Vertical, LineStyle.Double);
-        Assert.Equal (new Rectangle (x, y, 2, 2), lc.Bounds);
+        Assert.Equal (new Rectangle (x, y, 2, 2), lc.Viewport);
 
         //Vertical line before Title, results in a ╡
         lc.AddLine (new Point (x + 1, y), 0, Orientation.Vertical, LineStyle.Single);
-        Assert.Equal (new Rectangle (x, y, 2, 2), lc.Bounds);
+        Assert.Equal (new Rectangle (x, y, 2, 2), lc.Viewport);
 
         //Vertical line after Title, results in a ╞
         lc.AddLine (new Point (x + 2, y), 0, Orientation.Vertical, LineStyle.Single);
-        Assert.Equal (new Rectangle (x, y, 3, 2), lc.Bounds);
+        Assert.Equal (new Rectangle (x, y, 3, 2), lc.Viewport);
 
         // remainder of top line
         lc.AddLine (new Point (x + 2, y), width - 1, Orientation.Horizontal, LineStyle.Double);
-        Assert.Equal (new Rectangle (x, y, 4, 2), lc.Bounds);
+        Assert.Equal (new Rectangle (x, y, 4, 2), lc.Viewport);
 
         //RHS line down
         lc.AddLine (new Point (x + width, y), height, Orientation.Vertical, LineStyle.Double);
-        Assert.Equal (new Rectangle (x, y, 4, 2), lc.Bounds);
+        Assert.Equal (new Rectangle (x, y, 4, 2), lc.Viewport);
 
         TestHelpers.AssertEqual (
                                  output,
@@ -570,13 +570,13 @@ public class LineCanvasTests
     {
         var lc = new LineCanvas ();
 
-        Assert.Equal (Rectangle.Empty, lc.Bounds);
+        Assert.Equal (Rectangle.Empty, lc.Viewport);
 
         lc.AddLine (Point.Empty, 2, Orientation.Horizontal, LineStyle.Double);
-        Assert.NotEqual (Rectangle.Empty, lc.Bounds);
+        Assert.NotEqual (Rectangle.Empty, lc.Viewport);
 
         lc.Clear ();
-        Assert.Equal (Rectangle.Empty, lc.Bounds);
+        Assert.Equal (Rectangle.Empty, lc.Viewport);
     }
 
     [InlineData (0, 0, Orientation.Horizontal, "─")]
@@ -873,7 +873,7 @@ public class LineCanvasTests
         //// Left Up
         //canvas.AddLine (new Point (0, 3), -3, Orientation.Vertical, LineStyle.Single);
 
-        Assert.Equal (new Rectangle (0, 0, 2, 2), canvas.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 2, 2), canvas.Viewport);
 
         Dictionary<Point, Rune> map = canvas.GetMap ();
         Assert.Equal (2, map.Count);

+ 2 - 2
UnitTests/Drawing/StraightLineTests.cs

@@ -309,7 +309,7 @@ public class StraightLineTests
                 )]
     [Theory]
     [SetupFakeDriver]
-    public void Bounds (
+    public void Viewport (
         Orientation orientation,
         int x,
         int y,
@@ -322,6 +322,6 @@ public class StraightLineTests
     {
         var sl = new StraightLine (new Point (x, y), length, orientation, LineStyle.Single);
 
-        Assert.Equal (new Rectangle (expectedX, expectedY, expectedWidth, expectedHeight), sl.Bounds);
+        Assert.Equal (new Rectangle (expectedX, expectedY, expectedWidth, expectedHeight), sl.Viewport);
     }
 }

+ 1 - 1
UnitTests/View/Adornment/ToScreenTests.cs

@@ -286,7 +286,7 @@ public class AdornmentToScreenTests (ITestOutputHelper output)
         view.Margin.Thickness = new (1);
         view.Border.Thickness = new (1);
         view.Padding.Thickness = new (1);
-        // Total thickness is 3 (view.Bounds will be Frame.Width - 6)
+        // Total thickness is 3 (view.Viewport will be Frame.Width - 6)
         view.Frame = frame;
 
         Assert.Equal(4, view.Viewport.Width);

+ 5 - 5
UnitTests/View/DrawTests.cs

@@ -232,7 +232,7 @@ public class DrawTests
         var view = new View { Width = 2, Height = 2, BorderStyle = LineStyle.Single };
         view.BeginInit ();
         view.EndInit ();
-        view.SetRelativeLayout (Application.Driver.Bounds);
+        view.SetRelativeLayout (Application.Driver.Viewport);
 
         Assert.Equal (new (0,0,2,2), view.Frame);
         Assert.Equal (Rectangle.Empty, view.Viewport);
@@ -257,7 +257,7 @@ public class DrawTests
         view.Border.Thickness = new Thickness (1, 1, 1, 0);
         view.BeginInit ();
         view.EndInit ();
-        view.SetRelativeLayout (Application.Driver.Bounds);
+        view.SetRelativeLayout (Application.Driver.Viewport);
 
         Assert.Equal (new (0,0,2,1), view.Frame);
         Assert.Equal (Rectangle.Empty, view.Viewport);
@@ -275,7 +275,7 @@ public class DrawTests
         view.Border.Thickness = new Thickness (0, 1, 1, 1);
         view.BeginInit ();
         view.EndInit ();
-        view.SetRelativeLayout (Application.Driver.Bounds);
+        view.SetRelativeLayout (Application.Driver.Viewport);
 
         Assert.Equal (new (0,0,1,2), view.Frame);
         Assert.Equal (Rectangle.Empty, view.Viewport);
@@ -300,7 +300,7 @@ public class DrawTests
         view.Border.Thickness = new Thickness (1, 1, 0, 1);
         view.BeginInit ();
         view.EndInit ();
-        view.SetRelativeLayout (Application.Driver.Bounds);
+        view.SetRelativeLayout (Application.Driver.Viewport);
 
         Assert.Equal (new (0,0,1,2), view.Frame);
         Assert.Equal (Rectangle.Empty, view.Viewport);
@@ -326,7 +326,7 @@ public class DrawTests
 
         view.BeginInit ();
         view.EndInit ();
-        view.SetRelativeLayout (Application.Driver.Bounds);
+        view.SetRelativeLayout (Application.Driver.Viewport);
 
         Assert.Equal (new (0,0,2,1), view.Frame);
         Assert.Equal (Rectangle.Empty, view.Viewport);

+ 14 - 14
UnitTests/View/Layout/AbsoluteLayoutTests.cs

@@ -32,7 +32,7 @@ public class AbsoluteLayoutTests
         Assert.Equal (
                       new Rectangle (0, 0, newFrame.Width, newFrame.Height),
                       v.Viewport
-                     ); // With Absolute Bounds *is* deterministic before Layout
+                     ); // With Absolute Viewport *is* deterministic before Layout
         Assert.Equal (Pos.At (1), v.X);
         Assert.Equal (Pos.At (2), v.Y);
         Assert.Equal (Dim.Sized (30), v.Width);
@@ -47,7 +47,7 @@ public class AbsoluteLayoutTests
         Assert.Equal (
                       new Rectangle (0, 0, newFrame.Width, newFrame.Height),
                       v.Viewport
-                     ); // With Absolute Bounds *is* deterministic before Layout
+                     ); // With Absolute Viewport *is* deterministic before Layout
         Assert.Equal (Pos.At (1), v.X);
         Assert.Equal (Pos.At (2), v.Y);
         Assert.Equal (Dim.Sized (30), v.Width);
@@ -63,7 +63,7 @@ public class AbsoluteLayoutTests
         Assert.Equal (
                       new Rectangle (0, 0, newFrame.Width, newFrame.Height),
                       v.Viewport
-                     ); // With Absolute Bounds *is* deterministic before Layout
+                     ); // With Absolute Viewport *is* deterministic before Layout
         Assert.Equal (Pos.At (10), v.X);
         Assert.Equal (Pos.At (20), v.Y);
         Assert.Equal (Dim.Sized (30), v.Width);
@@ -78,7 +78,7 @@ public class AbsoluteLayoutTests
         Assert.Equal (
                       new Rectangle (0, 0, newFrame.Width, newFrame.Height),
                       v.Viewport
-                     ); // With Absolute Bounds *is* deterministic before Layout
+                     ); // With Absolute Viewport *is* deterministic before Layout
         Assert.Equal (Pos.At (10), v.X);
         Assert.Equal (Pos.At (20), v.Y);
         Assert.Equal (Dim.Sized (30), v.Width);
@@ -102,7 +102,7 @@ public class AbsoluteLayoutTests
         Assert.Equal (
                       new Rectangle (0, 0, newFrame.Width, newFrame.Height),
                       v.Viewport
-                     ); // With Absolute Bounds *is* deterministic before Layout
+                     ); // With Absolute Viewport *is* deterministic before Layout
         Assert.Equal (Pos.At (1), v.X);
         Assert.Equal (Pos.At (2), v.Y);
         Assert.Equal ($"Absolute({newFrame.Height})", v.Height.ToString ());
@@ -137,7 +137,7 @@ public class AbsoluteLayoutTests
         Assert.Equal (
                       new Rectangle (0, 0, newFrame.Width, newFrame.Height),
                       v.Viewport
-                     ); // With Absolute Bounds *is* deterministic before Layout
+                     ); // With Absolute Viewport *is* deterministic before Layout
         Assert.Equal ($"Absolute({newFrame.X})", v.X.ToString ());
         Assert.Equal ($"Absolute({newFrame.Y})", v.Y.ToString ());
         Assert.Equal (Dim.Sized (3), v.Width);
@@ -251,7 +251,7 @@ public class AbsoluteLayoutTests
         Assert.Equal (
                       new Rectangle (0, 0, frame.Width, frame.Height),
                       v.Viewport
-                     ); // With Absolute Bounds *is* deterministic before Layout
+                     ); // With Absolute Viewport *is* deterministic before Layout
         Assert.Equal (Pos.At (0), v.X);
         Assert.Equal (Pos.At (0), v.Y);
         Assert.Equal (Dim.Sized (0), v.Width);
@@ -266,7 +266,7 @@ public class AbsoluteLayoutTests
         Assert.Equal (
                       new Rectangle (0, 0, frame.Width, frame.Height),
                       v.Viewport
-                     ); // With Absolute Bounds *is* deterministic before Layout
+                     ); // With Absolute Viewport *is* deterministic before Layout
         Assert.Equal (Pos.At (1), v.X);
         Assert.Equal (Pos.At (2), v.Y);
         Assert.Equal (Dim.Sized (3), v.Width);
@@ -280,7 +280,7 @@ public class AbsoluteLayoutTests
         Assert.Equal (
                       new Rectangle (0, 0, frame.Width, frame.Height),
                       v.Viewport
-                     ); // With Absolute Bounds *is* deterministic before Layout
+                     ); // With Absolute Viewport *is* deterministic before Layout
         Assert.Equal (Pos.At (1), v.X);
         Assert.Equal (Pos.At (2), v.Y);
         Assert.Equal (Dim.Sized (3), v.Width);
@@ -294,7 +294,7 @@ public class AbsoluteLayoutTests
         // That is correct it should be 0,0 because AutoSize is false
         // and the size wasn't set on the initializer
         Assert.Equal (new Rectangle (frame.X, frame.Y, 0, 0), v.Frame);
-        Assert.Equal (new Rectangle (0, 0, 0, 0), v.Viewport); // With Absolute Bounds *is* deterministic before Layout
+        Assert.Equal (new Rectangle (0, 0, 0, 0), v.Viewport); // With Absolute Viewport *is* deterministic before Layout
         Assert.Equal (Pos.At (1), v.X);
         Assert.Equal (Pos.At (2), v.Y);
         Assert.Equal (Dim.Sized (0), v.Width);
@@ -304,7 +304,7 @@ public class AbsoluteLayoutTests
         v = new View ();
         Assert.True (v.LayoutStyle == LayoutStyle.Absolute);
         Assert.Equal (new Rectangle (0, 0, 0, 0), v.Frame);
-        Assert.Equal (new Rectangle (0, 0, 0, 0), v.Viewport); // With Absolute Bounds *is* deterministic before Layout
+        Assert.Equal (new Rectangle (0, 0, 0, 0), v.Viewport); // With Absolute Viewport *is* deterministic before Layout
         Assert.Equal (Pos.At (0), v.X);
         Assert.Equal (Pos.At (0), v.Y);
         Assert.Equal (Dim.Sized (0), v.Width);
@@ -314,7 +314,7 @@ public class AbsoluteLayoutTests
         v = new View { X = frame.X, Y = frame.Y, Width = frame.Width, Height = frame.Height };
         Assert.True (v.LayoutStyle == LayoutStyle.Absolute);
         Assert.Equal (new Rectangle (frame.X, frame.Y, 3, 4), v.Frame);
-        Assert.Equal (new Rectangle (0, 0, 3, 4), v.Viewport); // With Absolute Bounds *is* deterministic before Layout
+        Assert.Equal (new Rectangle (0, 0, 3, 4), v.Viewport); // With Absolute Viewport *is* deterministic before Layout
         Assert.Equal (Pos.At (1), v.X);
         Assert.Equal (Pos.At (2), v.Y);
         Assert.Equal (Dim.Sized (3), v.Width);
@@ -348,7 +348,7 @@ public class AbsoluteLayoutTests
     [Fact]
     public void AbsoluteLayout_Setting_Bounds_Location_NotEmpty ()
     {
-        // TODO: Should we enforce Bounds.X/Y == 0? The code currently ignores value.X/Y which is
+        // TODO: Should we enforce Viewport.X/Y == 0? The code currently ignores value.X/Y which is
         // TODO: correct behavior, but is silent. Perhaps an exception?
         var frame = new Rectangle (1, 2, 3, 4);
         var newBounds = new Rectangle (10, 20, 30, 40);
@@ -389,7 +389,7 @@ public class AbsoluteLayoutTests
 
         v.BorderStyle = LineStyle.Single;
 
-        // Bounds should shrink
+        // Viewport should shrink
         Assert.Equal (new Rectangle (0, 0, 1, 2), v.Viewport);
 
         // Frame should not change

+ 1 - 1
UnitTests/View/Layout/BoundsTests.cs

@@ -4,7 +4,7 @@ namespace Terminal.Gui.ViewTests;
 
 /// <summary>
 /// Test the <see cref="View.Viewport"/>.
-/// DOES NOT TEST Adornment.Bounds methods. Those are in ./Adornment/BoundsTests.cs
+/// DOES NOT TEST Adornment.Viewport methods. Those are in ./Adornment/BoundsTests.cs
 /// </summary>
 /// <param name="output"></param>
 public class BoundsTests (ITestOutputHelper output)

+ 1 - 1
UnitTests/View/Layout/DimTests.cs

@@ -669,7 +669,7 @@ public class DimTests
                    #if DEBUG
                        Assert.Equal ($"Combine(View(Width,Button(v1){v1.Frame})-View(Width,Button(v3){v3.Viewport}))", v5.Width.ToString ());
                     #else
-                       Assert.Equal ($"Combine(View(Height,Button(){v1.Frame})-View(Height,Button(){v3.Bounds}))", v5.Height.ToString ( ));
+                       Assert.Equal ($"Combine(View(Height,Button(){v1.Frame})-View(Height,Button(){v3.Viewport}))", v5.Height.ToString ( ));
                    #endif
                        Assert.Equal (38, v5.Frame.Width);  // 47-9=38
                        Assert.Equal (80, v5.Frame.Height); // 89-9=80

+ 2 - 2
UnitTests/View/Layout/PosTests.cs

@@ -141,12 +141,12 @@ public class PosTests
         frame.Draw ();
 
         Assert.Equal (6, btn.Viewport.Width);
-        Assert.Equal (10, btn.Frame.X); // frame.Bounds.Width (16) - btn.Frame.Width (6) = 10
+        Assert.Equal (10, btn.Frame.X); // frame.Viewport.Width (16) - btn.Frame.Width (6) = 10
         Assert.Equal (0, btn.Frame.Y);
         Assert.Equal (6, btn.Frame.Width);
         Assert.Equal (1, btn.Frame.Height);
 
-        Assert.Equal (9, view.Viewport.Width); // frame.Bounds.Width (16) - Dim.Fill (1) - Dim.Function (6) = 9
+        Assert.Equal (9, view.Viewport.Width); // frame.Viewport.Width (16) - Dim.Fill (1) - Dim.Function (6) = 9
         Assert.Equal (0, view.Frame.X);
         Assert.Equal (0, view.Frame.Y);
         Assert.Equal (9, view.Frame.Width);

+ 18 - 18
UnitTests/View/SubviewTests.cs

@@ -82,12 +82,12 @@ public class SubviewTests
     {
         Application.Init (new FakeDriver ());
 
-        var top = new Toplevel { Id = "0" }; // Frame: 0, 0, 80, 25; Bounds: 0, 0, 80, 25
+        var top = new Toplevel { Id = "0" }; // Frame: 0, 0, 80, 25; Viewport: 0, 0, 80, 25
 
         var winAddedToTop = new Window
         {
             Id = "t", Width = Dim.Fill (), Height = Dim.Fill ()
-        }; // Frame: 0, 0, 80, 25; Bounds: 0, 0, 78, 23
+        }; // Frame: 0, 0, 80, 25; Viewport: 0, 0, 78, 23
 
         var v1AddedToWin = new View
         {
@@ -159,37 +159,37 @@ public class SubviewTests
                                     {
                                         v1c++;
 
-                                        // Top.Frame: 0, 0, 80, 25; Top.Bounds: 0, 0, 80, 25
+                                        // Top.Frame: 0, 0, 80, 25; Top.Viewport: 0, 0, 80, 25
                                         // BUGBUG: This is wrong, it should be 78, 23. This test has always been broken.
-                                        // in no way should the v1AddedToWin.Frame be the same as the Top.Frame/Bounds
+                                        // in no way should the v1AddedToWin.Frame be the same as the Top.Frame/Viewport
                                         // as it is a subview of winAddedToTop, which has a border!
-                                        //Assert.Equal (top.Bounds.Width,  v1AddedToWin.Frame.Width);
-                                        //Assert.Equal (top.Bounds.Height, v1AddedToWin.Frame.Height);
+                                        //Assert.Equal (top.Viewport.Width,  v1AddedToWin.Frame.Width);
+                                        //Assert.Equal (top.Viewport.Height, v1AddedToWin.Frame.Height);
                                     };
 
         v2AddedToWin.Initialized += (s, e) =>
                                     {
                                         v2c++;
 
-                                        // Top.Frame: 0, 0, 80, 25; Top.Bounds: 0, 0, 80, 25
+                                        // Top.Frame: 0, 0, 80, 25; Top.Viewport: 0, 0, 80, 25
                                         // BUGBUG: This is wrong, it should be 78, 23. This test has always been broken.
-                                        // in no way should the v2AddedToWin.Frame be the same as the Top.Frame/Bounds
+                                        // in no way should the v2AddedToWin.Frame be the same as the Top.Frame/Viewport
                                         // as it is a subview of winAddedToTop, which has a border!
-                                        //Assert.Equal (top.Bounds.Width,  v2AddedToWin.Frame.Width);
-                                        //Assert.Equal (top.Bounds.Height, v2AddedToWin.Frame.Height);
+                                        //Assert.Equal (top.Viewport.Width,  v2AddedToWin.Frame.Width);
+                                        //Assert.Equal (top.Viewport.Height, v2AddedToWin.Frame.Height);
                                     };
 
         svAddedTov1.Initialized += (s, e) =>
                                    {
                                        sv1c++;
 
-                                       // Top.Frame: 0, 0, 80, 25; Top.Bounds: 0, 0, 80, 25
+                                       // Top.Frame: 0, 0, 80, 25; Top.Viewport: 0, 0, 80, 25
                                        // BUGBUG: This is wrong, it should be 78, 23. This test has always been broken.
-                                       // in no way should the svAddedTov1.Frame be the same as the Top.Frame/Bounds
+                                       // in no way should the svAddedTov1.Frame be the same as the Top.Frame/Viewport
                                        // because sv1AddedTov1 is a subview of v1AddedToWin, which is a subview of
                                        // winAddedToTop, which has a border!
-                                       //Assert.Equal (top.Bounds.Width,  svAddedTov1.Frame.Width);
-                                       //Assert.Equal (top.Bounds.Height, svAddedTov1.Frame.Height);
+                                       //Assert.Equal (top.Viewport.Width,  svAddedTov1.Frame.Width);
+                                       //Assert.Equal (top.Viewport.Height, svAddedTov1.Frame.Height);
                                        Assert.False (svAddedTov1.CanFocus);
                                        Assert.Throws<InvalidOperationException> (() => svAddedTov1.CanFocus = true);
                                        Assert.False (svAddedTov1.CanFocus);
@@ -266,16 +266,16 @@ public class SubviewTests
                           {
                               v1c++;
 
-                              //Assert.Equal (t.Bounds.Width, v1.Frame.Width);
-                              //Assert.Equal (t.Bounds.Height, v1.Frame.Height);
+                              //Assert.Equal (t.Viewport.Width, v1.Frame.Width);
+                              //Assert.Equal (t.Viewport.Height, v1.Frame.Height);
                           };
 
         v2.Initialized += (s, e) =>
                           {
                               v2c++;
 
-                              //Assert.Equal (t.Bounds.Width,  v2.Frame.Width);
-                              //Assert.Equal (t.Bounds.Height, v2.Frame.Height);
+                              //Assert.Equal (t.Viewport.Width,  v2.Frame.Width);
+                              //Assert.Equal (t.Viewport.Height, v2.Frame.Height);
                           };
         w.Add (v1, v2);
         t.Add (w);

+ 1 - 1
UnitTests/View/ViewTests.cs

@@ -1123,7 +1123,7 @@ At 0,0
         {
             var idx = 0;
 
-            // BUGBUG: v2 - this should use Bounds, not Frame
+            // BUGBUG: v2 - this should use Viewport, not Frame
             for (var r = 0; r < Frame.Height; r++)
             {
                 for (var c = 0; c < Frame.Width; c++)

+ 1 - 1
UnitTests/Views/ScrollBarViewTests.cs

@@ -421,7 +421,7 @@ This is a tes
                      {
                          newScrollBarView.Position = 100;
 
-                         //Assert.Equal (newScrollBarView.Position, newScrollBarView.Size - listView.LeftItem + (listView.LeftItem - listView.Bounds.Width));
+                         //Assert.Equal (newScrollBarView.Position, newScrollBarView.Size - listView.LeftItem + (listView.LeftItem - listView.Viewport.Width));
                          Assert.Equal (newScrollBarView.Position, listView.LeftItem);
 
                          //Assert.Equal (92, newScrollBarView.Position);

+ 1 - 1
UnitTests/Views/TextViewTests.cs

@@ -7657,7 +7657,7 @@ This is the second line.
                                                      );
 
         ((FakeDriver)Application.Driver).SetBufferSize (6, 25);
-        tv.SetRelativeLayout (Application.Driver.Bounds);
+        tv.SetRelativeLayout (Application.Driver.Viewport);
         tv.Draw ();
         Assert.Equal (new Point (4, 2), tv.CursorPosition);
         Assert.Equal (new Point (12, 0), cp);