DimFill.cs 776 B

1234567891011121314151617181920212223
  1. #nullable enable
  2. namespace Terminal.Gui;
  3. /// <summary>
  4. /// Represents a dimension that fills the dimension, leaving the specified margin.
  5. /// </summary>
  6. /// <remarks>
  7. /// This is a low-level API that is typically used internally by the layout system. Use the various static
  8. /// methods on the <see cref="Dim"/> class to create <see cref="Dim"/> objects instead.
  9. /// </remarks>
  10. /// <param name="Margin">The margin to not fill.</param>
  11. public record DimFill (int Margin) : Dim
  12. {
  13. /// <summary>
  14. /// Gets the margin to not fill.
  15. /// </summary>
  16. public int Margin { get; } = Margin;
  17. /// <inheritdoc/>
  18. public override string ToString () { return $"Fill({Margin})"; }
  19. internal override int GetAnchor (int size) { return size - Margin; }
  20. }