mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-20 05:48:14 +08:00
Progress bar header and footer (#1262)
This commit is contained in:
@ -1,19 +1,28 @@
|
||||
namespace Spectre.Console;
|
||||
|
||||
internal sealed class ControlCode : Renderable
|
||||
/// <summary>
|
||||
/// A control code.
|
||||
/// </summary>
|
||||
public sealed class ControlCode : Renderable
|
||||
{
|
||||
private readonly Segment _segment;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ControlCode"/> class.
|
||||
/// </summary>
|
||||
/// <param name="control">The control code.</param>
|
||||
public ControlCode(string control)
|
||||
{
|
||||
_segment = Segment.Control(control);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override Measurement Measure(RenderOptions options, int maxWidth)
|
||||
{
|
||||
return new Measurement(0, 0);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override IEnumerable<Segment> Render(RenderOptions options, int maxWidth)
|
||||
{
|
||||
if (options.Ansi)
|
||||
|
@ -63,7 +63,7 @@ public sealed class Rows : Renderable, IExpandable
|
||||
|
||||
if (last)
|
||||
{
|
||||
if (!segment.IsLineBreak)
|
||||
if (!segment.IsLineBreak && child is not ControlCode)
|
||||
{
|
||||
result.Add(Segment.LineBreak);
|
||||
}
|
||||
|
Reference in New Issue
Block a user