mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-19 21:38:16 +08:00
Add Layout widget (#1041)
* Add width to panels * Add height to panels * Replace RenderContext with RenderOptions * Remove exclusivity from alternative buffer * Add Layout widget * Add Align widget
This commit is contained in:
@ -17,7 +17,7 @@ public static class Program
|
||||
|
||||
// Left adjusted panel with text
|
||||
AnsiConsole.Write(
|
||||
new Panel(new Text("Left adjusted\nLeft").LeftAligned())
|
||||
new Panel(new Text("Left adjusted\nLeft").LeftJustified())
|
||||
.Expand()
|
||||
.SquareBorder()
|
||||
.Header("[red]Left[/]"));
|
||||
@ -32,7 +32,7 @@ public static class Program
|
||||
|
||||
// Right adjusted, rounded panel with text
|
||||
AnsiConsole.Write(
|
||||
new Panel(new Text("Right adjusted\nRight").RightAligned())
|
||||
new Panel(new Text("Right adjusted\nRight").RightJustified())
|
||||
.Expand()
|
||||
.RoundedBorder()
|
||||
.Header("[blue]Right[/]")
|
||||
|
Reference in New Issue
Block a user