mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-19 13:28:16 +08:00
Clean up public API
* Make things a bit more consistent * Add extension methods to configure things like tables, panels and grids.
This commit is contained in:

committed by
Patrik Svensson

parent
c111c7d463
commit
31f117aed0
@ -6,42 +6,38 @@ namespace PanelExample
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
var content = Text.Markup(
|
||||
var content = new Markup(
|
||||
"[underline]I[/] heard [underline on blue]you[/] like 📦\n\n\n\n" +
|
||||
"So I put a 📦 in a 📦\n\n" +
|
||||
"😅");
|
||||
"😅").Centered();
|
||||
|
||||
AnsiConsole.Render(
|
||||
new Panel(
|
||||
new Panel(content)
|
||||
{
|
||||
Alignment = Justify.Center,
|
||||
Border = BorderKind.Rounded
|
||||
}));
|
||||
|
||||
// Left adjusted panel with text
|
||||
AnsiConsole.Render(new Panel(
|
||||
new Text("Left adjusted\nLeft"))
|
||||
new Text("Left adjusted\nLeft").LeftAligned())
|
||||
{
|
||||
Expand = true,
|
||||
Alignment = Justify.Left,
|
||||
});
|
||||
|
||||
// Centered ASCII panel with text
|
||||
AnsiConsole.Render(new Panel(
|
||||
new Text("Centered\nCenter"))
|
||||
new Text("Centered\nCenter").Centered())
|
||||
{
|
||||
Expand = true,
|
||||
Alignment = Justify.Center,
|
||||
Border = BorderKind.Ascii,
|
||||
});
|
||||
|
||||
// Right adjusted, rounded panel with text
|
||||
AnsiConsole.Render(new Panel(
|
||||
new Text("Right adjusted\nRight"))
|
||||
new Text("Right adjusted\nRight").RightAligned())
|
||||
{
|
||||
Expand = true,
|
||||
Alignment = Justify.Right,
|
||||
Border = BorderKind.Rounded,
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user