Add theme_custom_type property to Control and Window

This commit is contained in:
Yuri Sizov 2021-03-30 20:16:33 +03:00
parent 8e7b17429e
commit 9eaa139c1f
9 changed files with 803 additions and 876 deletions

View file

@ -462,10 +462,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName" default="&quot;&quot;">
<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;">
</argument>
<description>
Returns a color from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code].
Returns a color from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code].
[codeblocks]
[gdscript]
func _ready():
@ -485,10 +485,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName" default="&quot;&quot;">
<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;">
</argument>
<description>
Returns a constant from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code].
Returns a constant from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code].
</description>
</method>
<method name="get_theme_font" qualifiers="const">
@ -496,10 +496,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName" default="&quot;&quot;">
<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;">
</argument>
<description>
Returns a font from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code].
Returns a font from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code].
</description>
</method>
<method name="get_theme_font_size" qualifiers="const">
@ -507,10 +507,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName" default="&quot;&quot;">
<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;">
</argument>
<description>
Returns a font size from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]type[/code].
Returns a font size from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code].
</description>
</method>
<method name="get_theme_icon" qualifiers="const">
@ -518,10 +518,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName" default="&quot;&quot;">
<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;">
</argument>
<description>
Returns an icon from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code].
Returns an icon from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code].
</description>
</method>
<method name="get_theme_stylebox" qualifiers="const">
@ -529,10 +529,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName" default="&quot;&quot;">
<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;">
</argument>
<description>
Returns a [StyleBox] from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code].
Returns a [StyleBox] from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code].
</description>
</method>
<method name="get_tooltip" qualifiers="const">
@ -593,10 +593,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName" default="&quot;&quot;">
<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;">
</argument>
<description>
Returns [code]true[/code] if [Color] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code] exists in assigned [Theme].
Returns [code]true[/code] if [Color] with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code] exists in assigned [Theme].
</description>
</method>
<method name="has_theme_color_override" qualifiers="const">
@ -613,10 +613,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName" default="&quot;&quot;">
<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;">
</argument>
<description>
Returns [code]true[/code] if constant with given [code]name[/code] and associated with [Control] of given [code]node_type[/code] exists in assigned [Theme].
Returns [code]true[/code] if constant with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code] exists in assigned [Theme].
</description>
</method>
<method name="has_theme_constant_override" qualifiers="const">
@ -633,10 +633,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName" default="&quot;&quot;">
<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;">
</argument>
<description>
Returns [code]true[/code] if font with given [code]name[/code] and associated with [Control] of given [code]node_type[/code] exists in assigned [Theme].
Returns [code]true[/code] if font with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code] exists in assigned [Theme].
</description>
</method>
<method name="has_theme_font_override" qualifiers="const">
@ -653,10 +653,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName" default="&quot;&quot;">
<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;">
</argument>
<description>
Returns [code]true[/code] if font size with given [code]name[/code] and associated with [Control] of given [code]type[/code] exists in assigned [Theme].
Returns [code]true[/code] if font size with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code] exists in assigned [Theme].
</description>
</method>
<method name="has_theme_font_size_override" qualifiers="const">
@ -673,10 +673,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName" default="&quot;&quot;">
<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;">
</argument>
<description>
Returns [code]true[/code] if icon with given [code]name[/code] and associated with [Control] of given [code]node_type[/code] exists in assigned [Theme].
Returns [code]true[/code] if icon with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code] exists in assigned [Theme].
</description>
</method>
<method name="has_theme_icon_override" qualifiers="const">
@ -693,10 +693,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName" default="&quot;&quot;">
<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;">
</argument>
<description>
Returns [code]true[/code] if [StyleBox] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code] exists in assigned [Theme].
Returns [code]true[/code] if [StyleBox] with given [code]name[/code] and associated with [Control] of given [code]theme_type[/code] exists in assigned [Theme].
</description>
</method>
<method name="has_theme_stylebox_override" qualifiers="const">
@ -1173,7 +1173,12 @@
Tells the parent [Container] nodes how they should resize and place the node on the Y axis. Use one of the [enum SizeFlags] constants to change the flags. See the constants to learn what each does.
</member>
<member name="theme" type="Theme" setter="set_theme" getter="get_theme">
Changing this property replaces the current [Theme] resource this node and all its [Control] children use.
The [Theme] resource this node and all its [Control] children use. If a child node has its own [Theme] resource set, theme items are merged with child's definitions having higher priority.
</member>
<member name="theme_custom_type" type="StringName" setter="set_theme_custom_type" getter="get_theme_custom_type" default="@&quot;&quot;">
The type name used by this [Control] to look up its own theme items. By default, the class name of the node is used (e.g. [code]Button[/code] for the [Button] control), as well as the class names of all parent classes (in order of inheritance). Setting this property gives the highest priority to the type of the specified name, then falls back on the class names.
[b]Note:[/b] To look up [Control]'s own items use various [code]get_theme_*[/code] methods without specifying [code]theme_type[/code].
[b]Note:[/b] Theme items are looked for in the tree order, from branch to root, where each [Control] node is checked for its [member theme] property. The earliest match against any type/class name is returned. The project-level Theme and the default Theme are checked last.
</member>
</members>
<signals>

View file

