TreeStyle.cs 1.9 KB

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