Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions .tg-docs/INDEX.md

Large diffs are not rendered by default.

59 changes: 44 additions & 15 deletions AGENTS.md

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
<ItemGroup>
<!-- Enable Nuget Source Link for github -->
<PackageVersion Include="AnsiConsoleToHtml" Version="0.2.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="5.3.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.14.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic.Workspaces" Version="4.14.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.14.0" />
<PackageVersion Include="Microsoft.Net.Compilers.Toolset" Version="5.0.0" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="10.0.103" />
<PackageVersion Include="Microsoft.Net.Compilers.Toolset" Version="5.3.0" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="10.0.201" />
<PackageVersion Include="ColorHelper" Version="1.8.1" />
<PackageVersion Include="JetBrains.Annotations" Version="2025.2.4" />
<PackageVersion Include="Microsoft.CodeAnalysis" Version="4.14.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Common" Version="4.14.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.3" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="10.0.3" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="5.3.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.5" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="10.0.5" />
<PackageVersion Include="System.IO.Abstractions" Version="22.1.0" />
<PackageVersion Include="Wcwidth" Version="4.0.1" />
<PackageVersion Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.23.0" />
Expand All @@ -28,21 +28,21 @@
<PackageVersion Include="SixLabors.ImageSharp" Version="3.1.12" />
<PackageVersion Include="CsvHelper" Version="33.1.0" />
<PackageVersion Include="Microsoft.DotNet.PlatformAbstractions" Version="3.1.6" />
<PackageVersion Include="System.CommandLine" Version="2.0.3" />
<PackageVersion Include="System.CommandLine" Version="2.0.5" />
<PackageVersion Include="BenchmarkDotNet" Version="0.15.8" />
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.4.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.3" />
<PackageVersion Include="ReactiveUI" Version="23.1.8" />
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.4.2" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.5" />
<PackageVersion Include="ReactiveUI" Version="23.2.1" />
<PackageVersion Include="ReactiveMarbles.ObservableEvents.SourceGenerator" Version="1.3.1" />
<PackageVersion Include="ReactiveUI.SourceGenerators" Version="2.6.1" />
<PackageVersion Include="Moq" Version="4.20.72" />
<PackageVersion Include="ReportGenerator" Version="5.5.3" />
<PackageVersion Include="ReportGenerator" Version="5.5.4" />
<PackageVersion Include="TestableIO.System.IO.Abstractions.TestingHelpers" Version="22.1.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.4.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
<PackageVersion Include="xunit.v3" Version="3.2.2" />
<PackageVersion Include="Xunit.Combinatorial" Version="2.0.24" />
<PackageVersion Include="coverlet.collector" Version="8.0.0" />
<PackageVersion Include="coverlet.collector" Version="8.0.1" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<PackageVersion Include="Terminal.Gui" Version="2.0.0" />
Expand Down
4 changes: 2 additions & 2 deletions Terminal.Gui/ViewBase/View.Content.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public int GetWidthRequiredForSubViews () =>
GetAutoWidth () - GetAdornmentsThickness ().Horizontal;

/// <summary>
/// Gets the natural (auto-size) width of the view as calculated by <see cref="Dim.Auto ()"/>.
/// Gets the natural (auto-size) width of the view as calculated by <see cref="Dim.Auto"/>.
/// </summary>
/// <remarks>
/// The returned width is the full auto-calculated width for the view, including adornment thickness.
Expand All @@ -114,7 +114,7 @@ public int GetWidthRequiredForSubViews () =>
public int GetAutoWidth () => Dim.Auto ().Calculate (0, GetContainerSize ().Width, this, Dimension.Width);