@ -23,10 +23,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName">
<argument index="1" name="theme_type" type="StringName">
</argument>
<description>
Clears the [Color] at [code]name[/code] if the theme has [code]node_type[/code].
Clears the [Color] at [code]name[/code] if the theme has [code]theme_type[/code].
</description>
</method>
<method name="clear_constant">
@ -34,10 +34,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName">
<argument index="1" name="theme_type" type="StringName">
</argument>
<description>
Clears the constant at [code]name[/code] if the theme has [code]node_type[/code].
Clears the constant at [code]name[/code] if the theme has [code]theme_type[/code].
</description>
</method>
<method name="clear_font">
@ -45,10 +45,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName">
<argument index="1" name="theme_type" type="StringName">
</argument>
<description>
Clears the [Font] at [code]name[/code] if the theme has [code]node_type[/code].
Clears the [Font] at [code]name[/code] if the theme has [code]theme_type[/code].
</description>
</method>
<method name="clear_font_size">
@ -56,10 +56,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName">
<argument index="1" name="theme_type" type="StringName">
</argument>
<description>
Clears the font size [code]name[/code] if the theme has [code]node_type[/code].
Clears the font size [code]name[/code] if the theme has [code]theme_type[/code].
</description>
</method>
<method name="clear_icon">
@ -67,10 +67,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName">
<argument index="1" name="theme_type" type="StringName">
</argument>
<description>
Clears the icon at [code]name[/code] if the theme has [code]node_type[/code].
Clears the icon at [code]name[/code] if the theme has [code]theme_type[/code].
</description>
</method>
<method name="clear_stylebox">
@ -78,10 +78,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName">
<argument index="1" name="theme_type" type="StringName">
</argument>
<description>
Clears [StyleBox] at [code]name[/code] if the theme has [code]node_type[/code].
Clears [StyleBox] at [code]name[/code] if the theme has [code]theme_type[/code].
</description>
</method>
<method name="clear_theme_item">
@ -91,10 +91,10 @@
</argument>
<argument index="1" name="name" type="StringName">
</argument>
<argument index="2" name="node_type" type="StringName">
<argument index="2" name="theme_type" type="StringName">
</argument>
<description>
Clears the theme item of [code]data_type[/code] at [code]name[/code] if the theme has [code]node_type[/code].
Clears the theme item of [code]data_type[/code] at [code]name[/code] if the theme has [code]theme_type[/code].
</description>
</method>
<method name="copy_default_theme">
@ -118,19 +118,19 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName">
<argument index="1" name="theme_type" type="StringName">
</argument>
<description>
Returns the [Color] at [code]name[/code] if the theme has [code]node_type[/code].
Returns the [Color] at [code]name[/code] if the theme has [code]theme_type[/code].
</description>
</method>
<method name="get_color_list" qualifiers="const">
<return type="PackedStringArray">
</return>
<argument index="0" name="node_type" type="String">
<argument index="0" name="theme_type" type="String">
</argument>
<description>
Returns all the [Color]s as a [PackedStringArray] filled with each [Color]'s name, for use in [method get_color], if the theme has [code]node_type[/code].
Returns all the [Color]s as a [PackedStringArray] filled with each [Color]'s name, for use in [method get_color], if the theme has [code]theme_type[/code].
</description>
</method>
<method name="get_color_type_list" qualifiers="const">
@ -145,19 +145,19 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName">
<argument index="1" name="theme_type" type="StringName">
</argument>
<description>
Returns the constant at [code]name[/code] if the theme has [code]node_type[/code].
Returns the constant at [code]name[/code] if the theme has [code]theme_type[/code].
</description>
</method>
<method name="get_constant_list" qualifiers="const">
<return type="PackedStringArray">
</return>
<argument index="0" name="node_type" type="String">
<argument index="0" name="theme_type" type="String">
</argument>
<description>
Returns all the constants as a [PackedStringArray] filled with each constant's name, for use in [method get_constant], if the theme has [code]node_type[/code].
Returns all the constants as a [PackedStringArray] filled with each constant's name, for use in [method get_constant], if the theme has [code]theme_type[/code].
</description>
</method>
<method name="get_constant_type_list" qualifiers="const">
@ -172,19 +172,19 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName">
<argument index="1" name="theme_type" type="StringName">
</argument>
<description>
Returns the [Font] at [code]name[/code] if the theme has [code]node_type[/code].
Returns the [Font] at [code]name[/code] if the theme has [code]theme_type[/code].
</description>
</method>
<method name="get_font_list" qualifiers="const">
<return type="PackedStringArray">
</return>
<argument index="0" name="node_type" type="String">
<argument index="0" name="theme_type" type="String">
</argument>
<description>
Returns all the [Font]s as a [PackedStringArray] filled with each [Font]'s name, for use in [method get_font], if the theme has [code]node_type[/code].
Returns all the [Font]s as a [PackedStringArray] filled with each [Font]'s name, for use in [method get_font], if the theme has [code]theme_type[/code].
</description>
</method>
<method name="get_font_size" qualifiers="const">
@ -192,19 +192,19 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName">
<argument index="1" name="theme_type" type="StringName">
</argument>
<description>
Returns the font size at [code]name[/code] if the theme has [code]node_type[/code].
Returns the font size at [code]name[/code] if the theme has [code]theme_type[/code].
</description>
</method>
<method name="get_font_size_list" qualifiers="const">
<return type="PackedStringArray">
</return>
<argument index="0" name="node_type" type="String">
<argument index="0" name="theme_type" type="String">
</argument>
<description>
Returns all the font sizes as a [PackedStringArray] filled with each font size name, for use in [method get_font_size], if the theme has [code]node_type[/code].
Returns all the font sizes as a [PackedStringArray] filled with each font size name, for use in [method get_font_size], if the theme has [code]theme_type[/code].
</description>
</method>
<method name="get_font_size_type_list" qualifiers="const">
@ -226,19 +226,19 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName">
<argument index="1" name="theme_type" type="StringName">
</argument>
<description>
Returns the icon [Texture2D] at [code]name[/code] if the theme has [code]node_type[/code].
Returns the icon [Texture2D] at [code]name[/code] if the theme has [code]theme_type[/code].
</description>
</method>
<method name="get_icon_list" qualifiers="const">
<return type="PackedStringArray">
</return>
<argument index="0" name="node_type" type="String">
<argument index="0" name="theme_type" type="String">
</argument>
<description>
Returns all the icons as a [PackedStringArray] filled with each [Texture2D]'s name, for use in [method get_icon], if the theme has [code]node_type[/code].
Returns all the icons as a [PackedStringArray] filled with each [Texture2D]'s name, for use in [method get_icon], if the theme has [code]theme_type[/code].
</description>
</method>
<method name="get_icon_type_list" qualifiers="const">
@ -253,21 +253,21 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName">
<argument index="1" name="theme_type" type="StringName">
</argument>
<description>
Returns the [StyleBox] at [code]name[/code] if the theme has [code]node_type[/code].
Valid [code]name[/code]s may be found using [method get_stylebox_list]. Valid [code]node_type[/code]s may be found using [method get_stylebox_type_list].
Returns the [StyleBox] at [code]name[/code] if the theme has [code]theme_type[/code].
Valid [code]name[/code]s may be found using [method get_stylebox_list]. Valid [code]theme_type[/code]s may be found using [method get_stylebox_type_list].
</description>
</method>
<method name="get_stylebox_list" qualifiers="const">
<return type="PackedStringArray">
</return>
<argument index="0" name="node_type" type="String">
<argument index="0" name="theme_type" type="String">
</argument>
<description>
Returns all the [StyleBox]s as a [PackedStringArray] filled with each [StyleBox]'s name, for use in [method get_stylebox], if the theme has [code]node_type[/code].
Valid [code]node_type[/code]s may be found using [method get_stylebox_type_list].
Returns all the [StyleBox]s as a [PackedStringArray] filled with each [StyleBox]'s name, for use in [method get_stylebox], if the theme has [code]theme_type[/code].
Valid [code]theme_type[/code]s may be found using [method get_stylebox_type_list].
</description>
</method>
<method name="get_stylebox_type_list" qualifiers="const">
@ -284,11 +284,11 @@
</argument>
<argument index="1" name="name" type="StringName">
</argument>
<argument index="2" name="node_type" type="StringName">
<argument index="2" name="theme_type" type="StringName">
</argument>
<description>
Returns the theme item of [code]data_type[/code] at [code]name[/code] if the theme has [code]node_type[/code].
Valid [code]name[/code]s may be found using [method get_theme_item_list] or a data type specific method. Valid [code]node_type[/code]s may be found using [method get_theme_item_type_list] or a data type specific method.
Returns the theme item of [code]data_type[/code] at [code]name[/code] if the theme has [code]theme_type[/code].
Valid [code]name[/code]s may be found using [method get_theme_item_list] or a data type specific method. Valid [code]theme_type[/code]s may be found using [method get_theme_item_type_list] or a data type specific method.
</description>
</method>
<method name="get_theme_item_list" qualifiers="const">
@ -296,11 +296,11 @@
</return>
<argument index="0" name="data_type" type="int" enum="Theme.DataType">
</argument>
<argument index="1" name="node_type" type="String">
<argument index="1" name="theme_type" type="String">
</argument>
<description>
Returns all the theme items of [code]data_type[/code] as a [PackedStringArray] filled with each theme items's name, for use in [method get_theme_item] or a data type specific method, if the theme has [code]node_type[/code].
Valid [code]node_type[/code]s may be found using [method get_theme_item_type_list] or a data type specific method.
Returns all the theme items of [code]data_type[/code] as a [PackedStringArray] filled with each theme items's name, for use in [method get_theme_item] or a data type specific method, if the theme has [code]theme_type[/code].
Valid [code]theme_type[/code]s may be found using [method get_theme_item_type_list] or a data type specific method.
</description>
</method>
<method name="get_theme_item_type_list" qualifiers="const">
@ -324,11 +324,11 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName">
<argument index="1" name="theme_type" type="StringName">
</argument>
<description>
Returns [code]true[/code] if [Color] with [code]name[/code] is in [code]node_type[/code].
Returns [code]false[/code] if the theme does not have [code]node_type[/code].
Returns [code]true[/code] if [Color] with [code]name[/code] is in [code]theme_type[/code].
Returns [code]false[/code] if the theme does not have [code]theme_type[/code].
</description>
</method>
<method name="has_constant" qualifiers="const">
@ -336,11 +336,11 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName">
<argument index="1" name="theme_type" type="StringName">
</argument>
<description>
Returns [code]true[/code] if constant with [code]name[/code] is in [code]node_type[/code].
Returns [code]false[/code] if the theme does not have [code]node_type[/code].
Returns [code]true[/code] if constant with [code]name[/code] is in [code]theme_type[/code].
Returns [code]false[/code] if the theme does not have [code]theme_type[/code].
</description>
</method>
<method name="has_font" qualifiers="const">
@ -348,11 +348,11 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName">
<argument index="1" name="theme_type" type="StringName">
</argument>
<description>
Returns [code]true[/code] if [Font] with [code]name[/code] is in [code]node_type[/code].
Returns [code]false[/code] if the theme does not have [code]node_type[/code].
Returns [code]true[/code] if [Font] with [code]name[/code] is in [code]theme_type[/code].
Returns [code]false[/code] if the theme does not have [code]theme_type[/code].
</description>
</method>
<method name="has_font_size" qualifiers="const">
@ -360,11 +360,11 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName">
<argument index="1" name="theme_type" type="StringName">
</argument>
<description>
Returns [code]true[/code] if font size with [code]name[/code] is in [code]node_type[/code].
Returns [code]false[/code] if the theme does not have [code]node_type[/code].
Returns [code]true[/code] if font size with [code]name[/code] is in [code]theme_type[/code].
Returns [code]false[/code] if the theme does not have [code]theme_type[/code].
</description>
</method>
<method name="has_icon" qualifiers="const">
@ -372,11 +372,11 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName">
<argument index="1" name="theme_type" type="StringName">
</argument>
<description>
Returns [code]true[/code] if icon [Texture2D] with [code]name[/code] is in [code]node_type[/code].
Returns [code]false[/code] if the theme does not have [code]node_type[/code].
Returns [code]true[/code] if icon [Texture2D] with [code]name[/code] is in [code]theme_type[/code].
Returns [code]false[/code] if the theme does not have [code]theme_type[/code].
</description>
</method>
<method name="has_stylebox" qualifiers="const">
@ -384,11 +384,11 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName">
<argument index="1" name="theme_type" type="StringName">
</argument>
<description>
Returns [code]true[/code] if [StyleBox] with [code]name[/code] is in [code]node_type[/code].
Returns [code]false[/code] if the theme does not have [code]node_type[/code].
Returns [code]true[/code] if [StyleBox] with [code]name[/code] is in [code]theme_type[/code].
Returns [code]false[/code] if the theme does not have [code]theme_type[/code].
</description>
</method>
<method name="has_theme_item" qualifiers="const">
@ -398,11 +398,11 @@
</argument>
<argument index="1" name="name" type="StringName">
</argument>
<argument index="2" name="node_type" type="StringName">
<argument index="2" name="theme_type" type="StringName">
</argument>
<description>
Returns [code]true[/code] if a theme item of [code]data_type[/code] with [code]name[/code] is in [code]node_type[/code].
Returns [code]false[/code] if the theme does not have [code]node_type[/code].
Returns [code]true[/code] if a theme item of [code]data_type[/code] with [code]name[/code] is in [code]theme_type[/code].
Returns [code]false[/code] if the theme does not have [code]theme_type[/code].
</description>
</method>
<method name="rename_color">
@ -412,10 +412,10 @@
</argument>
<argument index="1" name="name" type="StringName">
</argument>
<argument index="2" name="node_type" type="StringName">
<argument index="2" name="theme_type" type="StringName">
</argument>
<description>
Renames the [Color] at [code]old_name[/code] to [code]name[/code] if the theme has [code]node_type[/code]. If [code]name[/code] is already taken, this method fails.
Renames the [Color] at [code]old_name[/code] to [code]name[/code] if the theme has [code]theme_type[/code]. If [code]name[/code] is already taken, this method fails.
</description>
</method>
<method name="rename_constant">
@ -425,10 +425,10 @@
</argument>
<argument index="1" name="name" type="StringName">
</argument>
<argument index="2" name="node_type" type="StringName">
<argument index="2" name="theme_type" type="StringName">
</argument>
<description>
Renames the constant at [code]old_name[/code] to [code]name[/code] if the theme has [code]node_type[/code]. If [code]name[/code] is already taken, this method fails.
Renames the constant at [code]old_name[/code] to [code]name[/code] if the theme has [code]theme_type[/code]. If [code]name[/code] is already taken, this method fails.
</description>
</method>
<method name="rename_font">
@ -438,10 +438,10 @@
</argument>
<argument index="1" name="name" type="StringName">
</argument>
<argument index="2" name="node_type" type="StringName">
<argument index="2" name="theme_type" type="StringName">
</argument>
<description>
Renames the [Font] at [code]old_name[/code] to [code]name[/code] if the theme has [code]node_type[/code]. If [code]name[/code] is already taken, this method fails.
Renames the [Font] at [code]old_name[/code] to [code]name[/code] if the theme has [code]theme_type[/code]. If [code]name[/code] is already taken, this method fails.
</description>
</method>
<method name="rename_font_size">
@ -451,10 +451,10 @@
</argument>
<argument index="1" name="name" type="StringName">
</argument>
<argument index="2" name="node_type" type="StringName">
<argument index="2" name="theme_type" type="StringName">
</argument>
<description>
Renames the font size [code]old_name[/code] to [code]name[/code] if the theme has [code]node_type[/code]. If [code]name[/code] is already taken, this method fails.
Renames the font size [code]old_name[/code] to [code]name[/code] if the theme has [code]theme_type[/code]. If [code]name[/code] is already taken, this method fails.
</description>
</method>
<method name="rename_icon">
@ -464,10 +464,10 @@
</argument>
<argument index="1" name="name" type="StringName">
</argument>
<argument index="2" name="node_type" type="StringName">
<argument index="2" name="theme_type" type="StringName">
</argument>
<description>
Renames the icon at [code]old_name[/code] to [code]name[/code] if the theme has [code]node_type[/code]. If [code]name[/code] is already taken, this method fails.
Renames the icon at [code]old_name[/code] to [code]name[/code] if the theme has [code]theme_type[/code]. If [code]name[/code] is already taken, this method fails.
</description>
</method>
<method name="rename_stylebox">
@ -477,10 +477,10 @@
</argument>
<argument index="1" name="name" type="StringName">
</argument>
<argument index="2" name="node_type" type="StringName">
<argument index="2" name="theme_type" type="StringName">
</argument>
<description>
Renames [StyleBox] at [code]old_name[/code] to [code]name[/code] if the theme has [code]node_type[/code]. If [code]name[/code] is already taken, this method fails.
Renames [StyleBox] at [code]old_name[/code] to [code]name[/code] if the theme has [code]theme_type[/code]. If [code]name[/code] is already taken, this method fails.
</description>
</method>
<method name="rename_theme_item">
@ -492,10 +492,10 @@
</argument>
<argument index="2" name="name" type="StringName">
</argument>
<argument index="3" name="node_type" type="StringName">
<argument index="3" name="theme_type" type="StringName">
</argument>
<description>
Renames the theme item of [code]data_type[/code] at [code]old_name[/code] to [code]name[/code] if the theme has [code]node_type[/code]. If [code]name[/code] is already taken, this method fails.
Renames the theme item of [code]data_type[/code] at [code]old_name[/code] to [code]name[/code] if the theme has [code]theme_type[/code]. If [code]name[/code] is already taken, this method fails.
</description>
</method>
<method name="set_color">
@ -503,13 +503,13 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName">
<argument index="1" name="theme_type" type="StringName">
</argument>
<argument index="2" name="color" type="Color">
</argument>
<description>
Sets the theme's [Color] to [code]color[/code] at [code]name[/code] in [code]node_type[/code].
Creates [code]node_type[/code] if the theme does not have it.
Sets the theme's [Color] to [code]color[/code] at [code]name[/code] in [code]theme_type[/code].
Creates [code]theme_type[/code] if the theme does not have it.
</description>
</method>
<method name="set_constant">
@ -517,13 +517,13 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName">
<argument index="1" name="theme_type" type="StringName">
</argument>
<argument index="2" name="constant" type="int">
</argument>
<description>
Sets the theme's constant to [code]constant[/code] at [code]name[/code] in [code]node_type[/code].
Creates [code]node_type[/code] if the theme does not have it.
Sets the theme's constant to [code]constant[/code] at [code]name[/code] in [code]theme_type[/code].
Creates [code]theme_type[/code] if the theme does not have it.
</description>
</method>
<method name="set_font">
@ -531,13 +531,13 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName">
<argument index="1" name="theme_type" type="StringName">
</argument>
<argument index="2" name="font" type="Font">
</argument>
<description>
Sets the theme's [Font] to [code]font[/code] at [code]name[/code] in [code]node_type[/code].
Creates [code]node_type[/code] if the theme does not have it.
Sets the theme's [Font] to [code]font[/code] at [code]name[/code] in [code]theme_type[/code].
Creates [code]theme_type[/code] if the theme does not have it.
</description>
</method>
<method name="set_font_size">
@ -545,13 +545,13 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName">
<argument index="1" name="theme_type" type="StringName">
</argument>
<argument index="2" name="font_size" type="int">
</argument>
<description>
Sets the theme's font size to [code]font_size[/code] at [code]name[/code] in [code]node_type[/code].
Creates [code]node_type[/code] if the theme does not have it.
Sets the theme's font size to [code]font_size[/code] at [code]name[/code] in [code]theme_type[/code].
Creates [code]theme_type[/code] if the theme does not have it.
</description>
</method>
<method name="set_icon">
@ -559,13 +559,13 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName">
<argument index="1" name="theme_type" type="StringName">
</argument>
<argument index="2" name="texture" type="Texture2D">
</argument>
<description>
Sets the theme's icon [Texture2D] to [code]texture[/code] at [code]name[/code] in [code]node_type[/code].
Creates [code]node_type[/code] if the theme does not have it.
Sets the theme's icon [Texture2D] to [code]texture[/code] at [code]name[/code] in [code]theme_type[/code].
Creates [code]theme_type[/code] if the theme does not have it.
</description>
</method>
<method name="set_stylebox">
@ -573,13 +573,13 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="node_type" type="StringName">
<argument index="1" name="theme_type" type="StringName">
</argument>
<argument index="2" name="texture" type="StyleBox">
</argument>
<description>
Sets theme's [StyleBox] to [code]stylebox[/code] at [code]name[/code] in [code]node_type[/code].
Creates [code]node_type[/code] if the theme does not have it.
Sets theme's [StyleBox] to [code]stylebox[/code] at [code]name[/code] in [code]theme_type[/code].
Creates [code]theme_type[/code] if the theme does not have it.
</description>
</method>
<method name="set_theme_item">
@ -589,14 +589,14 @@
</argument>
<argument index="1" name="name" type="StringName">
</argument>
<argument index="2" name="node_type" type="StringName">
<argument index="2" name="theme_type" type="StringName">
</argument>
<argument index="3" name="value" type="Variant">
</argument>
<description>
Sets the theme item of [code]data_type[/code] to [code]value[/code] at [code]name[/code] in [code]node_type[/code].
Sets the theme item of [code]data_type[/code] to [code]value[/code] at [code]name[/code] in [code]theme_type[/code].
Does nothing if the [code]value[/code] type does not match [code]data_type[/code].
Creates [code]node_type[/code] if the theme does not have it.
Creates [code]theme_type[/code] if the theme does not have it.
</description>
</method>
</methods>

