Window.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. namespace Terminal.Gui.Views;
  2. /// <summary>
  3. /// An overlapped container for other views with a border and optional title.
  4. /// </summary>
  5. /// <remarks>
  6. /// <para>
  7. /// Window has <see cref="View.BorderStyle"/> set to <see cref="float"/>, <see cref="View.Arrangement"/>
  8. /// set to <see cref="ViewArrangement.Overlapped"/>, and
  9. /// uses the "Base" <see cref="Scheme"/> scheme by default.
  10. /// </para>
  11. /// <para>
  12. /// To enable Window to be sized and moved by the user, adjust <see cref="View.Arrangement"/>.
  13. /// </para>
  14. /// </remarks>
  15. /// <seealso cref="FrameView"/>
  16. public class Window : Toplevel
  17. {
  18. /// <summary>
  19. /// Initializes a new instance of the <see cref="Window"/> class.
  20. /// </summary>
  21. public Window ()
  22. {
  23. CanFocus = true;
  24. TabStop = TabBehavior.TabGroup;
  25. Arrangement = ViewArrangement.Overlapped;
  26. SchemeName = SchemeManager.SchemesToSchemeName (Schemes.Base);
  27. BorderStyle = DefaultBorderStyle;
  28. base.ShadowStyle = DefaultShadow;
  29. }
  30. /// <summary>
  31. /// Gets or sets whether all <see cref="Window"/>s are shown with a shadow effect by default.
  32. /// </summary>
  33. [ConfigurationProperty (Scope = typeof (ThemeScope))]
  34. public static ShadowStyle DefaultShadow { get; set; } = ShadowStyle.None;
  35. // TODO: enable this
  36. ///// <summary>
  37. ///// The default <see cref="LineStyle"/> for <see cref="Window"/>'s border. The default is <see cref="LineStyle.Single"/>.
  38. ///// </summary>
  39. ///// <remarks>
  40. ///// This property can be set in a Theme to change the default <see cref="LineStyle"/> for all <see cref="Window"/>s.
  41. ///// </remarks>
  42. /////[ConfigurationProperty (Scope = typeof (ThemeScope)), JsonConverter (typeof (JsonStringEnumConverter))]
  43. ////public static Scheme DefaultScheme { get; set; } = Colors.Schemes ["Base"];
  44. /// <summary>
  45. /// The default <see cref="LineStyle"/> for <see cref="Window"/>'s border. The default is
  46. /// <see cref="LineStyle.Single"/>.
  47. /// </summary>
  48. /// <remarks>
  49. /// This property can be set in a Theme to change the default <see cref="LineStyle"/> for all <see cref="Window"/>
  50. /// s.
  51. /// </remarks>
  52. [ConfigurationProperty (Scope = typeof (ThemeScope))]
  53. public static LineStyle DefaultBorderStyle { get; set; } = LineStyle.Single;
  54. }