Add panel header support

Closes #63
This commit is contained in:
Patrik Svensson
2020-09-03 18:48:30 +02:00
committed by Patrik Svensson
parent 9f8ca6d648
commit 7471e9d38c
11 changed files with 301 additions and 27 deletions

View File

@@ -305,13 +305,21 @@ namespace Spectre.Console.Rendering
}
else if (overflow == Overflow.Ellipsis)
{
result.Add(new Segment(segment.Text.Substring(0, width - 1), segment.Style));
result.Add(new Segment("…", segment.Style));
result.Add(new Segment(segment.Text.Substring(0, width - 1) + "…", segment.Style));
}
return result;
}
internal static Segment TruncateWithEllipsis(string text, Style style, Encoding encoding, int maxWidth)
{
return SplitOverflow(
new Segment(text, style),
Overflow.Ellipsis,
encoding,
maxWidth).First();
}
internal static List<List<SegmentLine>> MakeSameHeight(int cellHeight, List<List<SegmentLine>> cells)
{
foreach (var cell in cells)