AlignmentModes.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System.Text.Json.Serialization;
  2. namespace Terminal.Gui;
  3. /// <summary>
  4. /// Determines alignment modes for <see cref="Alignment"/>.
  5. /// </summary>
  6. [JsonConverter (typeof (JsonStringEnumConverter<AlignmentModes>))]
  7. [Flags]
  8. public enum AlignmentModes
  9. {
  10. /// <summary>
  11. /// The items will be arranged from start (left/top) to end (right/bottom).
  12. /// </summary>
  13. StartToEnd = 0,
  14. /// <summary>
  15. /// The items will be arranged from end (right/bottom) to start (left/top).
  16. /// </summary>
  17. EndToStart = 1,
  18. /// <summary>
  19. /// At least one space will be added between items. Useful for justifying text where at least one space is needed.
  20. /// </summary>
  21. /// <remarks>
  22. /// If the total size of the items is greater than the container size, the space between items will be ignored
  23. /// starting from the end.
  24. /// </remarks>
  25. AddSpaceBetweenItems = 2,
  26. /// <summary>
  27. /// When aligning via <see cref="Alignment.Start"/> or <see cref="Alignment.End"/>, the item opposite to the alignment
  28. /// (the first or last item) will be ignored.
  29. /// </summary>
  30. /// <remarks>
  31. /// If the container is smaller than the total size of the items, the end items will be clipped (their locations
  32. /// will be greater than the container size).
  33. /// </remarks>
  34. /// <example>
  35. /// <c>
  36. /// Start: |111 2222 33333|
  37. /// End: |111 2222 33333|
  38. /// </c>
  39. /// </example>
  40. IgnoreFirstOrLast = 4
  41. }