View file

@ -45,7 +45,7 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="type" type="StringName" default="&quot;&quot;">
<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;">
</argument>
<description>
</description>
@ -55,7 +55,7 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="type" type="StringName" default="&quot;&quot;">
<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;">
</argument>
<description>
</description>
@ -65,10 +65,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="type" type="StringName" default="&quot;&quot;">
<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;">
</argument>
<description>
Returns the [Font] at [code]name[/code] if the theme has [code]type[/code].
Returns the [Font] at [code]name[/code] if the theme has [code]theme_type[/code].
</description>
</method>
<method name="get_theme_font_size" qualifiers="const">
@ -76,10 +76,10 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="type" type="StringName" default="&quot;&quot;">
<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;">
</argument>
<description>
Returns the font size at [code]name[/code] if the theme has [code]type[/code].
Returns the font size at [code]name[/code] if the theme has [code]theme_type[/code].
</description>
</method>
<method name="get_theme_icon" qualifiers="const">
@ -87,7 +87,7 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="type" type="StringName" default="&quot;&quot;">
<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;">
</argument>
<description>
</description>
@ -97,7 +97,7 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="type" type="StringName" default="&quot;&quot;">
<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;">
</argument>
<description>
</description>
@ -119,7 +119,7 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="type" type="StringName" default="&quot;&quot;">
<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;">
</argument>
<description>
</description>
@ -129,7 +129,7 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="type" type="StringName" default="&quot;&quot;">
<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;">
</argument>
<description>
</description>
@ -139,11 +139,11 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="type" type="StringName" default="&quot;&quot;">
<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;">
</argument>
<description>
Returns [code]true[/code] if [Font] with [code]name[/code] is in [code]type[/code].
Returns [code]false[/code] if the theme does not have [code]type[/code].
Returns [code]true[/code] if [Font] with [code]name[/code] is in [code]theme_type[/code].
Returns [code]false[/code] if the theme does not have [code]theme_type[/code].
</description>
</method>
<method name="has_theme_font_size" qualifiers="const">
@ -151,11 +151,11 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="type" type="StringName" default="&quot;&quot;">
<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;">
</argument>
<description>
Returns [code]true[/code] if font size with [code]name[/code] is in [code]type[/code].
Returns [code]false[/code] if the theme does not have [code]type[/code].
Returns [code]true[/code] if font size with [code]name[/code] is in [code]theme_type[/code].
Returns [code]false[/code] if the theme does not have [code]theme_type[/code].
</description>
</method>
<method name="has_theme_icon" qualifiers="const">
@ -163,7 +163,7 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="type" type="StringName" default="&quot;&quot;">
<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;">
</argument>
<description>
</description>
@ -173,7 +173,7 @@
</return>
<argument index="0" name="name" type="StringName">
</argument>
<argument index="1" name="type" type="StringName" default="&quot;&quot;">
<argument index="1" name="theme_type" type="StringName" default="&quot;&quot;">
</argument>
<description>
</description>
@ -340,6 +340,8 @@
</member>
<member name="theme" type="Theme" setter="set_theme" getter="get_theme">
</member>
<member name="theme_custom_type" type="StringName" setter="set_theme_custom_type" getter="get_theme_custom_type" default="@&quot;&quot;">
</member>
<member name="title" type="String" setter="set_title" getter="get_title" default="&quot;&quot;">
</member>
<member name="transient" type="bool" setter="set_transient" getter="is_transient" default="false">

View file

