Padding.cs 958 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using System;
  2. using System.Linq;
  3. namespace Terminal.Gui;
  4. /// <summary>
  5. /// The Padding for a <see cref="View"/>.
  6. /// </summary>
  7. /// <remarks>
  8. /// <para>
  9. /// See the <see cref="Adornment"/> class.
  10. /// </para>
  11. /// </remarks>
  12. public class Padding : Adornment {
  13. /// <inheritdoc />
  14. public Padding () { /* Do nothing; A parameter-less constructor is required to support all views unit tests. */ }
  15. /// <inheritdoc />
  16. public Padding (View parent) : base (parent) { /* Do nothing; View.CreateAdornment requires a constructor that takes a parent */ }
  17. /// <summary>
  18. /// The color scheme for the Padding. If set to <see langword="null"/>, gets the <see cref="Adornment.Parent"/> scheme.
  19. /// color scheme.
  20. /// </summary>
  21. public override ColorScheme ColorScheme {
  22. get {
  23. if (base.ColorScheme != null) {
  24. return base.ColorScheme;
  25. }
  26. return Parent?.ColorScheme;
  27. }
  28. set {
  29. base.ColorScheme = value;
  30. Parent?.SetNeedsDisplay ();
  31. }
  32. }
  33. }