From 525b414ff859a329a1ee24f5936be721ca453d8f Mon Sep 17 00:00:00 2001 From: Thomas Freudenberg Date: Tue, 16 Feb 2021 23:33:47 +0100 Subject: [PATCH] Make alignment of TaskDescriptionColumn configurable --- .../Widgets/Progress/Columns/TaskDescriptionColumn.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Spectre.Console/Widgets/Progress/Columns/TaskDescriptionColumn.cs b/src/Spectre.Console/Widgets/Progress/Columns/TaskDescriptionColumn.cs index 0292b14..686a908 100644 --- a/src/Spectre.Console/Widgets/Progress/Columns/TaskDescriptionColumn.cs +++ b/src/Spectre.Console/Widgets/Progress/Columns/TaskDescriptionColumn.cs @@ -11,11 +11,16 @@ namespace Spectre.Console /// protected internal override bool NoWrap => true; + /// + /// Gets or sets the alignment of the task description. + /// + public Justify Alignment { get; set; } = Justify.Right; + /// 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); } } }