mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-16 08:52:50 +08:00

The emojis that previously were used, used Unicode combinators which are not fully supported. Changing to :thumbs_up: and :thumbs_down: instead.
28 lines
1.0 KiB
C#
28 lines
1.0 KiB
C#
using Spectre.Console;
|
|
|
|
namespace Info
|
|
{
|
|
public static class Program
|
|
{
|
|
public static void Main()
|
|
{
|
|
var grid = new Grid()
|
|
.AddColumn(new GridColumn().NoWrap().PadRight(4))
|
|
.AddColumn()
|
|
.AddRow("[b]:artist_palette: Color system[/]", $"{AnsiConsole.Capabilities.ColorSystem}")
|
|
.AddRow("[b]:nail_polish: Supports ansi?[/]", $"{GetEmoji(AnsiConsole.Capabilities.SupportsAnsi)}")
|
|
.AddRow("[b]:top_hat: Legacy console?[/]", $"{GetEmoji(AnsiConsole.Capabilities.LegacyConsole)}")
|
|
.AddRow("[b]:left-right_arrow: Buffer width[/]", $"{AnsiConsole.Console.Width}")
|
|
.AddRow("[b]:up-down_arrow: Buffer height[/]", $"{AnsiConsole.Console.Height}");
|
|
|
|
AnsiConsole.Render(
|
|
new Panel(grid)
|
|
.SetHeader("Information"));
|
|
}
|
|
|
|
private static string GetEmoji(bool value) => value
|
|
? ":thumbs_up:"
|
|
: ":thumbs_down:";
|
|
}
|
|
}
|