ThemeScope.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using System.Text.Json.Serialization;
  2. #nullable enable
  3. namespace Terminal.Gui;
  4. /// <summary>
  5. /// The root object for a Theme. A Theme is a set of settings that are applied to the running <see cref="Application"/>
  6. /// as a group.
  7. /// </summary>
  8. /// <remarks>
  9. /// <para>
  10. /// </para>
  11. /// </remarks>
  12. /// <example><code>
  13. /// "Default": {
  14. /// "ColorSchemes": [
  15. /// {
  16. /// "TopLevel": {
  17. /// "Normal": {
  18. /// "Foreground": "BrightGreen",
  19. /// "Background": "Black"
  20. /// },
  21. /// "Focus": {
  22. /// "Foreground": "White",
  23. /// "Background": "Cyan"
  24. ///
  25. /// },
  26. /// "HotNormal": {
  27. /// "Foreground": "Brown",
  28. /// "Background": "Black"
  29. ///
  30. /// },
  31. /// "HotFocus": {
  32. /// "Foreground": "Blue",
  33. /// "Background": "Cyan"
  34. /// },
  35. /// "Disabled": {
  36. /// "Foreground": "DarkGray",
  37. /// "Background": "Black"
  38. ///
  39. /// }
  40. /// }
  41. /// </code></example>
  42. [JsonConverter (typeof (ScopeJsonConverter<ThemeScope>))]
  43. public class ThemeScope : Scope<ThemeScope> {
  44. /// <inheritdoc/>
  45. internal override bool Apply ()
  46. {
  47. var ret = base.Apply ();
  48. Application.Driver?.InitializeColorSchemes ();
  49. return ret;
  50. }
  51. }