Padding.cs 1.1 KB

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