AlignmentModes.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. /// <remarks>
  18. /// Not implemented.
  19. /// </remarks>
  20. EndToStart = 1,
  21. /// <summary>
  22. /// At least one space will be added between items. Useful for justifying text where at least one space is needed.
  23. /// </summary>
  24. /// <remarks>
  25. /// <para>
  26. /// If the total size of the items is greater than the container size, the space between items will be ignored
  27. /// starting from the end.
  28. /// </para>
  29. /// </remarks>
  30. AddSpaceBetweenItems = 2,
  31. /// <summary>
  32. /// When aligning via <see cref="Alignment.Start"/> or <see cref="Alignment.End"/>, the item opposite to the alignment (the first or last item) will be ignored.
  33. /// </summary>
  34. /// <remarks>
  35. /// <para>
  36. /// If the container is smaller than the total size of the items, the end items will be clipped (their locations
  37. /// will be greater than the container size).
  38. /// </para>
  39. /// </remarks>
  40. /// <example>
  41. /// <c>
  42. /// Start: |111 2222 33333|
  43. /// End: |111 2222 33333|
  44. /// </c>
  45. /// </example>
  46. IgnoreFirstOrLast = 4,
  47. }