@ -168,6 +168,12 @@ Size2 Control::_edit_get_minimum_size() const {
}
#endif
void Control::accept_event() {
if (is_inside_tree()) {
get_viewport()->_gui_accept_event();
}
}
void Control::set_custom_minimum_size(const Size2 &p_custom) {
if (p_custom == data.custom_minimum_size) {
return;
@ -765,32 +771,27 @@ Size2 Control::get_minimum_size() const {
}
template <class T>
bool Control::_find_theme_item(Control *p_theme_owner, Window *p_theme_owner_window, T &r_ret, T (Theme::*get_func)(const StringName &, const StringName &) const, bool (Theme::*has_func)(const StringName &, const StringName &) const, const StringName &p_name, const StringName &p_node_type) {
// try with custom themes
T Control::get_theme_item_in_types(Control *p_theme_owner, Window *p_theme_owner_window, Theme::DataType p_data_type, const StringName &p_name, List<StringName> p_theme_types) {
ERR_FAIL_COND_V_MSG(p_theme_types.size() == 0, T(), "At least one theme type must be specified.");
// First, look through each control or window node in the branch, until no valid parent can be found.
// For each control iterate through its inheritance chain and see if p_name exists in any of them.
Control *theme_owner = p_theme_owner;
Window *theme_owner_window = p_theme_owner_window;
while (theme_owner || theme_owner_window) {
StringName class_name = p_node_type;
while (class_name != StringName()) {
if (theme_owner && (theme_owner->data.theme.operator->()->*has_func)(p_name, class_name)) {
r_ret = (theme_owner->data.theme.operator->()->*get_func)(p_name, class_name);
return true;
for (List<StringName>::Element *E = p_theme_types.front(); E; E = E->next()) {
if (theme_owner && theme_owner->data.theme->has_theme_item(p_data_type, p_name, E->get())) {
return theme_owner->data.theme->get_theme_item(p_data_type, p_name, E->get());
}
if (theme_owner_window && (theme_owner_window->theme.operator->()->*has_func)(p_name, class_name)) {
r_ret = (theme_owner_window->theme.operator->()->*get_func)(p_name, class_name);
return true;
if (theme_owner_window && theme_owner_window->theme->has_theme_item(p_data_type, p_name, E->get())) {
return theme_owner_window->theme->get_theme_item(p_data_type, p_name, E->get());
}
class_name = ClassDB::get_parent_class_nocheck(class_name);
}
Node *parent = theme_owner ? theme_owner->get_parent() : theme_owner_window->get_parent();
Control *parent_c = Object::cast_to<Control>(parent);
if (parent_c) {
theme_owner = parent_c->data.theme_owner;
theme_owner_window = parent_c->data.theme_owner_window;
@ -805,33 +806,47 @@ bool Control::_find_theme_item(Control *p_theme_owner, Window *p_theme_owner_win
}
}
}
return false;
// Secondly, check the project-defined Theme resource.
if (Theme::get_project_default().is_valid()) {
for (List<StringName>::Element *E = p_theme_types.front(); E; E = E->next()) {
if (Theme::get_project_default()->has_theme_item(p_data_type, p_name, E->get())) {
return Theme::get_project_default()->get_theme_item(p_data_type, p_name, E->get());
}
}
}
// Lastly, fall back on the items defined in the default Theme, if they exist.
for (List<StringName>::Element *E = p_theme_types.front(); E; E = E->next()) {
if (Theme::get_default()->has_theme_item(p_data_type, p_name, E->get())) {
return Theme::get_default()->get_theme_item(p_data_type, p_name, E->get());
}
}
// If they don't exist, use any type to return the default/empty value.
return Theme::get_default()->get_theme_item(p_data_type, p_name, p_theme_types[0]);
}
bool Control::_has_theme_item(Control *p_theme_owner, Window *p_theme_owner_window, bool (Theme::*has_func)(const StringName &, const StringName &) const, const StringName &p_name, const StringName &p_node_type) {
// try with custom themes
bool Control::has_theme_item_in_types(Control *p_theme_owner, Window *p_theme_owner_window, Theme::DataType p_data_type, const StringName &p_name, List<StringName> p_theme_types) {
ERR_FAIL_COND_V_MSG(p_theme_types.size() == 0, false, "At least one theme type must be specified.");
// First, look through each control or window node in the branch, until no valid parent can be found.
// For each control iterate through its inheritance chain and see if p_name exists in any of them.
Control *theme_owner = p_theme_owner;
Window *theme_owner_window = p_theme_owner_window;
while (theme_owner || theme_owner_window) {
StringName class_name = p_node_type;
while (class_name != StringName()) {
if (theme_owner && (theme_owner->data.theme.operator->()->*has_func)(p_name, class_name)) {
for (List<StringName>::Element *E = p_theme_types.front(); E; E = E->next()) {
if (theme_owner && theme_owner->data.theme->has_theme_item(p_data_type, p_name, E->get())) {
return true;
}
if (theme_owner_window && (theme_owner_window->theme.operator->()->*has_func)(p_name, class_name)) {
if (theme_owner_window && theme_owner_window->theme->has_theme_item(p_data_type, p_name, E->get())) {
return true;
}
class_name = ClassDB::get_parent_class_nocheck(class_name);
}
Node *parent = theme_owner ? theme_owner->get_parent() : theme_owner_window->get_parent();
Control *parent_c = Object::cast_to<Control>(parent);
if (parent_c) {
theme_owner = parent_c->data.theme_owner;
theme_owner_window = parent_c->data.theme_owner_window;
@ -846,179 +861,112 @@ bool Control::_has_theme_item(Control *p_theme_owner, Window *p_theme_owner_wind
}
}
}
// Secondly, check the project-defined Theme resource.
if (Theme::get_project_default().is_valid()) {
for (List<StringName>::Element *E = p_theme_types.front(); E; E = E->next()) {
if (Theme::get_project_default()->has_theme_item(p_data_type, p_name, E->get())) {
return true;
}
}
}
// Lastly, fall back on the items defined in the default Theme, if they exist.
for (List<StringName>::Element *E = p_theme_types.front(); E; E = E->next()) {
if (Theme::get_default()->has_theme_item(p_data_type, p_name, E->get())) {
return true;
}
}
return false;
}
Ref<Texture2D> Control::get_theme_icon(const StringName &p_name, const StringName &p_node_type) const {
if (p_node_type == StringName() || p_node_type == get_class_name()) {
void Control::_get_theme_type_dependencies(const StringName &p_theme_type, List<StringName> *p_list) const {
if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == data.theme_custom_type) {
if (data.theme_custom_type != StringName()) {
p_list->push_back(data.theme_custom_type);
}
Theme::get_type_dependencies(get_class_name(), p_list);
} else {
Theme::get_type_dependencies(p_theme_type, p_list);
}
}
Ref<Texture2D> Control::get_theme_icon(const StringName &p_name, const StringName &p_theme_type) const {
if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == data.theme_custom_type) {
const Ref<Texture2D> *tex = data.icon_override.getptr(p_name);
if (tex) {
return *tex;
}
}
StringName type = p_node_type ? p_node_type : get_class_name();
return get_icons(data.theme_owner, data.theme_owner_window, p_name, type);
List<StringName> theme_types;
_get_theme_type_dependencies(p_theme_type, &theme_types);
return get_theme_item_in_types<Ref<Texture2D>>(data.theme_owner, data.theme_owner_window, Theme::DATA_TYPE_ICON, p_name, theme_types);
}
Ref<Texture2D> Control::get_icons(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type) {
Ref<Texture2D> icon;
if (_find_theme_item(p_theme_owner, p_theme_owner_window, icon, &Theme::get_icon, &Theme::has_icon, p_name, p_node_type)) {
return icon;
}
if (Theme::get_project_default().is_valid()) {
if (Theme::get_project_default()->has_icon(p_name, p_node_type)) {
return Theme::get_project_default()->get_icon(p_name, p_node_type);
}
}
return Theme::get_default()->get_icon(p_name, p_node_type);
}
Ref<StyleBox> Control::get_theme_stylebox(const StringName &p_name, const StringName &p_node_type) const {
if (p_node_type == StringName() || p_node_type == get_class_name()) {
Ref<StyleBox> Control::get_theme_stylebox(const StringName &p_name, const StringName &p_theme_type) const {
if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == data.theme_custom_type) {
const Ref<StyleBox> *style = data.style_override.getptr(p_name);
if (style) {
return *style;
}
}
StringName type = p_node_type ? p_node_type : get_class_name();
return get_styleboxs(data.theme_owner, data.theme_owner_window, p_name, type);
List<StringName> theme_types;
_get_theme_type_dependencies(p_theme_type, &theme_types);
return get_theme_item_in_types<Ref<StyleBox>>(data.theme_owner, data.theme_owner_window, Theme::DATA_TYPE_STYLEBOX, p_name, theme_types);
}
Ref<StyleBox> Control::get_styleboxs(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type) {
Ref<StyleBox> stylebox;
if (_find_theme_item(p_theme_owner, p_theme_owner_window, stylebox, &Theme::get_stylebox, &Theme::has_stylebox, p_name, p_node_type)) {
return stylebox;
}
if (Theme::get_project_default().is_valid()) {
if (Theme::get_project_default()->has_stylebox(p_name, p_node_type)) {
return Theme::get_project_default()->get_stylebox(p_name, p_node_type);
}
}
return Theme::get_default()->get_stylebox(p_name, p_node_type);
}
Ref<Font> Control::get_theme_font(const StringName &p_name, const StringName &p_node_type) const {
if (p_node_type == StringName() || p_node_type == get_class_name()) {
Ref<Font> Control::get_theme_font(const StringName &p_name, const StringName &p_theme_type) const {
if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == data.theme_custom_type) {
const Ref<Font> *font = data.font_override.getptr(p_name);
if (font) {
return *font;
}
}
StringName type = p_node_type ? p_node_type : get_class_name();
return get_fonts(data.theme_owner, data.theme_owner_window, p_name, type);
List<StringName> theme_types;
_get_theme_type_dependencies(p_theme_type, &theme_types);
return get_theme_item_in_types<Ref<Font>>(data.theme_owner, data.theme_owner_window, Theme::DATA_TYPE_FONT, p_name, theme_types);
}
int Control::get_theme_font_size(const StringName &p_name, const StringName &p_node_type) const {
if (p_node_type == StringName() || p_node_type == get_class_name()) {
int Control::get_theme_font_size(const StringName &p_name, const StringName &p_theme_type) const {
if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == data.theme_custom_type) {
const int *font_size = data.font_size_override.getptr(p_name);
if (font_size) {
return *font_size;
}
}
StringName type = p_node_type ? p_node_type : get_class_name();
return get_font_sizes(data.theme_owner, data.theme_owner_window, p_name, type);
List<StringName> theme_types;
_get_theme_type_dependencies(p_theme_type, &theme_types);
return get_theme_item_in_types<int>(data.theme_owner, data.theme_owner_window, Theme::DATA_TYPE_FONT_SIZE, p_name, theme_types);
}
Ref<Font> Control::get_fonts(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type) {
Ref<Font> font;
if (_find_theme_item(p_theme_owner, p_theme_owner_window, font, &Theme::get_font, &Theme::has_font, p_name, p_node_type)) {
return font;
}
if (Theme::get_project_default().is_valid()) {
if (Theme::get_project_default()->has_font(p_name, p_node_type)) {
return Theme::get_project_default()->get_font(p_name, p_node_type);
}
}
return Theme::get_default()->get_font(p_name, p_node_type);
}
int Control::get_font_sizes(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type) {
int font_size;
if (_find_theme_item(p_theme_owner, p_theme_owner_window, font_size, &Theme::get_font_size, &Theme::has_font_size, p_name, p_node_type)) {
return font_size;
}
if (Theme::get_project_default().is_valid()) {
if (Theme::get_project_default()->has_font_size(p_name, p_node_type)) {
return Theme::get_project_default()->get_font_size(p_name, p_node_type);
}
}
return Theme::get_default()->get_font_size(p_name, p_node_type);
}
Color Control::get_theme_color(const StringName &p_name, const StringName &p_node_type) const {
if (p_node_type == StringName() || p_node_type == get_class_name()) {
Color Control::get_theme_color(const StringName &p_name, const StringName &p_theme_type) const {
if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == data.theme_custom_type) {
const Color *color = data.color_override.getptr(p_name);
if (color) {
return *color;
}
}
StringName type = p_node_type ? p_node_type : get_class_name();
return get_colors(data.theme_owner, data.theme_owner_window, p_name, type);
List<StringName> theme_types;
_get_theme_type_dependencies(p_theme_type, &theme_types);
return get_theme_item_in_types<Color>(data.theme_owner, data.theme_owner_window, Theme::DATA_TYPE_COLOR, p_name, theme_types);
}
Color Control::get_colors(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type) {
Color color;
if (_find_theme_item(p_theme_owner, p_theme_owner_window, color, &Theme::get_color, &Theme::has_color, p_name, p_node_type)) {
return color;
}
if (Theme::get_project_default().is_valid()) {
if (Theme::get_project_default()->has_color(p_name, p_node_type)) {
return Theme::get_project_default()->get_color(p_name, p_node_type);
}
}
return Theme::get_default()->get_color(p_name, p_node_type);
}
int Control::get_theme_constant(const StringName &p_name, const StringName &p_node_type) const {
if (p_node_type == StringName() || p_node_type == get_class_name()) {
int Control::get_theme_constant(const StringName &p_name, const StringName &p_theme_type) const {
if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == data.theme_custom_type) {
const int *constant = data.constant_override.getptr(p_name);
if (constant) {
return *constant;
}
}
StringName type = p_node_type ? p_node_type : get_class_name();
return get_constants(data.theme_owner, data.theme_owner_window, p_name, type);
}
int Control::get_constants(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type) {
int constant;
if (_find_theme_item(p_theme_owner, p_theme_owner_window, constant, &Theme::get_constant, &Theme::has_constant, p_name, p_node_type)) {
return constant;
}
if (Theme::get_project_default().is_valid()) {
if (Theme::get_project_default()->has_constant(p_name, p_node_type)) {
return Theme::get_project_default()->get_constant(p_name, p_node_type);
}
}
return Theme::get_default()->get_constant(p_name, p_node_type);
List<StringName> theme_types;
_get_theme_type_dependencies(p_theme_type, &theme_types);
return get_theme_item_in_types<int>(data.theme_owner, data.theme_owner_window, Theme::DATA_TYPE_CONSTANT, p_name, theme_types);
}
bool Control::has_theme_icon_override(const StringName &p_name) const {
@ -1051,154 +999,76 @@ bool Control::has_theme_constant_override(const StringName &p_name) const {
return constant != nullptr;
}
bool Control::has_theme_icon(const StringName &p_name, const StringName &p_node_type) const {
if (p_node_type == StringName() || p_node_type == get_class_name()) {
bool Control::has_theme_icon(const StringName &p_name, const StringName &p_theme_type) const {
if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == data.theme_custom_type) {
if (has_theme_icon_override(p_name)) {
return true;
}
}
StringName type = p_node_type ? p_node_type : get_class_name();
return has_icons(data.theme_owner, data.theme_owner_window, p_name, type);
List<StringName> theme_types;
_get_theme_type_dependencies(p_theme_type, &theme_types);
return has_theme_item_in_types(data.theme_owner, data.theme_owner_window, Theme::DATA_TYPE_ICON, p_name, theme_types);
}
bool Control::has_icons(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type) {
if (_has_theme_item(p_theme_owner, p_theme_owner_window, &Theme::has_icon, p_name, p_node_type)) {
return true;
}
if (Theme::get_project_default().is_valid()) {
if (Theme::get_project_default()->has_color(p_name, p_node_type)) {
return true;
}
}
return Theme::get_default()->has_icon(p_name, p_node_type);
}
bool Control::has_theme_stylebox(const StringName &p_name, const StringName &p_node_type) const {
if (p_node_type == StringName() || p_node_type == get_class_name()) {
bool Control::has_theme_stylebox(const StringName &p_name, const StringName &p_theme_type) const {
if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == data.theme_custom_type) {
if (has_theme_stylebox_override(p_name)) {
return true;
}
}
StringName type = p_node_type ? p_node_type : get_class_name();
return has_styleboxs(data.theme_owner, data.theme_owner_window, p_name, type);
List<StringName> theme_types;
_get_theme_type_dependencies(p_theme_type, &theme_types);
return has_theme_item_in_types(data.theme_owner, data.theme_owner_window, Theme::DATA_TYPE_STYLEBOX, p_name, theme_types);
}
bool Control::has_styleboxs(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type) {
if (_has_theme_item(p_theme_owner, p_theme_owner_window, &Theme::has_stylebox, p_name, p_node_type)) {
return true;
}
if (Theme::get_project_default().is_valid()) {
if (Theme::get_project_default()->has_stylebox(p_name, p_node_type)) {
return true;
}
}
return Theme::get_default()->has_stylebox(p_name, p_node_type);
}
bool Control::has_theme_font(const StringName &p_name, const StringName &p_node_type) const {
if (p_node_type == StringName() || p_node_type == get_class_name()) {
bool Control::has_theme_font(const StringName &p_name, const StringName &p_theme_type) const {
if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == data.theme_custom_type) {
if (has_theme_font_override(p_name)) {
return true;
}
}
StringName type = p_node_type ? p_node_type : get_class_name();
return has_fonts(data.theme_owner, data.theme_owner_window, p_name, type);
List<StringName> theme_types;
_get_theme_type_dependencies(p_theme_type, &theme_types);
return has_theme_item_in_types(data.theme_owner, data.theme_owner_window, Theme::DATA_TYPE_FONT, p_name, theme_types);
}
bool Control::has_fonts(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type) {
if (_has_theme_item(p_theme_owner, p_theme_owner_window, &Theme::has_font, p_name, p_node_type)) {
return true;
}
if (Theme::get_project_default().is_valid()) {
if (Theme::get_project_default()->has_font(p_name, p_node_type)) {
return true;
}
}
return Theme::get_default()->has_font(p_name, p_node_type);
}
bool Control::has_theme_font_size(const StringName &p_name, const StringName &p_node_type) const {
if (p_node_type == StringName() || p_node_type == get_class_name()) {
bool Control::has_theme_font_size(const StringName &p_name, const StringName &p_theme_type) const {
if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == data.theme_custom_type) {
if (has_theme_font_size_override(p_name)) {
return true;
}
}
StringName type = p_node_type ? p_node_type : get_class_name();
return has_font_sizes(data.theme_owner, data.theme_owner_window, p_name, type);
List<StringName> theme_types;
_get_theme_type_dependencies(p_theme_type, &theme_types);
return has_theme_item_in_types(data.theme_owner, data.theme_owner_window, Theme::DATA_TYPE_FONT_SIZE, p_name, theme_types);
}
bool Control::has_font_sizes(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type) {
if (_has_theme_item(p_theme_owner, p_theme_owner_window, &Theme::has_font_size, p_name, p_node_type)) {
return true;
}
if (Theme::get_project_default().is_valid()) {
if (Theme::get_project_default()->has_font_size(p_name, p_node_type)) {
return true;
}
}
return Theme::get_default()->has_font_size(p_name, p_node_type);
}
bool Control::has_theme_color(const StringName &p_name, const StringName &p_node_type) const {
if (p_node_type == StringName() || p_node_type == get_class_name()) {
bool Control::has_theme_color(const StringName &p_name, const StringName &p_theme_type) const {
if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == data.theme_custom_type) {
if (has_theme_color_override(p_name)) {
return true;
}
}
StringName type = p_node_type ? p_node_type : get_class_name();
return has_colors(data.theme_owner, data.theme_owner_window, p_name, type);
List<StringName> theme_types;
_get_theme_type_dependencies(p_theme_type, &theme_types);
return has_theme_item_in_types(data.theme_owner, data.theme_owner_window, Theme::DATA_TYPE_COLOR, p_name, theme_types);
}
bool Control::has_colors(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type) {
if (_has_theme_item(p_theme_owner, p_theme_owner_window, &Theme::has_color, p_name, p_node_type)) {
return true;
}
if (Theme::get_project_default().is_valid()) {
if (Theme::get_project_default()->has_color(p_name, p_node_type)) {
return true;
}
}
return Theme::get_default()->has_color(p_name, p_node_type);
}
bool Control::has_theme_constant(const StringName &p_name, const StringName &p_node_type) const {
if (p_node_type == StringName() || p_node_type == get_class_name()) {
bool Control::has_theme_constant(const StringName &p_name, const StringName &p_theme_type) const {
if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == data.theme_custom_type) {
if (has_theme_constant_override(p_name)) {
return true;
}
}
StringName type = p_node_type ? p_node_type : get_class_name();
return has_constants(data.theme_owner, data.theme_owner_window, p_name, p_node_type);
}
bool Control::has_constants(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type) {
if (_has_theme_item(p_theme_owner, p_theme_owner_window, &Theme::has_constant, p_name, p_node_type)) {
return true;
}
if (Theme::get_project_default().is_valid()) {
if (Theme::get_project_default()->has_constant(p_name, p_node_type)) {
return true;
}
}
return Theme::get_default()->has_constant(p_name, p_node_type);
List<StringName> theme_types;
_get_theme_type_dependencies(p_theme_type, &theme_types);
return has_theme_item_in_types(data.theme_owner, data.theme_owner_window, Theme::DATA_TYPE_CONSTANT, p_name, theme_types);
}
Rect2 Control::get_parent_anchorable_rect() const {
@ -2171,16 +2041,19 @@ void Control::set_theme(const Ref<Theme> &p_theme) {
}
}
void Control::accept_event() {
if (is_inside_tree()) {
get_viewport()->_gui_accept_event();
}
}
Ref<Theme> Control::get_theme() const {
return data.theme;
}
void Control::set_theme_custom_type(const StringName &p_theme_type) {
data.theme_custom_type = p_theme_type;
_propagate_theme_changed(this, data.theme_owner, data.theme_owner_window);
}
StringName Control::get_theme_custom_type() const {
return data.theme_custom_type;
}
void Control::set_tooltip(const String &p_tooltip) {
data.tooltip = p_tooltip;
update_configuration_warnings();
@ -2499,9 +2372,9 @@ bool Control::is_text_field() const {
return false;
}
Vector<Vector2i> Control::structured_text_parser(StructuredTextParser p_node_type, const Array &p_args, const String p_text) const {
Vector<Vector2i> Control::structured_text_parser(StructuredTextParser p_theme_type, const Array &p_args, const String p_text) const {
Vector<Vector2i> ret;
switch (p_node_type) {
switch (p_theme_type) {
case STRUCTURED_TEXT_URI: {
int prev = 0;
for (int i = 0; i < p_text.length(); i++) {
@ -2811,6 +2684,9 @@ void Control::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_theme", "theme"), &Control::set_theme);
ClassDB::bind_method(D_METHOD("get_theme"), &Control::get_theme);
ClassDB::bind_method(D_METHOD("set_theme_custom_type", "theme_type"), &Control::set_theme_custom_type);
ClassDB::bind_method(D_METHOD("get_theme_custom_type"), &Control::get_theme_custom_type);
ClassDB::bind_method(D_METHOD("add_theme_icon_override", "name", "texture"), &Control::add_theme_icon_override);
ClassDB::bind_method(D_METHOD("add_theme_stylebox_override", "name", "stylebox"), &Control::add_theme_style_override);
ClassDB::bind_method(D_METHOD("add_theme_font_override", "name", "font"), &Control::add_theme_font_override);
@ -2825,12 +2701,12 @@ void Control::_bind_methods() {
ClassDB::bind_method(D_METHOD("remove_theme_color_override", "name"), &Control::remove_theme_color_override);
ClassDB::bind_method(D_METHOD("remove_theme_constant_override", "name"), &Control::remove_theme_constant_override);
ClassDB::bind_method(D_METHOD("get_theme_icon", "name", "node_type"), &Control::get_theme_icon, DEFVAL(""));
ClassDB::bind_method(D_METHOD("get_theme_stylebox", "name", "node_type"), &Control::get_theme_stylebox, DEFVAL(""));
ClassDB::bind_method(D_METHOD("get_theme_font", "name", "node_type"), &Control::get_theme_font, DEFVAL(""));
ClassDB::bind_method(D_METHOD("get_theme_font_size", "name", "node_type"), &Control::get_theme_font_size, DEFVAL(""));
ClassDB::bind_method(D_METHOD("get_theme_color", "name", "node_type"), &Control::get_theme_color, DEFVAL(""));
ClassDB::bind_method(D_METHOD("get_theme_constant", "name", "node_type"), &Control::get_theme_constant, DEFVAL(""));
ClassDB::bind_method(D_METHOD("get_theme_icon", "name", "theme_type"), &Control::get_theme_icon, DEFVAL(""));
ClassDB::bind_method(D_METHOD("get_theme_stylebox", "name", "theme_type"), &Control::get_theme_stylebox, DEFVAL(""));
ClassDB::bind_method(D_METHOD("get_theme_font", "name", "theme_type"), &Control::get_theme_font, DEFVAL(""));
ClassDB::bind_method(D_METHOD("get_theme_font_size", "name", "theme_type"), &Control::get_theme_font_size, DEFVAL(""));
ClassDB::bind_method(D_METHOD("get_theme_color", "name", "theme_type"), &Control::get_theme_color, DEFVAL(""));
ClassDB::bind_method(D_METHOD("get_theme_constant", "name", "theme_type"), &Control::get_theme_constant, DEFVAL(""));
ClassDB::bind_method(D_METHOD("has_theme_icon_override", "name"), &Control::has_theme_icon_override);
ClassDB::bind_method(D_METHOD("has_theme_stylebox_override", "name"), &Control::has_theme_stylebox_override);
@ -2839,12 +2715,12 @@ void Control::_bind_methods() {
ClassDB::bind_method(D_METHOD("has_theme_color_override", "name"), &Control::has_theme_color_override);
ClassDB::bind_method(D_METHOD("has_theme_constant_override", "name"), &Control::has_theme_constant_override);
ClassDB::bind_method(D_METHOD("has_theme_icon", "name", "node_type"), &Control::has_theme_icon, DEFVAL(""));
ClassDB::bind_method(D_METHOD("has_theme_stylebox", "name", "node_type"), &Control::has_theme_stylebox, DEFVAL(""));
ClassDB::bind_method(D_METHOD("has_theme_font", "name", "node_type"), &Control::has_theme_font, DEFVAL(""));
ClassDB::bind_method(D_METHOD("has_theme_font_size", "name", "node_type"), &Control::has_theme_font_size, DEFVAL(""));
ClassDB::bind_method(D_METHOD("has_theme_color", "name", "node_type"), &Control::has_theme_color, DEFVAL(""));
ClassDB::bind_method(D_METHOD("has_theme_constant", "name", "node_type"), &Control::has_theme_constant, DEFVAL(""));
ClassDB::bind_method(D_METHOD("has_theme_icon", "name", "theme_type"), &Control::has_theme_icon, DEFVAL(""));
ClassDB::bind_method(D_METHOD("has_theme_stylebox", "name", "theme_type"), &Control::has_theme_stylebox, DEFVAL(""));
ClassDB::bind_method(D_METHOD("has_theme_font", "name", "theme_type"), &Control::has_theme_font, DEFVAL(""));
ClassDB::bind_method(D_METHOD("has_theme_font_size", "name", "theme_type"), &Control::has_theme_font_size, DEFVAL(""));
ClassDB::bind_method(D_METHOD("has_theme_color", "name", "theme_type"), &Control::has_theme_color, DEFVAL(""));
ClassDB::bind_method(D_METHOD("has_theme_constant", "name", "theme_type"), &Control::has_theme_constant, DEFVAL(""));
ClassDB::bind_method(D_METHOD("get_parent_control"), &Control::get_parent_control);
@ -2958,8 +2834,9 @@ void Control::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "size_flags_horizontal", PROPERTY_HINT_FLAGS, "Fill,Expand,Shrink Center,Shrink End"), "set_h_size_flags", "get_h_size_flags");
ADD_PROPERTY(PropertyInfo(Variant::INT, "size_flags_vertical", PROPERTY_HINT_FLAGS, "Fill,Expand,Shrink Center,Shrink End"), "set_v_size_flags", "get_v_size_flags");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "size_flags_stretch_ratio", PROPERTY_HINT_RANGE, "0,20,0.01,or_greater"), "set_stretch_ratio", "get_stretch_ratio");
ADD_GROUP("Theme", "");
ADD_GROUP("Theme", "theme_");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "theme", PROPERTY_HINT_RESOURCE_TYPE, "Theme"), "set_theme", "get_theme");
ADD_PROPERTY(PropertyInfo(Variant::STRING, "theme_custom_type"), "set_theme_custom_type", "get_theme_custom_type");
ADD_GROUP("", "");
BIND_ENUM_CONSTANT(FOCUS_NONE);

View file

@ -201,6 +201,8 @@ private:
Ref<Theme> theme;
Control *theme_owner = nullptr;
Window *theme_owner_window = nullptr;
StringName theme_custom_type;
String tooltip;
CursorShape default_cursor = CURSOR_ARROW;
@ -258,23 +260,9 @@ private:
static void _propagate_theme_changed(Node *p_at, Control *p_owner, Window *p_owner_window, bool p_assign = true);
template <class T>
_FORCE_INLINE_ static bool _find_theme_item(Control *p_theme_owner, Window *p_theme_owner_window, T &, T (Theme::*get_func)(const StringName &, const StringName &) const, bool (Theme::*has_func)(const StringName &, const StringName &) const, const StringName &p_name, const StringName &p_node_type);
_FORCE_INLINE_ static bool _has_theme_item(Control *p_theme_owner, Window *p_theme_owner_window, bool (Theme::*has_func)(const StringName &, const StringName &) const, const StringName &p_name, const StringName &p_node_type);
static Ref<Texture2D> get_icons(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type = StringName());
static Ref<StyleBox> get_styleboxs(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type = StringName());
static Ref<Font> get_fonts(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type = StringName());
static int get_font_sizes(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type = StringName());
static Color get_colors(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type = StringName());
static int get_constants(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type = StringName());
static bool has_icons(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type = StringName());
static bool has_styleboxs(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type = StringName());
static bool has_fonts(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type = StringName());
static bool has_font_sizes(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type = StringName());
static bool has_colors(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type = StringName());
static bool has_constants(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type = StringName());
static T get_theme_item_in_types(Control *p_theme_owner, Window *p_theme_owner_window, Theme::DataType p_data_type, const StringName &p_name, List<StringName> p_theme_types);
static bool has_theme_item_in_types(Control *p_theme_owner, Window *p_theme_owner_window, Theme::DataType p_data_type, const StringName &p_name, List<StringName> p_theme_types);
_FORCE_INLINE_ void _get_theme_type_dependencies(const StringName &p_theme_type, List<StringName> *p_list) const;
protected:
virtual void add_child_notify(Node *p_child) override;
@ -282,7 +270,7 @@ protected:
//virtual void _window_gui_input(InputEvent p_event);
virtual Vector<Vector2i> structured_text_parser(StructuredTextParser p_node_type, const Array &p_args, const String p_text) const;
virtual Vector<Vector2i> structured_text_parser(StructuredTextParser p_theme_type, const Array &p_args, const String p_text) const;
bool _set(const StringName &p_name, const Variant &p_value);
bool _get(const StringName &p_name, Variant &r_ret) const;
@ -415,6 +403,9 @@ public:
void set_theme(const Ref<Theme> &p_theme);
Ref<Theme> get_theme() const;
void set_theme_custom_type(const StringName &p_theme_type);
StringName get_theme_custom_type() const;
void set_h_size_flags(int p_flags);
int get_h_size_flags() const;
@ -466,12 +457,12 @@ public:
void remove_theme_color_override(const StringName &p_name);
void remove_theme_constant_override(const StringName &p_name);
Ref<Texture2D> get_theme_icon(const StringName &p_name, const StringName &p_node_type = StringName()) const;
Ref<StyleBox> get_theme_stylebox(const StringName &p_name, const StringName &p_node_type = StringName()) const;
Ref<Font> get_theme_font(const StringName &p_name, const StringName &p_node_type = StringName()) const;
int get_theme_font_size(const StringName &p_name, const StringName &p_node_type = StringName()) const;
Color get_theme_color(const StringName &p_name, const StringName &p_node_type = StringName()) const;
int get_theme_constant(const StringName &p_name, const StringName &p_node_type = StringName()) const;
Ref<Texture2D> get_theme_icon(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
Ref<StyleBox> get_theme_stylebox(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
Ref<Font> get_theme_font(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
int get_theme_font_size(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
Color get_theme_color(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
int get_theme_constant(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
bool has_theme_icon_override(const StringName &p_name) const;
bool has_theme_stylebox_override(const StringName &p_name) const;
@ -480,12 +471,12 @@ public:
bool has_theme_color_override(const StringName &p_name) const;
bool has_theme_constant_override(const StringName &p_name) const;
bool has_theme_icon(const StringName &p_name, const StringName &p_node_type = StringName()) const;
bool has_theme_stylebox(const StringName &p_name, const StringName &p_node_type = StringName()) const;
bool has_theme_font(const StringName &p_name, const StringName &p_node_type = StringName()) const;
bool has_theme_font_size(const StringName &p_name, const StringName &p_node_type = StringName()) const;
bool has_theme_color(const StringName &p_name, const StringName &p_node_type = StringName()) const;
bool has_theme_constant(const StringName &p_name, const StringName &p_node_type = StringName()) const;
bool has_theme_icon(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
bool has_theme_stylebox(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
bool has_theme_font(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
bool has_theme_font_size(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
bool has_theme_color(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
bool has_theme_constant(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
/* TOOLTIP */

View file

@ -1169,64 +1169,96 @@ Ref<Theme> Window::get_theme() const {
return theme;
}
Ref<Texture2D> Window::get_theme_icon(const StringName &p_name, const StringName &p_type) const {
StringName type = p_type ? p_type : get_class_name();
return Control::get_icons(theme_owner, theme_owner_window, p_name, type);
void Window::set_theme_custom_type(const StringName &p_theme_type) {
theme_custom_type = p_theme_type;
Control::_propagate_theme_changed(this, theme_owner, theme_owner_window);
}
Ref<StyleBox> Window::get_theme_stylebox(const StringName &p_name, const StringName &p_type) const {
StringName type = p_type ? p_type : get_class_name();
return Control::get_styleboxs(theme_owner, theme_owner_window, p_name, type);
StringName Window::get_theme_custom_type() const {
return theme_custom_type;
}
Ref<Font> Window::get_theme_font(const StringName &p_name, const StringName &p_type) const {
StringName type = p_type ? p_type : get_class_name();
return Control::get_fonts(theme_owner, theme_owner_window, p_name, type);
void Window::_get_theme_type_dependencies(const StringName &p_theme_type, List<StringName> *p_list) const {
if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == theme_custom_type) {
if (theme_custom_type != StringName()) {
p_list->push_back(theme_custom_type);
}
Theme::get_type_dependencies(get_class_name(), p_list);
} else {
Theme::get_type_dependencies(p_theme_type, p_list);
}
}
int Window::get_theme_font_size(const StringName &p_name, const StringName &p_type) const {
StringName type = p_type ? p_type : get_class_name();
return Control::get_font_sizes(theme_owner, theme_owner_window, p_name, type);
Ref<Texture2D> Window::get_theme_icon(const StringName &p_name, const StringName &p_theme_type) const {
List<StringName> theme_types;
_get_theme_type_dependencies(p_theme_type, &theme_types);
return Control::get_theme_item_in_types<Ref<Texture2D>>(theme_owner, theme_owner_window, Theme::DATA_TYPE_ICON, p_name, theme_types);
}
Color Window::get_theme_color(const StringName &p_name, const StringName &p_type) const {
StringName type = p_type ? p_type : get_class_name();
return Control::get_colors(theme_owner, theme_owner_window, p_name, type);
Ref<StyleBox> Window::get_theme_stylebox(const StringName &p_name, const StringName &p_theme_type) const {
List<StringName> theme_types;
_get_theme_type_dependencies(p_theme_type, &theme_types);
return Control::get_theme_item_in_types<Ref<StyleBox>>(theme_owner, theme_owner_window, Theme::DATA_TYPE_STYLEBOX, p_name, theme_types);
}
int Window::get_theme_constant(const StringName &p_name, const StringName &p_type) const {
StringName type = p_type ? p_type : get_class_name();
return Control::get_constants(theme_owner, theme_owner_window, p_name, type);
Ref<Font> Window::get_theme_font(const StringName &p_name, const StringName &p_theme_type) const {
List<StringName> theme_types;
_get_theme_type_dependencies(p_theme_type, &theme_types);
return Control::get_theme_item_in_types<Ref<Font>>(theme_owner, theme_owner_window, Theme::DATA_TYPE_FONT, p_name, theme_types);
}
bool Window::has_theme_icon(const StringName &p_name, const StringName &p_type) const {
StringName type = p_type ? p_type : get_class_name();
return Control::has_icons(theme_owner, theme_owner_window, p_name, type);
int Window::get_theme_font_size(const StringName &p_name, const StringName &p_theme_type) const {
List<StringName> theme_types;
_get_theme_type_dependencies(p_theme_type, &theme_types);
return Control::get_theme_item_in_types<int>(theme_owner, theme_owner_window, Theme::DATA_TYPE_FONT_SIZE, p_name, theme_types);
}
bool Window::has_theme_stylebox(const StringName &p_name, const StringName &p_type) const {
StringName type = p_type ? p_type : get_class_name();
return Control::has_styleboxs(theme_owner, theme_owner_window, p_name, type);
Color Window::get_theme_color(const StringName &p_name, const StringName &p_theme_type) const {
List<StringName> theme_types;
_get_theme_type_dependencies(p_theme_type, &theme_types);
return Control::get_theme_item_in_types<Color>(theme_owner, theme_owner_window, Theme::DATA_TYPE_COLOR, p_name, theme_types);
}
bool Window::has_theme_font(const StringName &p_name, const StringName &p_type) const {
StringName type = p_type ? p_type : get_class_name();
return Control::has_fonts(theme_owner, theme_owner_window, p_name, type);
int Window::get_theme_constant(const StringName &p_name, const StringName &p_theme_type) const {
List<StringName> theme_types;
_get_theme_type_dependencies(p_theme_type, &theme_types);
return Control::get_theme_item_in_types<int>(theme_owner, theme_owner_window, Theme::DATA_TYPE_CONSTANT, p_name, theme_types);
}
bool Window::has_theme_font_size(const StringName &p_name, const StringName &p_type) const {
StringName type = p_type ? p_type : get_class_name();
return Control::has_font_sizes(theme_owner, theme_owner_window, p_name, type);
bool Window::has_theme_icon(const StringName &p_name, const StringName &p_theme_type) const {
List<StringName> theme_types;
_get_theme_type_dependencies(p_theme_type, &theme_types);
return Control::has_theme_item_in_types(theme_owner, theme_owner_window, Theme::DATA_TYPE_ICON, p_name, theme_types);
}
bool Window::has_theme_color(const StringName &p_name, const StringName &p_type) const {
StringName type = p_type ? p_type : get_class_name();
return Control::has_colors(theme_owner, theme_owner_window, p_name, type);
bool Window::has_theme_stylebox(const StringName &p_name, const StringName &p_theme_type) const {
List<StringName> theme_types;
_get_theme_type_dependencies(p_theme_type, &theme_types);
return Control::has_theme_item_in_types(theme_owner, theme_owner_window, Theme::DATA_TYPE_STYLEBOX, p_name, theme_types);
}
bool Window::has_theme_constant(const StringName &p_name, const StringName &p_type) const {
StringName type = p_type ? p_type : get_class_name();
return Control::has_constants(theme_owner, theme_owner_window, p_name, type);
bool Window::has_theme_font(const StringName &p_name, const StringName &p_theme_type) const {
List<StringName> theme_types;
_get_theme_type_dependencies(p_theme_type, &theme_types);
return Control::has_theme_item_in_types(theme_owner, theme_owner_window, Theme::DATA_TYPE_FONT, p_name, theme_types);
}
bool Window::has_theme_font_size(const StringName &p_name, const StringName &p_theme_type) const {
List<StringName> theme_types;
_get_theme_type_dependencies(p_theme_type, &theme_types);
return Control::has_theme_item_in_types(theme_owner, theme_owner_window, Theme::DATA_TYPE_FONT_SIZE, p_name, theme_types);
}
bool Window::has_theme_color(const StringName &p_name, const StringName &p_theme_type) const {
List<StringName> theme_types;
_get_theme_type_dependencies(p_theme_type, &theme_types);
return Control::has_theme_item_in_types(theme_owner, theme_owner_window, Theme::DATA_TYPE_COLOR, p_name, theme_types);
}
bool Window::has_theme_constant(const StringName &p_name, const StringName &p_theme_type) const {
List<StringName> theme_types;
_get_theme_type_dependencies(p_theme_type, &theme_types);
return Control::has_theme_item_in_types(theme_owner, theme_owner_window, Theme::DATA_TYPE_CONSTANT, p_name, theme_types);
}
Rect2i Window::get_parent_rect() const {
@ -1382,19 +1414,22 @@ void Window::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_theme", "theme"), &Window::set_theme);
ClassDB::bind_method(D_METHOD("get_theme"), &Window::get_theme);
ClassDB::bind_method(D_METHOD("get_theme_icon", "name", "type"), &Window::get_theme_icon, DEFVAL(""));
ClassDB::bind_method(D_METHOD("get_theme_stylebox", "name", "type"), &Window::get_theme_stylebox, DEFVAL(""));
ClassDB::bind_method(D_METHOD("get_theme_font", "name", "type"), &Window::get_theme_font, DEFVAL(""));
ClassDB::bind_method(D_METHOD("get_theme_font_size", "name", "type"), &Window::get_theme_font_size, DEFVAL(""));
ClassDB::bind_method(D_METHOD("get_theme_color", "name", "type"), &Window::get_theme_color, DEFVAL(""));
ClassDB::bind_method(D_METHOD("get_theme_constant", "name", "type"), &Window::get_theme_constant, DEFVAL(""));
ClassDB::bind_method(D_METHOD("set_theme_custom_type", "theme_type"), &Window::set_theme_custom_type);
ClassDB::bind_method(D_METHOD("get_theme_custom_type"), &Window::get_theme_custom_type);
ClassDB::bind_method(D_METHOD("has_theme_icon", "name", "type"), &Window::has_theme_icon, DEFVAL(""));
ClassDB::bind_method(D_METHOD("has_theme_stylebox", "name", "type"), &Window::has_theme_stylebox, DEFVAL(""));
ClassDB::bind_method(D_METHOD("has_theme_font", "name", "type"), &Window::has_theme_font, DEFVAL(""));
ClassDB::bind_method(D_METHOD("has_theme_font_size", "name", "type"), &Window::has_theme_font_size, DEFVAL(""));
ClassDB::bind_method(D_METHOD("has_theme_color", "name", "type"), &Window::has_theme_color, DEFVAL(""));
ClassDB::bind_method(D_METHOD("has_theme_constant", "name", "type"), &Window::has_theme_constant, DEFVAL(""));
ClassDB::bind_method(D_METHOD("get_theme_icon", "name", "theme_type"), &Window::get_theme_icon, DEFVAL(""));
ClassDB::bind_method(D_METHOD("get_theme_stylebox", "name", "theme_type"), &Window::get_theme_stylebox, DEFVAL(""));
ClassDB::bind_method(D_METHOD("get_theme_font", "name", "theme_type"), &Window::get_theme_font, DEFVAL(""));
ClassDB::bind_method(D_METHOD("get_theme_font_size", "name", "theme_type"), &Window::get_theme_font_size, DEFVAL(""));
ClassDB::bind_method(D_METHOD("get_theme_color", "name", "theme_type"), &Window::get_theme_color, DEFVAL(""));
ClassDB::bind_method(D_METHOD("get_theme_constant", "name", "theme_type"), &Window::get_theme_constant, DEFVAL(""));
ClassDB::bind_method(D_METHOD("has_theme_icon", "name", "theme_type"), &Window::has_theme_icon, DEFVAL(""));
ClassDB::bind_method(D_METHOD("has_theme_stylebox", "name", "theme_type"), &Window::has_theme_stylebox, DEFVAL(""));
ClassDB::bind_method(D_METHOD("has_theme_font", "name", "theme_type"), &Window::has_theme_font, DEFVAL(""));
ClassDB::bind_method(D_METHOD("has_theme_font_size", "name", "theme_type"), &Window::has_theme_font_size, DEFVAL(""));
ClassDB::bind_method(D_METHOD("has_theme_color", "name", "theme_type"), &Window::has_theme_color, DEFVAL(""));
ClassDB::bind_method(D_METHOD("has_theme_constant", "name", "theme_type"), &Window::has_theme_constant, DEFVAL(""));
ClassDB::bind_method(D_METHOD("set_layout_direction", "direction"), &Window::set_layout_direction);
ClassDB::bind_method(D_METHOD("get_layout_direction"), &Window::get_layout_direction);
@ -1428,8 +1463,9 @@ void Window::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2I, "content_scale_size"), "set_content_scale_size", "get_content_scale_size");
ADD_PROPERTY(PropertyInfo(Variant::INT, "content_scale_mode", PROPERTY_HINT_ENUM, "Disabled,CanvasItems,Viewport"), "set_content_scale_mode", "get_content_scale_mode");
ADD_PROPERTY(PropertyInfo(Variant::INT, "content_scale_aspect", PROPERTY_HINT_ENUM, "Ignore,Keep,KeepWidth,KeepHeight,Expand"), "set_content_scale_aspect", "get_content_scale_aspect");
ADD_GROUP("Theme", "");
ADD_GROUP("Theme", "theme_");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "theme", PROPERTY_HINT_RESOURCE_TYPE, "Theme"), "set_theme", "get_theme");
ADD_PROPERTY(PropertyInfo(Variant::STRING, "theme_custom_type"), "set_theme_custom_type", "get_theme_custom_type");
ADD_SIGNAL(MethodInfo("window_input", PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent")));
ADD_SIGNAL(MethodInfo("files_dropped", PropertyInfo(Variant::PACKED_STRING_ARRAY, "files")));

View file

@ -130,6 +130,7 @@ private:
Ref<Theme> theme;
Control *theme_owner = nullptr;
Window *theme_owner_window = nullptr;
StringName theme_custom_type;
Viewport *embedder = nullptr;
@ -241,6 +242,10 @@ public:
void set_theme(const Ref<Theme> &p_theme);
Ref<Theme> get_theme() const;
void set_theme_custom_type(const StringName &p_theme_type);
StringName get_theme_custom_type() const;
_FORCE_INLINE_ void _get_theme_type_dependencies(const StringName &p_theme_type, List<StringName> *p_list) const;
Size2 get_contents_minimum_size() const;
void grab_focus();
@ -252,19 +257,19 @@ public:
Rect2i get_usable_parent_rect() const;
Ref<Texture2D> get_theme_icon(const StringName &p_name, const StringName &p_type = StringName()) const;
Ref<StyleBox> get_theme_stylebox(const StringName &p_name, const StringName &p_type = StringName()) const;
Ref<Font> get_theme_font(const StringName &p_name, const StringName &p_type = StringName()) const;
int get_theme_font_size(const StringName &p_name, const StringName &p_type = StringName()) const;
Color get_theme_color(const StringName &p_name, const StringName &p_type = StringName()) const;
int get_theme_constant(const StringName &p_name, const StringName &p_type = StringName()) const;
Ref<Texture2D> get_theme_icon(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
Ref<StyleBox> get_theme_stylebox(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
Ref<Font> get_theme_font(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
int get_theme_font_size(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
Color get_theme_color(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
int get_theme_constant(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
bool has_theme_icon(const StringName &p_name, const StringName &p_type = StringName()) const;
bool has_theme_stylebox(const StringName &p_name, const StringName &p_type = StringName()) const;
bool has_theme_font(const StringName &p_name, const StringName &p_type = StringName()) const;
bool has_theme_font_size(const StringName &p_name, const StringName &p_type = StringName()) const;
bool has_theme_color(const StringName &p_name, const StringName &p_type = StringName()) const;
bool has_theme_constant(const StringName &p_name, const StringName &p_type = StringName()) const;
bool has_theme_icon(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
bool has_theme_stylebox(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
bool has_theme_font(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
bool has_theme_font_size(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
bool has_theme_color(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
bool has_theme_constant(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
Rect2i get_parent_rect() const;
virtual DisplayServer::WindowID get_window_id() const override;

File diff suppressed because it is too large Load diff

View file

@ -62,20 +62,20 @@ private:
HashMap<StringName, HashMap<StringName, Color>> color_map;
HashMap<StringName, HashMap<StringName, int>> constant_map;
Vector<String> _get_icon_list(const String &p_node_type) const;
Vector<String> _get_icon_list(const String &p_theme_type) const;
Vector<String> _get_icon_type_list() const;
Vector<String> _get_stylebox_list(const String &p_node_type) const;
Vector<String> _get_stylebox_list(const String &p_theme_type) const;
Vector<String> _get_stylebox_type_list() const;
Vector<String> _get_font_list(const String &p_node_type) const;
Vector<String> _get_font_list(const String &p_theme_type) const;
Vector<String> _get_font_type_list() const;
Vector<String> _get_font_size_list(const String &p_node_type) const;
Vector<String> _get_font_size_list(const String &p_theme_type) const;
Vector<String> _get_font_size_type_list() const;
Vector<String> _get_color_list(const String &p_node_type) const;
Vector<String> _get_color_list(const String &p_theme_type) const;
Vector<String> _get_color_type_list() const;
Vector<String> _get_constant_list(const String &p_node_type) const;
Vector<String> _get_constant_list(const String &p_theme_type) const;
Vector<String> _get_constant_type_list() const;
Vector<String> _get_theme_item_list(DataType p_data_type, const String &p_node_type) const;
Vector<String> _get_theme_item_list(DataType p_data_type, const String &p_theme_type) const;
Vector<String> _get_theme_item_type_list(DataType p_data_type) const;
Vector<String> _get_type_list() const;
@ -116,77 +116,78 @@ public:
void set_default_theme_font_size(int p_font_size);
int get_default_theme_font_size() const;
void set_icon(const StringName &p_name, const StringName &p_node_type, const Ref<Texture2D> &p_icon);
Ref<Texture2D> get_icon(const StringName &p_name, const StringName &p_node_type) const;
bool has_icon(const StringName &p_name, const StringName &p_node_type) const;
bool has_icon_nocheck(const StringName &p_name, const StringName &p_node_type) const;
void rename_icon(const StringName &p_old_name, const StringName &p_name, const StringName &p_node_type);
void clear_icon(const StringName &p_name, const StringName &p_node_type);
void get_icon_list(StringName p_node_type, List<StringName> *p_list) const;
void add_icon_type(const StringName &p_node_type);
void set_icon(const StringName &p_name, const StringName &p_theme_type, const Ref<Texture2D> &p_icon);
Ref<Texture2D> get_icon(const StringName &p_name, const StringName &p_theme_type) const;
bool has_icon(const StringName &p_name, const StringName &p_theme_type) const;
bool has_icon_nocheck(const StringName &p_name, const StringName &p_theme_type) const;
void rename_icon(const StringName &p_old_name, const StringName &p_name, const StringName &p_theme_type);
void clear_icon(const StringName &p_name, const StringName &p_theme_type);
void get_icon_list(StringName p_theme_type, List<StringName> *p_list) const;
void add_icon_type(const StringName &p_theme_type);
void get_icon_type_list(List<StringName> *p_list) const;
void set_stylebox(const StringName &p_name, const StringName &p_node_type, const Ref<StyleBox> &p_style);
Ref<StyleBox> get_stylebox(const StringName &p_name, const StringName &p_node_type) const;
bool has_stylebox(const StringName &p_name, const StringName &p_node_type) const;
bool has_stylebox_nocheck(const StringName &p_name, const StringName &p_node_type) const;
void rename_stylebox(const StringName &p_old_name, const StringName &p_name, const StringName &p_node_type);
void clear_stylebox(const StringName &p_name, const StringName &p_node_type);
void get_stylebox_list(StringName p_node_type, List<StringName> *p_list) const;
void add_stylebox_type(const StringName &p_node_type);
void set_stylebox(const StringName &p_name, const StringName &p_theme_type, const Ref<StyleBox> &p_style);
Ref<StyleBox> get_stylebox(const StringName &p_name, const StringName &p_theme_type) const;
bool has_stylebox(const StringName &p_name, const StringName &p_theme_type) const;
bool has_stylebox_nocheck(const StringName &p_name, const StringName &p_theme_type) const;
void rename_stylebox(const StringName &p_old_name, const StringName &p_name, const StringName &p_theme_type);
void clear_stylebox(const StringName &p_name, const StringName &p_theme_type);
void get_stylebox_list(StringName p_theme_type, List<StringName> *p_list) const;
void add_stylebox_type(const StringName &p_theme_type);
void get_stylebox_type_list(List<StringName> *p_list) const;
void set_font(const StringName &p_name, const StringName &p_node_type, const Ref<Font> &p_font);
Ref<Font> get_font(const StringName &p_name, const StringName &p_node_type) const;
bool has_font(const StringName &p_name, const StringName &p_node_type) const;
bool has_font_nocheck(const StringName &p_name, const StringName &p_node_type) const;
void rename_font(const StringName &p_old_name, const StringName &p_name, const StringName &p_node_type);
void clear_font(const StringName &p_name, const StringName &p_node_type);
void get_font_list(StringName p_node_type, List<StringName> *p_list) const;
void add_font_type(const StringName &p_node_type);
void set_font(const StringName &p_name, const StringName &p_theme_type, const Ref<Font> &p_font);
Ref<Font> get_font(const StringName &p_name, const StringName &p_theme_type) const;
bool has_font(const StringName &p_name, const StringName &p_theme_type) const;
bool has_font_nocheck(const StringName &p_name, const StringName &p_theme_type) const;
void rename_font(const StringName &p_old_name, const StringName &p_name, const StringName &p_theme_type);
void clear_font(const StringName &p_name, const StringName &p_theme_type);
void get_font_list(StringName p_theme_type, List<StringName> *p_list) const;
void add_font_type(const StringName &p_theme_type);
void get_font_type_list(List<StringName> *p_list) const;
void set_font_size(const StringName &p_name, const StringName &p_node_type, int p_font_size);
int get_font_size(const StringName &p_name, const StringName &p_node_type) const;
bool has_font_size(const StringName &p_name, const StringName &p_node_type) const;
bool has_font_size_nocheck(const StringName &p_name, const StringName &p_node_type) const;
void rename_font_size(const StringName &p_old_name, const StringName &p_name, const StringName &p_node_type);
void clear_font_size(const StringName &p_name, const StringName &p_node_type);
void get_font_size_list(StringName p_node_type, List<StringName> *p_list) const;
void add_font_size_type(const StringName &p_node_type);
void set_font_size(const StringName &p_name, const StringName &p_theme_type, int p_font_size);
int get_font_size(const StringName &p_name, const StringName &p_theme_type) const;
bool has_font_size(const StringName &p_name, const StringName &p_theme_type) const;
bool has_font_size_nocheck(const StringName &p_name, const StringName &p_theme_type) const;
void rename_font_size(const StringName &p_old_name, const StringName &p_name, const StringName &p_theme_type);
void clear_font_size(const StringName &p_name, const StringName &p_theme_type);
void get_font_size_list(StringName p_theme_type, List<StringName> *p_list) const;
void add_font_size_type(const StringName &p_theme_type);
void get_font_size_type_list(List<StringName> *p_list) const;
void set_color(const StringName &p_name, const StringName &p_node_type, const Color &p_color);
Color get_color(const StringName &p_name, const StringName &p_node_type) const;
bool has_color(const StringName &p_name, const StringName &p_node_type) const;
bool has_color_nocheck(const StringName &p_name, const StringName &p_node_type) const;
void rename_color(const StringName &p_old_name, const StringName &p_name, const StringName &p_node_type);
void clear_color(const StringName &p_name, const StringName &p_node_type);
void get_color_list(StringName p_node_type, List<StringName> *p_list) const;
void add_color_type(const StringName &p_node_type);
void set_color(const StringName &p_name, const StringName &p_theme_type, const Color &p_color);
Color get_color(const StringName &p_name, const StringName &p_theme_type) const;
bool has_color(const StringName &p_name, const StringName &p_theme_type) const;
bool has_color_nocheck(const StringName &p_name, const StringName &p_theme_type) const;
void rename_color(const StringName &p_old_name, const StringName &p_name, const StringName &p_theme_type);
void clear_color(const StringName &p_name, const StringName &p_theme_type);
void get_color_list(StringName p_theme_type, List<StringName> *p_list) const;
void add_color_type(const StringName &p_theme_type);
void get_color_type_list(List<StringName> *p_list) const;
void set_constant(const StringName &p_name, const StringName &p_node_type, int p_constant);
int get_constant(const StringName &p_name, const StringName &p_node_type) const;
bool has_constant(const StringName &p_name, const StringName &p_node_type) const;
bool has_constant_nocheck(const StringName &p_name, const StringName &p_node_type) const;
void rename_constant(const StringName &p_old_name, const StringName &p_name, const StringName &p_node_type);
void clear_constant(const StringName &p_name, const StringName &p_node_type);
void get_constant_list(StringName p_node_type, List<StringName> *p_list) const;
void add_constant_type(const StringName &p_node_type);
void set_constant(const StringName &p_name, const StringName &p_theme_type, int p_constant);
int get_constant(const StringName &p_name, const StringName &p_theme_type) const;
bool has_constant(const StringName &p_name, const StringName &p_theme_type) const;
bool has_constant_nocheck(const StringName &p_name, const StringName &p_theme_type) const;
void rename_constant(const StringName &p_old_name, const StringName &p_name, const StringName &p_theme_type);
void clear_constant(const StringName &p_name, const StringName &p_theme_type);
void get_constant_list(StringName p_theme_type, List<StringName> *p_list) const;
void add_constant_type(const StringName &p_theme_type);
void get_constant_type_list(List<StringName> *p_list) const;
void set_theme_item(DataType p_data_type, const StringName &p_name, const StringName &p_node_type, const Variant &p_value);
Variant get_theme_item(DataType p_data_type, const StringName &p_name, const StringName &p_node_type) const;
bool has_theme_item(DataType p_data_type, const StringName &p_name, const StringName &p_node_type) const;
bool has_theme_item_nocheck(DataType p_data_type, const StringName &p_name, const StringName &p_node_type) const;
void rename_theme_item(DataType p_data_type, const StringName &p_old_name, const StringName &p_name, const StringName &p_node_type);
void clear_theme_item(DataType p_data_type, const StringName &p_name, const StringName &p_node_type);
void get_theme_item_list(DataType p_data_type, StringName p_node_type, List<StringName> *p_list) const;
void add_theme_item_type(DataType p_data_type, const StringName &p_node_type);
void set_theme_item(DataType p_data_type, const StringName &p_name, const StringName &p_theme_type, const Variant &p_value);
Variant get_theme_item(DataType p_data_type, const StringName &p_name, const StringName &p_theme_type) const;
bool has_theme_item(DataType p_data_type, const StringName &p_name, const StringName &p_theme_type) const;
bool has_theme_item_nocheck(DataType p_data_type, const StringName &p_name, const StringName &p_theme_type) const;
void rename_theme_item(DataType p_data_type, const StringName &p_old_name, const StringName &p_name, const StringName &p_theme_type);
void clear_theme_item(DataType p_data_type, const StringName &p_name, const StringName &p_theme_type);
void get_theme_item_list(DataType p_data_type, StringName p_theme_type, List<StringName> *p_list) const;
void add_theme_item_type(DataType p_data_type, const StringName &p_theme_type);
void get_theme_item_type_list(DataType p_data_type, List<StringName> *p_list) const;
void get_type_list(List<StringName> *p_list) const;
static void get_type_dependencies(const StringName &p_theme_type, List<StringName> *p_list);
void copy_default_theme();
void copy_theme(const Ref<Theme> &p_other);