DimAutoStyle.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 <see cref="View.GetContentSize ()"/> and/or <see cref="View.Subviews"/>.
  12. /// <para>
  13. /// If <see cref="View.ContentSizeTracksViewport"/> is <see langword="true"/>, <see cref="View.GetContentSize ()"/> will be used to determine the dimension.
  14. /// </para>
  15. /// <para>
  16. /// Otherwise, the Subview in <see cref="View.Subviews"/> with the largest corresponding position plus dimension
  17. /// will determine the dimension.
  18. /// </para>
  19. /// <para>
  20. /// The corresponding dimension of the view's <see cref="View.Text"/> will be ignored.
  21. /// </para>
  22. /// </summary>
  23. Content = 1,
  24. /// <summary>
  25. /// <para>
  26. /// The corresponding dimension of the view's <see cref="View.Text"/>, formatted using the
  27. /// <see cref="View.TextFormatter"/> settings,
  28. /// will be used to determine the dimension.
  29. /// </para>
  30. /// <para>
  31. /// The corresponding dimensions of <see cref="View.GetContentSize ()"/> and/or <see cref="View.Subviews"/> will be ignored.
  32. /// </para>
  33. /// </summary>
  34. Text = 2,
  35. /// <summary>
  36. /// The dimension will be computed using the largest of the view's <see cref="View.Text"/>, <see cref="View.GetContentSize ()"/>, and
  37. /// <see cref="View.Subviews"/> corresponding dimension
  38. /// </summary>
  39. Auto = Content | Text,
  40. }