Skip to content

Commit

Permalink
Merge pull request #1294 from nils-a/feature/GH-1279
Browse files Browse the repository at this point in the history
  • Loading branch information
patriksvensson authored Sep 11, 2023
2 parents 131b37f + c64797d commit 1002c6f
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/input/assets/casts/columns-plain.cast
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{"version": 2, "width": 122, "height": 24, "title": "columns (plain)", "env": {"TERM": "Spectre.Console"}}
[0, "o", "\u001B[31;40mItem 1\u001B[0m \u001B[32;40mItem 2\u001B[0m \u001B[34;40mItem 3\u001B[0m \r\n"]
[0.203, "o", "\u001B[31;40mItem 4\u001B[0m \u001B[32;40mItem 5\u001B[0m \u001B[34;40mItem 6\u001B[0m \r\n"]
[0.406, "o", "\u001B[31;40mItem 7\u001B[0m \u001B[32;40mItem 8\u001B[0m \u001B[34;40mItem 9\u001B[0m \r\n"]
[0.609, "o", "\u001B[31;40mItem 10\u001B[0m \u001B[32;40mItem 11\u001B[0m \u001B[34;40mItem 12\u001B[0m \r\n"]
[0.813, "o", "\u001B[31;40mItem 13\u001B[0m \u001B[32;40mItem 14\u001B[0m \u001B[34;40mItem 15\u001B[0m \r\n"]
[1.031, "o", "\u001B[31;40mItem 16\u001B[0m \u001B[32;40mItem 17\u001B[0m \u001B[34;40mItem 18\u001B[0m \r\n"]
[1.234, "o", "\u001B[31;40mItem 19\u001B[0m \u001B[32;40mItem 20\u001B[0m \u001B[34;40mItem 21\u001B[0m \r\n"]
[1.438, "o", "\u001B[31;40mItem 22\u001B[0m \u001B[32;40mItem 23\u001B[0m \u001B[34;40mItem 24\u001B[0m \r\n"]
[1.641, "o", "\u001B[31;40mItem 25\u001B[0m \u001B[32;40mItem 26\u001B[0m \u001B[34;40mItem 27\u001B[0m \r\n"]
[1.859, "o", "\u001B[31;40mItem 28\u001B[0m \u001B[32;40mItem 29\u001B[0m \u001B[34;40mItem 30\u001B[0m \r\n"]
[2.063, "o", "\u001B[31;40mItem 31\u001B[0m \u001B[32;40mItem 32\u001B[0m \u001B[34;40mItem 33\u001B[0m \r\n"]

13 changes: 13 additions & 0 deletions docs/input/assets/casts/columns-rich.cast
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{"version": 2, "width": 122, "height": 24, "title": "columns (rich)", "env": {"TERM": "Spectre.Console"}}
[0, "o", "\u001B[38;5;9;48;5;0mItem 1\u001B[0m \u001B[38;5;2;48;5;0mItem 2\u001B[0m \u001B[38;5;12;48;5;0mItem 3\u001B[0m \r\n"]
[0.218, "o", "\u001B[38;5;9;48;5;0mItem 4\u001B[0m \u001B[38;5;2;48;5;0mItem 5\u001B[0m \u001B[38;5;12;48;5;0mItem 6\u001B[0m \r\n"]
[0.422, "o", "\u001B[38;5;9;48;5;0mItem 7\u001B[0m \u001B[38;5;2;48;5;0mItem 8\u001B[0m \u001B[38;5;12;48;5;0mItem 9\u001B[0m \r\n"]
[0.625, "o", "\u001B[38;5;9;48;5;0mItem 10\u001B[0m \u001B[38;5;2;48;5;0mItem 11\u001B[0m \u001B[38;5;12;48;5;0mItem 12\u001B[0m \r\n"]
[0.828, "o", "\u001B[38;5;9;48;5;0mItem 13\u001B[0m \u001B[38;5;2;48;5;0mItem 14\u001B[0m \u001B[38;5;12;48;5;0mItem 15\u001B[0m \r\n"]
[1.031, "o", "\u001B[38;5;9;48;5;0mItem 16\u001B[0m \u001B[38;5;2;48;5;0mItem 17\u001B[0m \u001B[38;5;12;48;5;0mItem 18\u001B[0m \r\n"]
[1.234, "o", "\u001B[38;5;9;48;5;0mItem 19\u001B[0m \u001B[38;5;2;48;5;0mItem 20\u001B[0m \u001B[38;5;12;48;5;0mItem 21\u001B[0m \r\n"]
[1.437, "o", "\u001B[38;5;9;48;5;0mItem 22\u001B[0m \u001B[38;5;2;48;5;0mItem 23\u001B[0m \u001B[38;5;12;48;5;0mItem 24\u001B[0m \r\n"]
[1.64, "o", "\u001B[38;5;9;48;5;0mItem 25\u001B[0m \u001B[38;5;2;48;5;0mItem 26\u001B[0m \u001B[38;5;12;48;5;0mItem 27\u001B[0m \r\n"]
[1.859, "o", "\u001B[38;5;9;48;5;0mItem 28\u001B[0m \u001B[38;5;2;48;5;0mItem 29\u001B[0m \u001B[38;5;12;48;5;0mItem 30\u001B[0m \r\n"]
[2.047, "o", "\u001B[38;5;9;48;5;0mItem 31\u001B[0m \u001B[38;5;2;48;5;0mItem 32\u001B[0m \u001B[38;5;12;48;5;0mItem 33\u001B[0m \r\n"]

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System.Threading;
using Spectre.Console;

namespace Generator.Commands.Samples
{
public class ColumnsSample : BaseSample
{
public override void Run(IAnsiConsole console)
{
for (var i = 0; i <= 10; i++)
{
var n = 3 * i + 1;
console.Write(new Columns(
new Text($"Item {n}", new Style(Color.Red, Color.Black)),
new Text($"Item {n+1}", new Style(Color.Green, Color.Black)),
new Text($"Item {n+2}", new Style(Color.Blue, Color.Black))
));
Thread.Sleep(200);
}
}
}
}

0 comments on commit 1002c6f

Please sign in to comment.