mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-16 00:42:51 +08:00
Make alignment of TaskDescriptionColumn configurable
This commit is contained in:
parent
ed0fb29be4
commit
525b414ff8
@ -11,11 +11,16 @@ namespace Spectre.Console
|
||||
/// <inheritdoc/>
|
||||
protected internal override bool NoWrap => true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the alignment of the task description.
|
||||
/// </summary>
|
||||
public Justify Alignment { get; set; } = Justify.Right;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override IRenderable Render(RenderContext context, ProgressTask task, TimeSpan deltaTime)
|
||||
{
|
||||
var text = task.Description?.RemoveNewLines()?.Trim();
|
||||
return new Markup(text ?? string.Empty).Overflow(Overflow.Ellipsis).RightAligned();
|
||||
return new Markup(text ?? string.Empty).Overflow(Overflow.Ellipsis).Alignment(Alignment);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user