mirror of
				https://github.com/nsnail/spectre.console.git
				synced 2025-10-31 09:09:25 +08:00 
			
		
		
		
	Make alignment of TaskDescriptionColumn configurable
This commit is contained in:
		 Thomas Freudenberg
					Thomas Freudenberg
				
			
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			 GitHub
						GitHub
					
				
			
						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); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user