Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #2432. Implements Dim.Auto for Content including subviews. #3451

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion Terminal.Gui/View/Layout/PosDim.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,6 @@ internal override int Calculate (int location, int superviewContentSize, View us
return _remaining ? Math.Max (Anchor (superviewContentSize - location), 0) : Anchor (superviewContentSize);
}
}

internal class DimFill (int margin) : Dim
{
private readonly int _margin = margin;
Expand Down
3 changes: 3 additions & 0 deletions Terminal.Gui/View/ViewAdornments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ public LineStyle BorderStyle
/// <summary>
/// <para>Gets the thickness describing the sum of the Adornments' thicknesses.</para>
/// </summary>
/// <para>
/// The <see cref="Viewport"/> is offset from the <see cref="Frame"/> by the thickness returned by this method.
/// </para>
/// <returns>A thickness that describes the sum of the Adornments' thicknesses.</returns>
public Thickness GetAdornmentsThickness ()
{
Expand Down
2 changes: 1 addition & 1 deletion docfx/docs/newinv2.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The entire library has been reviewed and simplified. As a result, the API is mor
* *Built-in Scrolling/Virtual Content Area* - In v1, to have a view a user could scroll required either a bespoke scrolling implementation, inheriting from `ScrollView`, or managing the complexity of `ScrollBarView` directly. In v2, the base-View class supports scrolling inherently. The area of a view visible to the user at a given moment was previously a rectangle called `Bounds`. `Bounds.Location` was always `Point.Empty`. In v2 the visible area is a rectangle called `Viewport` which is a protal into the Views content, which can be bigger (or smaller) than the area visible to the user. Causing a view to scroll is as simple as changing `View.Viewport.Location`. The View's content described by `View.ContentSize`. See [Layout](layout.md) for details.
* *Computed Layout Improvements* -
* *`Pos.AnchorEnd ()`* - New to v2 is `Pos.AnchorEnd ()` (with no parameters) which allows a view to be anchored to the right or bottom of the Superview.
* *`Dim.Auto`* -
* *`Dim.Auto`* - Views can now be sized to their content (either Text or Subveiws) using `Dim.Auto` for width or height. This replaces `View.AutoSize` in v1.
* ...

## New and Improved Built-in Views
Expand Down