/// <summary>
/// Gets the natural (auto-size) height of the view as calculated by <see cref="Dim.Auto ()"/>.
/// Gets the natural (auto-size) height of the view as calculated by <see cref="Dim.Auto"/>.
/// </summary>
/// <remarks>
/// The returned height is the full auto-calculated height for the view, including adornment thickness.
Expand Down
1 change: 1 addition & 0 deletions Terminal.sln
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docs", "Docs", "{C7A51224-5
docfx\docs\ansihandling.md = docfx\docs\ansihandling.md
docfx\docs\application.md = docfx\docs\application.md
docfx\docs\arrangement.md = docfx\docs\arrangement.md
docfx\docs\borders.md = docfx\docs\borders.md
docfx\docs\cancellable-work-pattern.md = docfx\docs\cancellable-work-pattern.md
.github\CODEOWNERS = .github\CODEOWNERS
CODE_OF_CONDUCT.md = CODE_OF_CONDUCT.md
Expand Down
19 changes: 9 additions & 10 deletions docfx/docs/View.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,12 @@ See the [Scrolling Deep Dive](scrolling.md) for complete details.

### Adornments

[Adornments](~/api/Terminal.Gui.ViewBase.IAdornment.yml) are lightweight objects that define the spacing around a View's content. When View-level features are needed (e.g., SubViews, shadows), a full [AdornmentView](~/api/Terminal.Gui.ViewBase.AdornmentView.yml) is lazily created via `GetOrCreateView()`:
[Adornments](<xref:Terminal.Gui.ViewBase.IAdornment>) are lightweight objects that define the spacing around a View's content. When View-level features are needed (e.g., SubViews, shadows), a full [AdornmentView](<xref:Terminal.Gui.ViewBase.AdornmentView>) is lazily created via `GetOrCreateView()`:

- **[Margin](~/api/Terminal.Gui.ViewBase.Margin.yml)** - Transparent spacing outside the Border
- **[Border](~/api/Terminal.Gui.ViewBase.Border.yml)** - Visual frame with [LineStyle](~/api/Terminal.Gui.Drawing.LineStyle.yml), title, and arrangement UI
- **[Padding](~/api/Terminal.Gui.ViewBase.Padding.yml)** - Spacing inside the Border, outside the Viewport

Each adornment has a [Thickness](~/api/Terminal.Gui.Drawing.Thickness.yml) that defines the width of each side (Top, Right, Bottom, Left).
- **[Margin](<xref:Terminal.Gui.ViewBase.Margin>)** - Transparent spacing outside the Border
- **[Border](<xref:Terminal.Gui.ViewBase.Border>)** - Visual frame with [LineStyle](<xref:Terminal.Gui.Drawing.LineStyle>), title, and arrangement UI
- **[Padding](<xref:Terminal.Gui.ViewBase.Padding>)** - Spacing inside the Border, outside the Viewport
Each adornment has a [Thickness](<xref:Terminal.Gui.Drawing.Thickness>) that defines the width of each side (Top, Right, Bottom, Left).

See the [Layout Deep Dive](layout.md) for complete details on adornments.

Expand Down Expand Up @@ -125,11 +124,11 @@ View is organized as a partial class across multiple files, each handling a spec

See the [Command Deep Dive](command.md).

- [View.AddCommand](~/api/Terminal.Gui.ViewBase.View.yml) - Declares commands the View supports
- [View.InvokeCommand](~/api/Terminal.Gui.ViewBase.View.yml) - Invokes a command
- [Command](~/api/Terminal.Gui.Input.Command.yml) enum - Standard set of commands (Accept, Activate, HotKey, etc.)
- [View.AddCommand] - Declares commands the View supports
- [View.InvokeCommand] - Invokes a command
- [Command] enum - Standard set of commands (Accept, Activate, HotKey, etc.)
- `CommandsToBubbleUp` - Opt-in list of commands that bubble from SubViews to this View
- [View.DispatchDown](~/api/Terminal.Gui.ViewBase.View.yml) - Dispatches a command downward to a SubView with bubbling suppressed (inverse of `TryBubbleToSuperView`)
- [View.DispatchDown] - Dispatches a command downward to a SubView with bubbling suppressed (inverse of `TryBubbleToSuperView`)
- `DefaultAcceptView` - The SubView that receives <xref:Terminal.Gui.Input.Command.Accept> when no other SubView handles it

### Input Handling
Expand Down
15 changes: 7 additions & 8 deletions docfx/docs/borders.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ This deep dive covers Border's rendering modes, the tab header system, and how `
- [Tab Offset and Clipping](#tab-offset-and-clipping)
- [Auto-Join with SuperViewRendersLineCanvas](#auto-join-with-superviewrenderslinecanvas)
- [Border Line Positioning](#border-line-positioning)
- [Implementation: TitleView](#implementation-tabtitleview)
- [Arrangement (Move and Resize)](#arrangement-move-and-resize)

---
Expand All @@ -23,20 +22,20 @@ This deep dive covers Border's rendering modes, the tab header system, and how `

Every [View](~/api/Terminal.Gui.ViewBase.View.yml) has a `Border` adornment accessible via `View.Border`. The border's appearance is controlled by:

- **`View.BorderStyle`** ([BorderStyle](~/api/Terminal.Gui.ViewBase.BorderStyle.yml)) — Helper property that sets `Border.LineStyle`, `Border.Settings`, and `Border.Thickness` to common presets for different line styles.
- **`View.BorderStyle`** ([BorderStyle](~/api/Terminal.Gui.ViewBase.View.BorderStyle.yml)) — Helper property that sets `Border.LineStyle`, `Border.Settings`, and `Border.Thickness` to common presets for different line styles.
- **`View.Border.Settings`** ([BorderSettings](~/api/Terminal.Gui.ViewBase.BorderSettings.yml)) — Flags controlling title and tab rendering.
- **`View.Border.LineStyle`** ([LineStyle](~/api/Terminal.Gui.ViewBase.LineStyle.yml)) — Which line-drawing characters to use for the border.
- **`View.Border.Thickness`** ([Thickness](~/api/Terminal.Gui.Drawing.Thickness.yml)) — How many rows/columns each side occupies.
- **`View.Border.LineStyle`** ([LineStyle](~/api/Terminal.Gui.ViewBase.Border.LineStyle.yml)) — Which line-drawing characters to use for the border.
- **`View.Border.Thickness`** ([Thickness](~/api/Terminal.Gui.ViewBase.IAdornment.Thickness.yml)) — How many rows/columns each side occupies.

When `BorderStyle` is set to a non-`None` value, it implicitly sets `Border.Settings` to include `BorderSettings.Title`, enabling title rendering based on the thickness of the top border.

The border is rendered by [BorderView](~/api/Terminal.Gui.ViewBase.BorderView.yml), the internal `AdornmentView` created when `Border.GetOrCreateView()` is called (or implicitly when `BorderStyle` is set).

---

## `BorderSettings.Default | BorderSettings.Title` — Title Rendering by Thickness
## Title Rendering by Thickness

The `Thickness` on the title side determines how many rows (or columns) the border occupies and how the title is rendered within that space.
When `BorderSettings.Default | BorderSettings.Title` is set, the `Thickness` on the title side determines how many rows (or columns) the border occupies and how the title is rendered within that space.

### `Thickness.Top == 1` — Title Inline on Border Line

Expand Down Expand Up @@ -77,7 +76,7 @@ Identical rendering to thickness 3, with additional empty rows above. The title

---

## `BorderSettings.Default | BorderSettings.Title | BorderSettings.Tab` - Tab Style Borders
## Tab Style Borders

When `Border.Settings` includes `BorderSettings.Tab`, the border renders a **tab header** — a small rectangle containing the View's `Title` that protrudes from one side of the content border. This is the foundation for building tabbed interfaces.

Expand Down Expand Up @@ -393,7 +392,7 @@ The key change: `DoDrawAdornmentsSubViews` now runs **before** `DoRenderLineCanv

## Arrangement (Move and Resize)

The [BorderView](~/api/Terminal.Gui.ViewBase.BorderView.yml) provides the interactive surface for mouse-driven move and resize operations. This is powered by the [Arranger](~/api/Terminal.Gui.ViewBase.Arranger.yml) class, which is lazily created by `BorderView` and handles all mouse hit-testing and drag operations.
The [BorderView](~/api/Terminal.Gui.ViewBase.BorderView.yml) provides the interactive surface for keyboard and mouse-driven move and resize operations.

For a comprehensive guide to the arrangement system (including keyboard-based arrangement, overlapped layouts, and splitter patterns), see the [View Arrangement Deep Dive](arrangement.md).

Expand Down
2 changes: 1 addition & 1 deletion docfx/docs/command.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ User presses Space on CheckBox

## Architecture Overview

The <xref:Terminal.Gui.Input.Command> system provides a standardized framework for view actions (selecting, accepting, activating). It integrates with keyboard/mouse input handling and uses the *Cancellable Work Pattern* for extensibility and cancellation. As commands propagate through the view hierarchy, each <xref:Terminal.Gui.IValue>-implementing view appends its value to the <xref:Terminal.Gui.Input.ICommandContext.Values> chain, enabling ancestors to inspect the full value history (see [Value Propagation](#value-propagation)).
The Command system provides a standardized framework for view actions (selecting, accepting, activating). It integrates with keyboard/mouse input handling and uses the *Cancellable Work Pattern* for extensibility and cancellation. As commands propagate through the view hierarchy, each `IValue`-implementing view appends its value to the `ICommandContext.Values` chain, enabling ancestors to inspect the full value history (see [Value Propagation](#value-propagation)).

Central concepts:

Expand Down
2 changes: 1 addition & 1 deletion docfx/docs/drawing.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ Each <xref:Terminal.Gui.Drawing.StraightLine> is always horizontal or vertical.

When you call `GetCellMap()`, the canvas walks every point within its bounds:

1. **Collect intersections.** For each point, every line that passes through it produces an <xref:Terminal.Gui.Drawing.IntersectionDefinition> describing *how* the line relates to that point — does it pass over horizontally? Start here going right? End here from below?
1. **Collect intersections.** For each point, every line that passes through it produces an `IntersectionDefinition` describing *how* the line relates to that point — does it pass over horizontally? Start here going right? End here from below?

2. **Determine glyph type.** The set of intersection types at a point is analyzed to decide the glyph category: corner, T-junction, cross, straight line, etc. For example, `{StartRight, StartDown}` = upper-left corner (`┌`).

Expand Down
15 changes: 7 additions & 8 deletions docfx/docs/newinv2.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,16 +290,15 @@ Color color = Color.Yellow; // Was "Brown" in v1

See the [Layout Deep Dive](layout.md) for complete details.

v2 introduces a comprehensive [Adornment](~/api/Terminal.Gui.ViewBase.IAdornment.yml) system with lightweight adornments that lazily create Views when needed:

- **[Margin](~/api/Terminal.Gui.ViewBase.Margin.yml)** - Transparent spacing outside the border
- **[Border](~/api/Terminal.Gui.ViewBase.Border.yml)** - Visual frame with title, multiple styles
- **[Padding](~/api/Terminal.Gui.ViewBase.Padding.yml)** - Spacing inside the border
v2 introduces a comprehensive [Adornment](<xref:Terminal.Gui.ViewBase.IAdornment>) system with lightweight adornments that lazily create Views when needed:

- **[Margin](<xref:Terminal.Gui.ViewBase.Margin>)** - Transparent spacing outside the border
- **[Border](<xref:Terminal.Gui.ViewBase.Border>)** - Visual frame with title, multiple styles
- **[Padding](<xref:Terminal.Gui.ViewBase.Padding>)** - Spacing inside the border
**Border Features:**
- Multiple [LineStyle](~/api/Terminal.Gui.Drawing.LineStyle.yml) options: Single, Double, Heavy, Rounded, Dashed, Dotted
- Automatic line intersection handling via [LineCanvas](~/api/Terminal.Gui.Drawing.LineCanvas.yml)
- Configurable thickness per side via [Thickness](~/api/Terminal.Gui.Drawing.Thickness.yml)
- Multiple [LineStyle](<xref:Terminal.Gui.Drawing.LineStyle>) options: Single, Double, Heavy, Rounded, Dashed, Dotted
- Automatic line intersection handling via [LineCanvas](<xref:Terminal.Gui.Drawing.LineCanvas>)
- Configurable thickness per side via [Thickness](<xref:Terminal.Gui.Drawing.Thickness>)
- Title display with alignment options

```csharp
Expand Down
Loading
Loading