FrameView.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. namespace Terminal.Gui.Views;
  2. // TODO: FrameView is mis-named, really. It's far more about it being a TabGroup than a frame.
  3. /// <summary>
  4. /// A non-overlapped container for other views with a border and optional title.
  5. /// </summary>
  6. /// <remarks>
  7. /// <para>
  8. /// FrameView has <see cref="View.BorderStyle"/> set to <see cref="float"/> and
  9. /// inherits it's scheme from the <see cref="View.SuperView"/>.
  10. /// </para>
  11. /// <para>
  12. ///
  13. /// </para>
  14. /// </remarks>
  15. /// <seealso cref="Window"/>
  16. public class FrameView : View
  17. {
  18. private static LineStyle _defaultBorderStyle = LineStyle.Rounded; // Resources/config.json overrides
  19. /// <summary>
  20. /// Initializes a new instance of the <see cref="FrameView"/> class.
  21. /// layout.
  22. /// </summary>
  23. public FrameView ()
  24. {
  25. CanFocus = true;
  26. TabStop = TabBehavior.TabGroup;
  27. BorderStyle = DefaultBorderStyle;
  28. }
  29. /// <summary>
  30. /// Defines the default border styling for <see cref="FrameView"/>. Can be configured via
  31. /// <see cref="ConfigurationManager"/>.
  32. /// </summary>
  33. /// <remarks>
  34. /// This property can be set in a Theme to change the default <see cref="LineStyle"/> for all
  35. /// <see cref="FrameView"/>s.
  36. /// </remarks>
  37. [ConfigurationProperty (Scope = typeof (ThemeScope))]
  38. public static LineStyle DefaultBorderStyle
  39. {
  40. get => _defaultBorderStyle;
  41. set => _defaultBorderStyle = value;
  42. }
  43. }