TreeStyle.cs 1.8 KB

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