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
10 changes: 6 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: Publish Terminal.Gui to Nuget

on:
push:
branches: [ main, develop ]
# Main releases are triggered only by pushing a v* tag (e.g., v2.0.0).
# Develop pushes publish pre-release packages (e.g., 2.1.0-develop.1).
branches: [ develop ]
tags:
- v*
paths-ignore:
Expand Down Expand Up @@ -71,21 +73,21 @@ jobs:
run: dotnet nuget push Terminal.Gui/bin/Release/Terminal.Gui.${{ steps.gitversion.outputs.SemVer }}.nupkg --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }}

# - name: Delist old NuGet packages
# if: github.ref == 'refs/heads/main'
# if: startsWith(github.ref, 'refs/tags/v')
# shell: pwsh
# run: |
# $version = "${{ steps.gitversion.outputs.SemVer }}"
# Write-Host "Running delist script for just-published version: $version"
# ./Scripts/delist-nuget.ps1 -ApiKey "${{ secrets.NUGET_API_KEY }}" -JustPublishedVersion "$version"

- name: Prepare payload for template dispatch
if: github.ref == 'refs/heads/main'
if: startsWith(github.ref, 'refs/tags/v')
id: payload
run: |
echo "json={\"version\":\"${{ steps.gitversion.outputs.SemVer }}\"}" >> $GITHUB_OUTPUT

- name: Trigger Terminal.Gui.templates update
if: github.ref == 'refs/heads/main'
if: startsWith(github.ref, 'refs/tags/v')
uses: peter-evans/repository-dispatch@v4
with:
token: ${{ secrets.TEMPLATE_REPO_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<PackageVersion Include="Moq" Version="4.20.72" />
<PackageVersion Include="Markdig" Version="1.1.3" />
<PackageVersion Include="TextMateSharp.Grammars" Version="2.0.3" />
<PackageVersion Include="ReportGenerator" Version="5.5.5" />
<PackageVersion Include="ReportGenerator" Version="5.5.6" />
<PackageVersion Include="TestableIO.System.IO.Abstractions.TestingHelpers" Version="22.1.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.5.1" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
Expand Down
22 changes: 11 additions & 11 deletions docfx/docs/layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ Label absoluteLabel = new () { X = 1, Y = 2, Width = 12, Height = 1, Text = "Abs
Label responsiveLabel = new ()
{
Text = "Responsive",
X = Pos.Right (absoluteLabel),
X = Pos.Right (otherView),
Y = Pos.Center (),
Width = Dim.Fill (),
Height = Dim.Percent (50)
Expand All @@ -169,13 +169,13 @@ Label responsiveLabel = new ()

<xref:Terminal.Gui.ViewBase.Pos> is the type of `View.X` and `View.Y`. To make a view's position respond to available space or other views instead of using a fixed coordinate, use it.

* Absolute position, by passing an integer - `Pos.Absolute (10)` or simply `X = 10`
* Percentage of the `SuperView` size - `Pos.Percent (50)`
* Anchored from the end of the dimension - `Pos.AnchorEnd (10)`
* Absolute position, by passing an integer - `Pos.Absolute ()`
* Percentage of the `SuperView` size - `Pos.Percent ()`
* Anchored from the end of the dimension - `Pos.AnchorEnd ()`
* Centered - `Pos.Center ()`
* Tracking another view - `Pos.Left (otherView)`, `Pos.Right (otherView)`, `Pos.Top (otherView)`, `Pos.Bottom (otherView)`
* Aligning as a group - `Pos.Align (...)`
* Computing from a function - `Pos.Func (...)`
* Tracking another view - `Pos.Left ()`, `Pos.Right ()`, `Pos.Top ()`, `Pos.Bottom ()`
* Aligning as a group - `Pos.Align ()`
* Computing from a function - `Pos.Func ()`

All <xref:Terminal.Gui.ViewBase.Pos> coordinates are relative to the SuperView's content area.

Expand All @@ -197,12 +197,12 @@ myView.Y = Pos.Bottom (anotherView) + 5;
<xref:Terminal.Gui.ViewBase.Dim> is the type of `View.Width` and `View.Height`. To make size respond to content, terminal size, or sibling views instead of using a fixed number of cells, use it.

* Automatic size based on the view's content - `Dim.Auto ()` - See [Dim.Auto Deep Dive](dimauto.md)
* Absolute size, by passing an integer - `Dim.Absolute (10)`
* Percentage of the `SuperView` content area - `Dim.Percent (50)`
* Absolute size, by passing an integer - `Dim.Absolute ()`
* Percentage of the `SuperView` content area - `Dim.Percent ()`
* Fill the remaining space - `Dim.Fill ()`
* Fill up to another view - `Dim.Fill (to: otherView)`
* Track another view's size - `Dim.Width (otherView)`, `Dim.Height (otherView)`
* Compute from a function - `Dim.Func (() => 10)`
* Track another view's size - `Dim.Width ()`, `Dim.Height ()`
* Compute from a function - `Dim.Func ()`

`Dim.Fill ()` is especially useful for responsive forms and panes. **Note:** `Dim.Fill` does not contribute to a `SuperView`'s `Dim.Auto ()` sizing unless `minimumContentDim` is specified. See [Dim.Auto Deep Dive](dimauto.md) for details.

Expand Down
Loading