AlignmentModes.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. /// <para>
  23. /// If the total size of the items is greater than the container size, the space between items will be ignored
  24. /// starting from the end.
  25. /// </para>
  26. /// </remarks>
  27. AddSpaceBetweenItems = 2,
  28. /// <summary>
  29. /// 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.
  30. /// </summary>
  31. /// <remarks>
  32. /// <para>
  33. /// If the container is smaller than the total size of the items, the end items will be clipped (their locations
  34. /// will be greater than the container size).
  35. /// </para>
  36. /// </remarks>
  37. /// <example>
  38. /// <c>
  39. /// Start: |111 2222 33333|
  40. /// End: |111 2222 33333|
  41. /// </c>
  42. /// </example>
  43. IgnoreFirstOrLast = 4,
  44. }