-
-
Notifications
You must be signed in to change notification settings - Fork 514
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add width to panels * Add height to panels * Replace RenderContext with RenderOptions * Remove exclusivity from alternative buffer * Add Layout widget * Add Align widget
- Loading branch information
1 parent
9ce3b99
commit c3ec6a7
Showing
137 changed files
with
2,650 additions
and
386 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<ExampleTitle>Layout</ExampleTitle> | ||
<ExampleDescription>Demonstrates how to use layouts.</ExampleDescription> | ||
<ExampleGroup>Widgets</ExampleGroup> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\Shared\Shared.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
using System; | ||
using Spectre.Console; | ||
|
||
namespace Layouts; | ||
|
||
public static class Program | ||
{ | ||
public static void Main() | ||
{ | ||
var layout = CreateLayout(); | ||
AnsiConsole.Write(layout); | ||
|
||
Console.ReadKey(true); | ||
} | ||
|
||
private static Layout CreateLayout() | ||
{ | ||
var layout = new Layout(); | ||
|
||
layout.SplitRows( | ||
new Layout("Top") | ||
.SplitColumns( | ||
new Layout("Left") | ||
.SplitRows( | ||
new Layout("LeftTop"), | ||
new Layout("LeftBottom")), | ||
new Layout("Right").Ratio(2), | ||
new Layout("RightRight").Size(3)), | ||
new Layout("Bottom")); | ||
|
||
layout["LeftBottom"].Update( | ||
new Panel("[blink]PRESS ANY KEY TO QUIT[/]") | ||
.Expand() | ||
.BorderColor(Color.Yellow) | ||
.Padding(0, 0)); | ||
|
||
layout["Right"].Update( | ||
new Panel( | ||
new Table() | ||
.AddColumns("[blue]Qux[/]", "[green]Corgi[/]") | ||
.AddRow("9", "8") | ||
.AddRow("7", "6") | ||
.Expand()) | ||
.Header("A [yellow]Table[/] in a [blue]Panel[/] (Ratio=2)") | ||
.Expand()); | ||
|
||
layout["RightRight"].Update( | ||
new Panel("Explicit-size-is-[yellow]3[/]") | ||
.BorderColor(Color.Yellow) | ||
.Padding(0, 0)); | ||
|
||
layout["Bottom"].Update( | ||
new Panel( | ||
new FigletText("Hello World")) | ||
.Header("Some [green]Figlet[/] text") | ||
.Expand()); | ||
|
||
return layout; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<SolutionConfiguration> | ||
<Settings> | ||
<AllowParallelTestExecution>True</AllowParallelTestExecution> | ||
<SolutionConfigured>True</SolutionConfigured> | ||
</Settings> | ||
</SolutionConfiguration> |
Oops, something went wrong.