namespace Spectre.Console
{
///
/// Represents a grid column.
///
public sealed class GridColumn : IColumn
{
private Padding _padding;
///
/// Gets or sets the width of the column.
/// If null, the column will adapt to it's contents.
///
public int? Width { get; set; }
///
/// Gets or sets a value indicating whether wrapping of
/// text within the column should be prevented.
///
public bool NoWrap { get; set; }
///
/// Gets or sets the padding of the column.
///
public Padding Padding
{
get => _padding;
set
{
HasExplicitPadding = true;
_padding = value;
}
}
///
/// Gets or sets the alignment of the column.
///
public Justify? Alignment { get; set; }
///
/// Gets a value indicating whether the user
/// has set an explicit padding for this column.
///
internal bool HasExplicitPadding { get; private set; }
///
/// Initializes a new instance of the class.
///
public GridColumn()
{
_padding = new Padding(0, 2);
}
}
}