DimAutoStyle.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using Terminal.Gui.Analyzers.Internal.Attributes;
  2. namespace Terminal.Gui;
  3. /// <summary>
  4. /// Specifies how <see cref="Dim.Auto"/> will compute the dimension.
  5. /// </summary>
  6. [Flags]
  7. [GenerateEnumExtensionMethods (FastHasFlags = true)]
  8. public enum DimAutoStyle
  9. {
  10. /// <summary>
  11. /// The dimensions will be computed based on the View's non-Text content.
  12. /// <para>
  13. /// If <see cref="View.ContentSize"/> is explicitly set (is not <see langword="null"/>) then
  14. /// <see cref="View.ContentSize"/>
  15. /// will be used to determine the dimension.
  16. /// </para>
  17. /// <para>
  18. /// Otherwise, the Subview in <see cref="View.Subviews"/> with the largest corresponding position plus dimension
  19. /// will determine the dimension.
  20. /// </para>
  21. /// <para>
  22. /// The corresponding dimension of the view's <see cref="View.Text"/> will be ignored.
  23. /// </para>
  24. /// </summary>
  25. Content = 0,
  26. /// <summary>
  27. /// <para>
  28. /// The corresponding dimension of the view's <see cref="View.Text"/>, formatted using the
  29. /// <see cref="View.TextFormatter"/> settings,
  30. /// will be used to determine the dimension.
  31. /// </para>
  32. /// <para>
  33. /// The corresponding dimensions of the <see cref="View.Subviews"/> will be ignored.
  34. /// </para>
  35. /// </summary>
  36. Text = 1,
  37. /// <summary>
  38. /// The dimension will be computed using both the view's <see cref="View.Text"/> and
  39. /// <see cref="View.Subviews"/> (whichever is larger).
  40. /// </summary>
  41. Auto = Content | Text,
  42. }