TreeStyle.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #nullable disable
  2. 
  3. namespace Terminal.Gui.Views;
  4. /// <summary>Defines rendering options that affect how the tree is displayed.</summary>
  5. public class TreeStyle
  6. {
  7. /// <summary>
  8. /// Symbol to use for branch nodes that can be collapsed (are currently expanded). Defaults to '-'. Set to null to
  9. /// hide.
  10. /// </summary>
  11. public Rune? CollapseableSymbol { get; set; } = Glyphs.Collapse;
  12. /// <summary>Set to <see langword="true"/> to highlight expand/collapse symbols in hot key color.</summary>
  13. public bool ColorExpandSymbol { get; set; }
  14. /// <summary>
  15. /// Symbol to use for branch nodes that can be expanded to indicate this to the user. Defaults to '+'. Set to null
  16. /// to hide.
  17. /// </summary>
  18. public Rune? ExpandableSymbol { get; set; } = Glyphs.Expand;
  19. /// <summary>
  20. /// Set to <see langword="true"/> to cause the selected item to be rendered with only the
  21. /// <see cref="Branch{T}.Model"/> text to be highlighted. If <see langword="false"/> (the default), the entire row will
  22. /// be highlighted.
  23. /// </summary>
  24. public bool HighlightModelTextOnly { get; set; } = false;
  25. /// <summary>Invert console colours used to render the expand symbol.</summary>
  26. public bool InvertExpandSymbolColors { get; set; }
  27. /// <summary>
  28. /// <see langword="true"/> to leave the last row of the control free for overwriting (e.g. by a scrollbar) When
  29. /// <see langword="true"/> scrolling will be triggered on the second last row of the control rather than. the last.
  30. /// </summary>
  31. /// <value></value>
  32. public bool LeaveLastRow { get; set; }
  33. /// <summary>
  34. /// <see langword="true"/> to render vertical lines under expanded nodes to show which node belongs to which
  35. /// parent. <see langword="false"/> to use only whitespace.
  36. /// </summary>
  37. /// <value></value>
  38. public bool ShowBranchLines { get; set; } = true;
  39. }