class_theme.rst 58 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/Theme.xml.
  6. .. _class_Theme:
  7. Theme
  8. =====
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  10. Theme for controls.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. A theme for skinning controls. Controls can be skinned individually, but for complex applications, it's more practical to just create a global theme that defines everything. This theme can be applied to any :ref:`Control<class_Control>`; the Control and its children will automatically use it.
  15. Theme resources can alternatively be loaded by writing them in a ``.theme`` file, see the documentation for more information.
  16. .. rst-class:: classref-introduction-group
  17. Tutorials
  18. ---------
  19. - :doc:`../tutorials/ui/gui_skinning`
  20. .. rst-class:: classref-reftable-group
  21. Properties
  22. ----------
  23. .. table::
  24. :widths: auto
  25. +-------------------------+--------------------------------------------------------+
  26. | :ref:`Font<class_Font>` | :ref:`default_font<class_Theme_property_default_font>` |
  27. +-------------------------+--------------------------------------------------------+
  28. .. rst-class:: classref-reftable-group
  29. Methods
  30. -------
  31. .. table::
  32. :widths: auto
  33. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | void | :ref:`add_type<class_Theme_method_add_type>` **(** :ref:`String<class_String>` theme_type **)** |
  35. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | void | :ref:`clear<class_Theme_method_clear>` **(** **)** |
  37. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | void | :ref:`clear_color<class_Theme_method_clear_color>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |
  39. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | void | :ref:`clear_constant<class_Theme_method_clear_constant>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |
  41. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | void | :ref:`clear_font<class_Theme_method_clear_font>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |
  43. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | void | :ref:`clear_icon<class_Theme_method_clear_icon>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |
  45. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | void | :ref:`clear_stylebox<class_Theme_method_clear_stylebox>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |
  47. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | void | :ref:`clear_theme_item<class_Theme_method_clear_theme_item>` **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |
  49. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | void | :ref:`clear_type_variation<class_Theme_method_clear_type_variation>` **(** :ref:`String<class_String>` theme_type **)** |
  51. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | void | :ref:`copy_default_theme<class_Theme_method_copy_default_theme>` **(** **)** |
  53. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | void | :ref:`copy_theme<class_Theme_method_copy_theme>` **(** :ref:`Theme<class_Theme>` other **)** |
  55. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | :ref:`Color<class_Color>` | :ref:`get_color<class_Theme_method_get_color>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const| |
  57. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_color_list<class_Theme_method_get_color_list>` **(** :ref:`String<class_String>` theme_type **)** |const| |
  59. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_color_types<class_Theme_method_get_color_types>` **(** **)** |const| |
  61. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | :ref:`int<class_int>` | :ref:`get_constant<class_Theme_method_get_constant>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const| |
  63. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_constant_list<class_Theme_method_get_constant_list>` **(** :ref:`String<class_String>` theme_type **)** |const| |
  65. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_constant_types<class_Theme_method_get_constant_types>` **(** **)** |const| |
  67. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :ref:`Font<class_Font>` | :ref:`get_font<class_Theme_method_get_font>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const| |
  69. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_font_list<class_Theme_method_get_font_list>` **(** :ref:`String<class_String>` theme_type **)** |const| |
  71. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_font_types<class_Theme_method_get_font_types>` **(** **)** |const| |
  73. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | :ref:`Texture<class_Texture>` | :ref:`get_icon<class_Theme_method_get_icon>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const| |
  75. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_icon_list<class_Theme_method_get_icon_list>` **(** :ref:`String<class_String>` theme_type **)** |const| |
  77. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_icon_types<class_Theme_method_get_icon_types>` **(** **)** |const| |
  79. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | :ref:`StyleBox<class_StyleBox>` | :ref:`get_stylebox<class_Theme_method_get_stylebox>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const| |
  81. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_stylebox_list<class_Theme_method_get_stylebox_list>` **(** :ref:`String<class_String>` theme_type **)** |const| |
  83. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_stylebox_types<class_Theme_method_get_stylebox_types>` **(** **)** |const| |
  85. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | :ref:`Variant<class_Variant>` | :ref:`get_theme_item<class_Theme_method_get_theme_item>` **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const| |
  87. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_theme_item_list<class_Theme_method_get_theme_item_list>` **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` theme_type **)** |const| |
  89. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_theme_item_types<class_Theme_method_get_theme_item_types>` **(** :ref:`DataType<enum_Theme_DataType>` data_type **)** |const| |
  91. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_type_list<class_Theme_method_get_type_list>` **(** :ref:`String<class_String>` theme_type **)** |const| |
  93. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | :ref:`String<class_String>` | :ref:`get_type_variation_base<class_Theme_method_get_type_variation_base>` **(** :ref:`String<class_String>` theme_type **)** |const| |
  95. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_type_variation_list<class_Theme_method_get_type_variation_list>` **(** :ref:`String<class_String>` base_type **)** |const| |
  97. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | :ref:`bool<class_bool>` | :ref:`has_color<class_Theme_method_has_color>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const| |
  99. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | :ref:`bool<class_bool>` | :ref:`has_constant<class_Theme_method_has_constant>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const| |
  101. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | :ref:`bool<class_bool>` | :ref:`has_default_font<class_Theme_method_has_default_font>` **(** **)** |const| |
  103. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | :ref:`bool<class_bool>` | :ref:`has_font<class_Theme_method_has_font>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const| |
  105. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | :ref:`bool<class_bool>` | :ref:`has_icon<class_Theme_method_has_icon>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const| |
  107. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | :ref:`bool<class_bool>` | :ref:`has_stylebox<class_Theme_method_has_stylebox>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const| |
  109. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | :ref:`bool<class_bool>` | :ref:`has_theme_item<class_Theme_method_has_theme_item>` **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const| |
  111. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | :ref:`bool<class_bool>` | :ref:`is_type_variation<class_Theme_method_is_type_variation>` **(** :ref:`String<class_String>` theme_type, :ref:`String<class_String>` base_type **)** |const| |
  113. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | void | :ref:`merge_with<class_Theme_method_merge_with>` **(** :ref:`Theme<class_Theme>` other **)** |
  115. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | void | :ref:`remove_type<class_Theme_method_remove_type>` **(** :ref:`String<class_String>` theme_type **)** |
  117. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. | void | :ref:`rename_color<class_Theme_method_rename_color>` **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |
  119. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  120. | void | :ref:`rename_constant<class_Theme_method_rename_constant>` **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |
  121. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  122. | void | :ref:`rename_font<class_Theme_method_rename_font>` **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |
  123. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  124. | void | :ref:`rename_icon<class_Theme_method_rename_icon>` **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |
  125. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  126. | void | :ref:`rename_stylebox<class_Theme_method_rename_stylebox>` **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |
  127. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  128. | void | :ref:`rename_theme_item<class_Theme_method_rename_theme_item>` **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |
  129. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  130. | void | :ref:`set_color<class_Theme_method_set_color>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type, :ref:`Color<class_Color>` color **)** |
  131. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  132. | void | :ref:`set_constant<class_Theme_method_set_constant>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type, :ref:`int<class_int>` constant **)** |
  133. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  134. | void | :ref:`set_font<class_Theme_method_set_font>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type, :ref:`Font<class_Font>` font **)** |
  135. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  136. | void | :ref:`set_icon<class_Theme_method_set_icon>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type, :ref:`Texture<class_Texture>` texture **)** |
  137. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  138. | void | :ref:`set_stylebox<class_Theme_method_set_stylebox>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type, :ref:`StyleBox<class_StyleBox>` texture **)** |
  139. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  140. | void | :ref:`set_theme_item<class_Theme_method_set_theme_item>` **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type, :ref:`Variant<class_Variant>` value **)** |
  141. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  142. | void | :ref:`set_type_variation<class_Theme_method_set_type_variation>` **(** :ref:`String<class_String>` theme_type, :ref:`String<class_String>` base_type **)** |
  143. +-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  144. .. rst-class:: classref-section-separator
  145. ----
  146. .. rst-class:: classref-descriptions-group
  147. Enumerations
  148. ------------
  149. .. _enum_Theme_DataType:
  150. .. rst-class:: classref-enumeration
  151. enum **DataType**:
  152. .. _class_Theme_constant_DATA_TYPE_COLOR:
  153. .. rst-class:: classref-enumeration-constant
  154. :ref:`DataType<enum_Theme_DataType>` **DATA_TYPE_COLOR** = ``0``
  155. Theme's :ref:`Color<class_Color>` item type.
  156. .. _class_Theme_constant_DATA_TYPE_CONSTANT:
  157. .. rst-class:: classref-enumeration-constant
  158. :ref:`DataType<enum_Theme_DataType>` **DATA_TYPE_CONSTANT** = ``1``
  159. Theme's constant item type.
  160. .. _class_Theme_constant_DATA_TYPE_FONT:
  161. .. rst-class:: classref-enumeration-constant
  162. :ref:`DataType<enum_Theme_DataType>` **DATA_TYPE_FONT** = ``2``
  163. Theme's :ref:`Font<class_Font>` item type.
  164. .. _class_Theme_constant_DATA_TYPE_ICON:
  165. .. rst-class:: classref-enumeration-constant
  166. :ref:`DataType<enum_Theme_DataType>` **DATA_TYPE_ICON** = ``3``
  167. Theme's icon :ref:`Texture<class_Texture>` item type.
  168. .. _class_Theme_constant_DATA_TYPE_STYLEBOX:
  169. .. rst-class:: classref-enumeration-constant
  170. :ref:`DataType<enum_Theme_DataType>` **DATA_TYPE_STYLEBOX** = ``4``
  171. Theme's :ref:`StyleBox<class_StyleBox>` item type.
  172. .. _class_Theme_constant_DATA_TYPE_MAX:
  173. .. rst-class:: classref-enumeration-constant
  174. :ref:`DataType<enum_Theme_DataType>` **DATA_TYPE_MAX** = ``5``
  175. Maximum value for the DataType enum.
  176. .. rst-class:: classref-section-separator
  177. ----
  178. .. rst-class:: classref-descriptions-group
  179. Property Descriptions
  180. ---------------------
  181. .. _class_Theme_property_default_font:
  182. .. rst-class:: classref-property
  183. :ref:`Font<class_Font>` **default_font**
  184. .. rst-class:: classref-property-setget
  185. - void **set_default_font** **(** :ref:`Font<class_Font>` value **)**
  186. - :ref:`Font<class_Font>` **get_default_font** **(** **)**
  187. The default font of this **Theme** resource. Used as a fallback value for font items defined in this theme, but having invalid values. If this value is also invalid, the global default value is used.
  188. Use :ref:`has_default_font<class_Theme_method_has_default_font>` to check if this value is valid.
  189. .. rst-class:: classref-section-separator
  190. ----
  191. .. rst-class:: classref-descriptions-group
  192. Method Descriptions
  193. -------------------
  194. .. _class_Theme_method_add_type:
  195. .. rst-class:: classref-method
  196. void **add_type** **(** :ref:`String<class_String>` theme_type **)**
  197. Adds an empty theme type for every valid data type.
  198. \ **Note:** Empty types are not saved with the theme. This method only exists to perform in-memory changes to the resource. Use available ``set_*`` methods to add theme items.
  199. .. rst-class:: classref-item-separator
  200. ----
  201. .. _class_Theme_method_clear:
  202. .. rst-class:: classref-method
  203. void **clear** **(** **)**
  204. Clears all values on the theme.
  205. .. rst-class:: classref-item-separator
  206. ----
  207. .. _class_Theme_method_clear_color:
  208. .. rst-class:: classref-method
  209. void **clear_color** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)**
  210. Clears the :ref:`Color<class_Color>` at ``name`` if the theme has ``theme_type``.
  211. .. rst-class:: classref-item-separator
  212. ----
  213. .. _class_Theme_method_clear_constant:
  214. .. rst-class:: classref-method
  215. void **clear_constant** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)**
  216. Clears the constant at ``name`` if the theme has ``theme_type``.
  217. .. rst-class:: classref-item-separator
  218. ----
  219. .. _class_Theme_method_clear_font:
  220. .. rst-class:: classref-method
  221. void **clear_font** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)**
  222. Clears the :ref:`Font<class_Font>` at ``name`` if the theme has ``theme_type``.
  223. .. rst-class:: classref-item-separator
  224. ----
  225. .. _class_Theme_method_clear_icon:
  226. .. rst-class:: classref-method
  227. void **clear_icon** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)**
  228. Clears the icon at ``name`` if the theme has ``theme_type``.
  229. .. rst-class:: classref-item-separator
  230. ----
  231. .. _class_Theme_method_clear_stylebox:
  232. .. rst-class:: classref-method
  233. void **clear_stylebox** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)**
  234. Clears :ref:`StyleBox<class_StyleBox>` at ``name`` if the theme has ``theme_type``.
  235. .. rst-class:: classref-item-separator
  236. ----
  237. .. _class_Theme_method_clear_theme_item:
  238. .. rst-class:: classref-method
  239. void **clear_theme_item** **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)**
  240. Clears the theme item of ``data_type`` at ``name`` if the theme has ``theme_type``.
  241. .. rst-class:: classref-item-separator
  242. ----
  243. .. _class_Theme_method_clear_type_variation:
  244. .. rst-class:: classref-method
  245. void **clear_type_variation** **(** :ref:`String<class_String>` theme_type **)**
  246. Unmarks ``theme_type`` as being a variation of another theme type. See :ref:`set_type_variation<class_Theme_method_set_type_variation>`.
  247. .. rst-class:: classref-item-separator
  248. ----
  249. .. _class_Theme_method_copy_default_theme:
  250. .. rst-class:: classref-method
  251. void **copy_default_theme** **(** **)**
  252. Sets the theme's values to a copy of the default theme values.
  253. .. rst-class:: classref-item-separator
  254. ----
  255. .. _class_Theme_method_copy_theme:
  256. .. rst-class:: classref-method
  257. void **copy_theme** **(** :ref:`Theme<class_Theme>` other **)**
  258. Sets the theme's values to a copy of a given theme.
  259. .. rst-class:: classref-item-separator
  260. ----
  261. .. _class_Theme_method_get_color:
  262. .. rst-class:: classref-method
  263. :ref:`Color<class_Color>` **get_color** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const|
  264. Returns the :ref:`Color<class_Color>` at ``name`` if the theme has ``theme_type``.
  265. .. rst-class:: classref-item-separator
  266. ----
  267. .. _class_Theme_method_get_color_list:
  268. .. rst-class:: classref-method
  269. :ref:`PoolStringArray<class_PoolStringArray>` **get_color_list** **(** :ref:`String<class_String>` theme_type **)** |const|
  270. Returns all the :ref:`Color<class_Color>`\ s as a :ref:`PoolStringArray<class_PoolStringArray>` filled with each :ref:`Color<class_Color>`'s name, for use in :ref:`get_color<class_Theme_method_get_color>`, if the theme has ``theme_type``.
  271. .. rst-class:: classref-item-separator
  272. ----
  273. .. _class_Theme_method_get_color_types:
  274. .. rst-class:: classref-method
  275. :ref:`PoolStringArray<class_PoolStringArray>` **get_color_types** **(** **)** |const|
  276. Returns all the :ref:`Color<class_Color>` types as a :ref:`PoolStringArray<class_PoolStringArray>` filled with unique type names, for use in :ref:`get_color<class_Theme_method_get_color>` and/or :ref:`get_color_list<class_Theme_method_get_color_list>`.
  277. .. rst-class:: classref-item-separator
  278. ----
  279. .. _class_Theme_method_get_constant:
  280. .. rst-class:: classref-method
  281. :ref:`int<class_int>` **get_constant** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const|
  282. Returns the constant at ``name`` if the theme has ``theme_type``.
  283. .. rst-class:: classref-item-separator
  284. ----
  285. .. _class_Theme_method_get_constant_list:
  286. .. rst-class:: classref-method
  287. :ref:`PoolStringArray<class_PoolStringArray>` **get_constant_list** **(** :ref:`String<class_String>` theme_type **)** |const|
  288. Returns all the constants as a :ref:`PoolStringArray<class_PoolStringArray>` filled with each constant's name, for use in :ref:`get_constant<class_Theme_method_get_constant>`, if the theme has ``theme_type``.
  289. .. rst-class:: classref-item-separator
  290. ----
  291. .. _class_Theme_method_get_constant_types:
  292. .. rst-class:: classref-method
  293. :ref:`PoolStringArray<class_PoolStringArray>` **get_constant_types** **(** **)** |const|
  294. Returns all the constant types as a :ref:`PoolStringArray<class_PoolStringArray>` filled with unique type names, for use in :ref:`get_constant<class_Theme_method_get_constant>` and/or :ref:`get_constant_list<class_Theme_method_get_constant_list>`.
  295. .. rst-class:: classref-item-separator
  296. ----
  297. .. _class_Theme_method_get_font:
  298. .. rst-class:: classref-method
  299. :ref:`Font<class_Font>` **get_font** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const|
  300. Returns the :ref:`Font<class_Font>` at ``name`` if the theme has ``theme_type``. If such item does not exist and :ref:`default_font<class_Theme_property_default_font>` is set on the theme, the default font will be returned.
  301. .. rst-class:: classref-item-separator
  302. ----
  303. .. _class_Theme_method_get_font_list:
  304. .. rst-class:: classref-method
  305. :ref:`PoolStringArray<class_PoolStringArray>` **get_font_list** **(** :ref:`String<class_String>` theme_type **)** |const|
  306. Returns all the :ref:`Font<class_Font>`\ s as a :ref:`PoolStringArray<class_PoolStringArray>` filled with each :ref:`Font<class_Font>`'s name, for use in :ref:`get_font<class_Theme_method_get_font>`, if the theme has ``theme_type``.
  307. .. rst-class:: classref-item-separator
  308. ----
  309. .. _class_Theme_method_get_font_types:
  310. .. rst-class:: classref-method
  311. :ref:`PoolStringArray<class_PoolStringArray>` **get_font_types** **(** **)** |const|
  312. Returns all the :ref:`Font<class_Font>` types as a :ref:`PoolStringArray<class_PoolStringArray>` filled with unique type names, for use in :ref:`get_font<class_Theme_method_get_font>` and/or :ref:`get_font_list<class_Theme_method_get_font_list>`.
  313. .. rst-class:: classref-item-separator
  314. ----
  315. .. _class_Theme_method_get_icon:
  316. .. rst-class:: classref-method
  317. :ref:`Texture<class_Texture>` **get_icon** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const|
  318. Returns the icon :ref:`Texture<class_Texture>` at ``name`` if the theme has ``theme_type``.
  319. .. rst-class:: classref-item-separator
  320. ----
  321. .. _class_Theme_method_get_icon_list:
  322. .. rst-class:: classref-method
  323. :ref:`PoolStringArray<class_PoolStringArray>` **get_icon_list** **(** :ref:`String<class_String>` theme_type **)** |const|
  324. Returns all the icons as a :ref:`PoolStringArray<class_PoolStringArray>` filled with each :ref:`Texture<class_Texture>`'s name, for use in :ref:`get_icon<class_Theme_method_get_icon>`, if the theme has ``theme_type``.
  325. .. rst-class:: classref-item-separator
  326. ----
  327. .. _class_Theme_method_get_icon_types:
  328. .. rst-class:: classref-method
  329. :ref:`PoolStringArray<class_PoolStringArray>` **get_icon_types** **(** **)** |const|
  330. Returns all the icon types as a :ref:`PoolStringArray<class_PoolStringArray>` filled with unique type names, for use in :ref:`get_icon<class_Theme_method_get_icon>` and/or :ref:`get_icon_list<class_Theme_method_get_icon_list>`.
  331. .. rst-class:: classref-item-separator
  332. ----
  333. .. _class_Theme_method_get_stylebox:
  334. .. rst-class:: classref-method
  335. :ref:`StyleBox<class_StyleBox>` **get_stylebox** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const|
  336. Returns the :ref:`StyleBox<class_StyleBox>` at ``name`` if the theme has ``theme_type``.
  337. Valid ``name``\ s may be found using :ref:`get_stylebox_list<class_Theme_method_get_stylebox_list>`. Valid ``theme_type``\ s may be found using :ref:`get_stylebox_types<class_Theme_method_get_stylebox_types>`.
  338. .. rst-class:: classref-item-separator
  339. ----
  340. .. _class_Theme_method_get_stylebox_list:
  341. .. rst-class:: classref-method
  342. :ref:`PoolStringArray<class_PoolStringArray>` **get_stylebox_list** **(** :ref:`String<class_String>` theme_type **)** |const|
  343. Returns all the :ref:`StyleBox<class_StyleBox>`\ s as a :ref:`PoolStringArray<class_PoolStringArray>` filled with each :ref:`StyleBox<class_StyleBox>`'s name, for use in :ref:`get_stylebox<class_Theme_method_get_stylebox>`, if the theme has ``theme_type``.
  344. Valid ``theme_type``\ s may be found using :ref:`get_stylebox_types<class_Theme_method_get_stylebox_types>`.
  345. .. rst-class:: classref-item-separator
  346. ----
  347. .. _class_Theme_method_get_stylebox_types:
  348. .. rst-class:: classref-method
  349. :ref:`PoolStringArray<class_PoolStringArray>` **get_stylebox_types** **(** **)** |const|
  350. Returns all the :ref:`StyleBox<class_StyleBox>` types as a :ref:`PoolStringArray<class_PoolStringArray>` filled with unique type names, for use in :ref:`get_stylebox<class_Theme_method_get_stylebox>` and/or :ref:`get_stylebox_list<class_Theme_method_get_stylebox_list>`.
  351. .. rst-class:: classref-item-separator
  352. ----
  353. .. _class_Theme_method_get_theme_item:
  354. .. rst-class:: classref-method
  355. :ref:`Variant<class_Variant>` **get_theme_item** **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const|
  356. Returns the theme item of ``data_type`` at ``name`` if the theme has ``theme_type``.
  357. Valid ``name``\ s may be found using :ref:`get_theme_item_list<class_Theme_method_get_theme_item_list>` or a data type specific method. Valid ``theme_type``\ s may be found using :ref:`get_theme_item_types<class_Theme_method_get_theme_item_types>` or a data type specific method.
  358. .. rst-class:: classref-item-separator
  359. ----
  360. .. _class_Theme_method_get_theme_item_list:
  361. .. rst-class:: classref-method
  362. :ref:`PoolStringArray<class_PoolStringArray>` **get_theme_item_list** **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` theme_type **)** |const|
  363. Returns all the theme items of ``data_type`` as a :ref:`PoolStringArray<class_PoolStringArray>` filled with each theme items's name, for use in :ref:`get_theme_item<class_Theme_method_get_theme_item>` or a data type specific method, if the theme has ``theme_type``.
  364. Valid ``theme_type``\ s may be found using :ref:`get_theme_item_types<class_Theme_method_get_theme_item_types>` or a data type specific method.
  365. .. rst-class:: classref-item-separator
  366. ----
  367. .. _class_Theme_method_get_theme_item_types:
  368. .. rst-class:: classref-method
  369. :ref:`PoolStringArray<class_PoolStringArray>` **get_theme_item_types** **(** :ref:`DataType<enum_Theme_DataType>` data_type **)** |const|
  370. Returns all the theme items of ``data_type`` types as a :ref:`PoolStringArray<class_PoolStringArray>` filled with unique type names, for use in :ref:`get_theme_item<class_Theme_method_get_theme_item>`, :ref:`get_theme_item_list<class_Theme_method_get_theme_item_list>` or data type specific methods.
  371. .. rst-class:: classref-item-separator
  372. ----
  373. .. _class_Theme_method_get_type_list:
  374. .. rst-class:: classref-method
  375. :ref:`PoolStringArray<class_PoolStringArray>` **get_type_list** **(** :ref:`String<class_String>` theme_type **)** |const|
  376. Returns all the theme types as a :ref:`PoolStringArray<class_PoolStringArray>` filled with unique type names, for use in other ``get_*`` functions of this theme.
  377. \ **Note:** ``theme_type`` has no effect and will be removed in future version.
  378. .. rst-class:: classref-item-separator
  379. ----
  380. .. _class_Theme_method_get_type_variation_base:
  381. .. rst-class:: classref-method
  382. :ref:`String<class_String>` **get_type_variation_base** **(** :ref:`String<class_String>` theme_type **)** |const|
  383. Returns the name of the base theme type if ``theme_type`` is a valid variation type. Returns an empty string otherwise.
  384. .. rst-class:: classref-item-separator
  385. ----
  386. .. _class_Theme_method_get_type_variation_list:
  387. .. rst-class:: classref-method
  388. :ref:`PoolStringArray<class_PoolStringArray>` **get_type_variation_list** **(** :ref:`String<class_String>` base_type **)** |const|
  389. Returns a list of all type variations for the given ``base_type``.
  390. .. rst-class:: classref-item-separator
  391. ----
  392. .. _class_Theme_method_has_color:
  393. .. rst-class:: classref-method
  394. :ref:`bool<class_bool>` **has_color** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const|
  395. Returns ``true`` if :ref:`Color<class_Color>` with ``name`` is in ``theme_type``.
  396. Returns ``false`` if the theme does not have ``theme_type``.
  397. .. rst-class:: classref-item-separator
  398. ----
  399. .. _class_Theme_method_has_constant:
  400. .. rst-class:: classref-method
  401. :ref:`bool<class_bool>` **has_constant** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const|
  402. Returns ``true`` if constant with ``name`` is in ``theme_type``.
  403. Returns ``false`` if the theme does not have ``theme_type``.
  404. .. rst-class:: classref-item-separator
  405. ----
  406. .. _class_Theme_method_has_default_font:
  407. .. rst-class:: classref-method
  408. :ref:`bool<class_bool>` **has_default_font** **(** **)** |const|
  409. Returns ``true`` if this theme has a valid :ref:`default_font<class_Theme_property_default_font>` value.
  410. .. rst-class:: classref-item-separator
  411. ----
  412. .. _class_Theme_method_has_font:
  413. .. rst-class:: classref-method
  414. :ref:`bool<class_bool>` **has_font** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const|
  415. Returns ``true`` if :ref:`Font<class_Font>` with ``name`` is in ``theme_type``.
  416. Returns ``false`` if the theme does not have ``theme_type``.
  417. .. rst-class:: classref-item-separator
  418. ----
  419. .. _class_Theme_method_has_icon:
  420. .. rst-class:: classref-method
  421. :ref:`bool<class_bool>` **has_icon** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const|
  422. Returns ``true`` if icon :ref:`Texture<class_Texture>` with ``name`` is in ``theme_type``.
  423. Returns ``false`` if the theme does not have ``theme_type``.
  424. .. rst-class:: classref-item-separator
  425. ----
  426. .. _class_Theme_method_has_stylebox:
  427. .. rst-class:: classref-method
  428. :ref:`bool<class_bool>` **has_stylebox** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const|
  429. Returns ``true`` if :ref:`StyleBox<class_StyleBox>` with ``name`` is in ``theme_type``.
  430. Returns ``false`` if the theme does not have ``theme_type``.
  431. .. rst-class:: classref-item-separator
  432. ----
  433. .. _class_Theme_method_has_theme_item:
  434. .. rst-class:: classref-method
  435. :ref:`bool<class_bool>` **has_theme_item** **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)** |const|
  436. Returns ``true`` if a theme item of ``data_type`` with ``name`` is in ``theme_type``.
  437. Returns ``false`` if the theme does not have ``theme_type``.
  438. .. rst-class:: classref-item-separator
  439. ----
  440. .. _class_Theme_method_is_type_variation:
  441. .. rst-class:: classref-method
  442. :ref:`bool<class_bool>` **is_type_variation** **(** :ref:`String<class_String>` theme_type, :ref:`String<class_String>` base_type **)** |const|
  443. Returns ``true`` if ``theme_type`` is marked as a variation of ``base_type``.
  444. .. rst-class:: classref-item-separator
  445. ----
  446. .. _class_Theme_method_merge_with:
  447. .. rst-class:: classref-method
  448. void **merge_with** **(** :ref:`Theme<class_Theme>` other **)**
  449. Adds missing and overrides existing definitions with values from the ``other`` **Theme**.
  450. \ **Note:** This modifies the current theme. If you want to merge two themes together without modifying either one, create a new empty theme and merge the other two into it one after another.
  451. .. rst-class:: classref-item-separator
  452. ----
  453. .. _class_Theme_method_remove_type:
  454. .. rst-class:: classref-method
  455. void **remove_type** **(** :ref:`String<class_String>` theme_type **)**
  456. Removes the theme type, gracefully discarding defined theme items. If the type is a variation, this information is also erased. If the type is a base for type variations, those variations lose their base.
  457. .. rst-class:: classref-item-separator
  458. ----
  459. .. _class_Theme_method_rename_color:
  460. .. rst-class:: classref-method
  461. void **rename_color** **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)**
  462. Renames the :ref:`Color<class_Color>` at ``old_name`` to ``name`` if the theme has ``theme_type``. If ``name`` is already taken, this method fails.
  463. .. rst-class:: classref-item-separator
  464. ----
  465. .. _class_Theme_method_rename_constant:
  466. .. rst-class:: classref-method
  467. void **rename_constant** **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)**
  468. Renames the constant at ``old_name`` to ``name`` if the theme has ``theme_type``. If ``name`` is already taken, this method fails.
  469. .. rst-class:: classref-item-separator
  470. ----
  471. .. _class_Theme_method_rename_font:
  472. .. rst-class:: classref-method
  473. void **rename_font** **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)**
  474. Renames the :ref:`Font<class_Font>` at ``old_name`` to ``name`` if the theme has ``theme_type``. If ``name`` is already taken, this method fails.
  475. .. rst-class:: classref-item-separator
  476. ----
  477. .. _class_Theme_method_rename_icon:
  478. .. rst-class:: classref-method
  479. void **rename_icon** **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)**
  480. Renames the icon at ``old_name`` to ``name`` if the theme has ``theme_type``. If ``name`` is already taken, this method fails.
  481. .. rst-class:: classref-item-separator
  482. ----
  483. .. _class_Theme_method_rename_stylebox:
  484. .. rst-class:: classref-method
  485. void **rename_stylebox** **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)**
  486. Renames :ref:`StyleBox<class_StyleBox>` at ``old_name`` to ``name`` if the theme has ``theme_type``. If ``name`` is already taken, this method fails.
  487. .. rst-class:: classref-item-separator
  488. ----
  489. .. _class_Theme_method_rename_theme_item:
  490. .. rst-class:: classref-method
  491. void **rename_theme_item** **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type **)**
  492. Renames the theme item of ``data_type`` at ``old_name`` to ``name`` if the theme has ``theme_type``. If ``name`` is already taken, this method fails.
  493. .. rst-class:: classref-item-separator
  494. ----
  495. .. _class_Theme_method_set_color:
  496. .. rst-class:: classref-method
  497. void **set_color** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type, :ref:`Color<class_Color>` color **)**
  498. Sets the theme's :ref:`Color<class_Color>` to ``color`` at ``name`` in ``theme_type``.
  499. Creates ``theme_type`` if the theme does not have it.
  500. .. rst-class:: classref-item-separator
  501. ----
  502. .. _class_Theme_method_set_constant:
  503. .. rst-class:: classref-method
  504. void **set_constant** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type, :ref:`int<class_int>` constant **)**
  505. Sets the theme's constant to ``constant`` at ``name`` in ``theme_type``.
  506. Creates ``theme_type`` if the theme does not have it.
  507. .. rst-class:: classref-item-separator
  508. ----
  509. .. _class_Theme_method_set_font:
  510. .. rst-class:: classref-method
  511. void **set_font** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type, :ref:`Font<class_Font>` font **)**
  512. Sets the theme's :ref:`Font<class_Font>` to ``font`` at ``name`` in ``theme_type``.
  513. Creates ``theme_type`` if the theme does not have it.
  514. .. rst-class:: classref-item-separator
  515. ----
  516. .. _class_Theme_method_set_icon:
  517. .. rst-class:: classref-method
  518. void **set_icon** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type, :ref:`Texture<class_Texture>` texture **)**
  519. Sets the theme's icon :ref:`Texture<class_Texture>` to ``texture`` at ``name`` in ``theme_type``.
  520. Creates ``theme_type`` if the theme does not have it.
  521. .. rst-class:: classref-item-separator
  522. ----
  523. .. _class_Theme_method_set_stylebox:
  524. .. rst-class:: classref-method
  525. void **set_stylebox** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type, :ref:`StyleBox<class_StyleBox>` texture **)**
  526. Sets theme's :ref:`StyleBox<class_StyleBox>` to ``stylebox`` at ``name`` in ``theme_type``.
  527. Creates ``theme_type`` if the theme does not have it.
  528. .. rst-class:: classref-item-separator
  529. ----
  530. .. _class_Theme_method_set_theme_item:
  531. .. rst-class:: classref-method
  532. void **set_theme_item** **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` name, :ref:`String<class_String>` theme_type, :ref:`Variant<class_Variant>` value **)**
  533. Sets the theme item of ``data_type`` to ``value`` at ``name`` in ``theme_type``.
  534. Does nothing if the ``value`` type does not match ``data_type``.
  535. Creates ``theme_type`` if the theme does not have it.
  536. .. rst-class:: classref-item-separator
  537. ----
  538. .. _class_Theme_method_set_type_variation:
  539. .. rst-class:: classref-method
  540. void **set_type_variation** **(** :ref:`String<class_String>` theme_type, :ref:`String<class_String>` base_type **)**
  541. Marks ``theme_type`` as a variation of ``base_type``.
  542. This adds ``theme_type`` as a suggested option for :ref:`Control.theme_type_variation<class_Control_property_theme_type_variation>` on a :ref:`Control<class_Control>` that is of the ``base_type`` class.
  543. Variations can also be nested, i.e. ``base_type`` can be another variation. If a chain of variations ends with a ``base_type`` matching the class of the :ref:`Control<class_Control>`, the whole chain is going to be suggested as options.
  544. \ **Note:** Suggestions only show up if this theme resource is set as the project default theme. See :ref:`ProjectSettings.gui/theme/custom<class_ProjectSettings_property_gui/theme/custom>`.
  545. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  546. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  547. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  548. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`