TreeStyle.cs 1.9 KB

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