Add tree widget

This commit is contained in:
Matt Constable
2021-01-02 09:01:16 +00:00
committed by GitHub
parent 179e243214
commit b136d0299b
16 changed files with 467 additions and 16 deletions

View File

@ -60,7 +60,7 @@ namespace Spectre.Console
if (lineWidth < maxWidth)
{
yield return new Segment(new string(' ', maxWidth - lineWidth));
yield return Segment.Padding(maxWidth - lineWidth);
}
}
else if (alignment == Justify.Center)
@ -68,15 +68,15 @@ namespace Spectre.Console
var left = (maxWidth - lineWidth) / 2;
var right = left + ((maxWidth - lineWidth) % 2);
yield return new Segment(new string(' ', left));
yield return Segment.Padding(left);
yield return line;
yield return new Segment(new string(' ', right));
yield return Segment.Padding(right);
}
else if (alignment == Justify.Right)
{
if (lineWidth < maxWidth)
{
yield return new Segment(new string(' ', maxWidth - lineWidth));
yield return Segment.Padding(maxWidth - lineWidth);
}
yield return line;