mirror of
https://github.com/godotengine/godot.git
synced 2026-03-03 20:55:48 +00:00
Merge pull request #42008 from Calinou/theme-rename-node-type
Rename the `type` parameter to `node_type` in Theme and Control
This commit is contained in:
@@ -446,7 +446,7 @@
|
||||
<argument index="1" name="type" type="StringName" default="""">
|
||||
</argument>
|
||||
<description>
|
||||
Returns a color from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]type[/code].
|
||||
Returns a color from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code].
|
||||
[codeblocks]
|
||||
[gdscript]
|
||||
func _ready():
|
||||
@@ -469,7 +469,7 @@
|
||||
<argument index="1" name="type" type="StringName" default="""">
|
||||
</argument>
|
||||
<description>
|
||||
Returns a constant from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]type[/code].
|
||||
Returns a constant from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_theme_font" qualifiers="const">
|
||||
@@ -480,7 +480,7 @@
|
||||
<argument index="1" name="type" type="StringName" default="""">
|
||||
</argument>
|
||||
<description>
|
||||
Returns a font from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]type[/code].
|
||||
Returns a font from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_theme_icon" qualifiers="const">
|
||||
@@ -491,7 +491,7 @@
|
||||
<argument index="1" name="type" type="StringName" default="""">
|
||||
</argument>
|
||||
<description>
|
||||
Returns an icon from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]type[/code].
|
||||
Returns an icon from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_theme_stylebox" qualifiers="const">
|
||||
@@ -502,7 +502,7 @@
|
||||
<argument index="1" name="type" type="StringName" default="""">
|
||||
</argument>
|
||||
<description>
|
||||
Returns a [StyleBox] from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]type[/code].
|
||||
Returns a [StyleBox] from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_tooltip" qualifiers="const">
|
||||
@@ -566,7 +566,7 @@
|
||||
<argument index="1" name="type" type="StringName" default="""">
|
||||
</argument>
|
||||
<description>
|
||||
Returns [code]true[/code] if [Color] with given [code]name[/code] and associated with [Control] of given [code]type[/code] exists in assigned [Theme].
|
||||
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].
|
||||
</description>
|
||||
</method>
|
||||
<method name="has_theme_color_override" qualifiers="const">
|
||||
@@ -586,7 +586,7 @@
|
||||
<argument index="1" name="type" type="StringName" default="""">
|
||||
</argument>
|
||||
<description>
|
||||
Returns [code]true[/code] if constant with given [code]name[/code] and associated with [Control] of given [code]type[/code] exists in assigned [Theme].
|
||||
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].
|
||||
</description>
|
||||
</method>
|
||||
<method name="has_theme_constant_override" qualifiers="const">
|
||||
@@ -606,7 +606,7 @@
|
||||
<argument index="1" name="type" type="StringName" default="""">
|
||||
</argument>
|
||||
<description>
|
||||
Returns [code]true[/code] if font with given [code]name[/code] and associated with [Control] of given [code]type[/code] exists in assigned [Theme].
|
||||
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].
|
||||
</description>
|
||||
</method>
|
||||
<method name="has_theme_font_override" qualifiers="const">
|
||||
@@ -626,7 +626,7 @@
|
||||
<argument index="1" name="type" type="StringName" default="""">
|
||||
</argument>
|
||||
<description>
|
||||
Returns [code]true[/code] if icon with given [code]name[/code] and associated with [Control] of given [code]type[/code] exists in assigned [Theme].
|
||||
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].
|
||||
</description>
|
||||
</method>
|
||||
<method name="has_theme_icon_override" qualifiers="const">
|
||||
@@ -655,7 +655,7 @@
|
||||
<argument index="1" name="type" type="StringName" default="""">
|
||||
</argument>
|
||||
<description>
|
||||
Returns [code]true[/code] if [StyleBox] with given [code]name[/code] and associated with [Control] of given [code]type[/code] exists in assigned [Theme].
|
||||
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].
|
||||
</description>
|
||||
</method>
|
||||
<method name="has_theme_stylebox_override" qualifiers="const">
|
||||
|
||||
@@ -23,10 +23,10 @@
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="type" type="StringName">
|
||||
<argument index="1" name="node_type" type="StringName">
|
||||
</argument>
|
||||
<description>
|
||||
Clears the [Color] at [code]name[/code] if the theme has [code]type[/code].
|
||||
Clears the [Color] at [code]name[/code] if the theme has [code]node_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="type" type="StringName">
|
||||
<argument index="1" name="node_type" type="StringName">
|
||||
</argument>
|
||||
<description>
|
||||
Clears the constant at [code]name[/code] if the theme has [code]type[/code].
|
||||
Clears the constant at [code]name[/code] if the theme has [code]node_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="type" type="StringName">
|
||||
<argument index="1" name="node_type" type="StringName">
|
||||
</argument>
|
||||
<description>
|
||||
Clears the [Font] at [code]name[/code] if the theme has [code]type[/code].
|
||||
Clears the [Font] at [code]name[/code] if the theme has [code]node_type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="clear_icon">
|
||||
@@ -56,10 +56,10 @@
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="type" type="StringName">
|
||||
<argument index="1" name="node_type" type="StringName">
|
||||
</argument>
|
||||
<description>
|
||||
Clears the icon at [code]name[/code] if the theme has [code]type[/code].
|
||||
Clears the icon at [code]name[/code] if the theme has [code]node_type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="clear_stylebox">
|
||||
@@ -67,10 +67,10 @@
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="type" type="StringName">
|
||||
<argument index="1" name="node_type" type="StringName">
|
||||
</argument>
|
||||
<description>
|
||||
Clears [StyleBox] at [code]name[/code] if the theme has [code]type[/code].
|
||||
Clears [StyleBox] at [code]name[/code] if the theme has [code]node_type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="copy_default_theme">
|
||||
@@ -94,19 +94,19 @@
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="type" type="StringName">
|
||||
<argument index="1" name="node_type" type="StringName">
|
||||
</argument>
|
||||
<description>
|
||||
Returns the [Color] at [code]name[/code] if the theme has [code]type[/code].
|
||||
Returns the [Color] at [code]name[/code] if the theme has [code]node_type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_color_list" qualifiers="const">
|
||||
<return type="PackedStringArray">
|
||||
</return>
|
||||
<argument index="0" name="type" type="String">
|
||||
<argument index="0" name="node_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]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]node_type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_constant" qualifiers="const">
|
||||
@@ -114,19 +114,19 @@
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="type" type="StringName">
|
||||
<argument index="1" name="node_type" type="StringName">
|
||||
</argument>
|
||||
<description>
|
||||
Returns the constant at [code]name[/code] if the theme has [code]type[/code].
|
||||
Returns the constant at [code]name[/code] if the theme has [code]node_type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_constant_list" qualifiers="const">
|
||||
<return type="PackedStringArray">
|
||||
</return>
|
||||
<argument index="0" name="type" type="String">
|
||||
<argument index="0" name="node_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]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]node_type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_font" qualifiers="const">
|
||||
@@ -134,19 +134,19 @@
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="type" type="StringName">
|
||||
<argument index="1" name="node_type" type="StringName">
|
||||
</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]node_type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_font_list" qualifiers="const">
|
||||
<return type="PackedStringArray">
|
||||
</return>
|
||||
<argument index="0" name="type" type="String">
|
||||
<argument index="0" name="node_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]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]node_type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_icon" qualifiers="const">
|
||||
@@ -154,19 +154,19 @@
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="type" type="StringName">
|
||||
<argument index="1" name="node_type" type="StringName">
|
||||
</argument>
|
||||
<description>
|
||||
Returns the icon [Texture2D] at [code]name[/code] if the theme has [code]type[/code].
|
||||
Returns the icon [Texture2D] at [code]name[/code] if the theme has [code]node_type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_icon_list" qualifiers="const">
|
||||
<return type="PackedStringArray">
|
||||
</return>
|
||||
<argument index="0" name="type" type="String">
|
||||
<argument index="0" name="node_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]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]node_type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_stylebox" qualifiers="const">
|
||||
@@ -174,35 +174,35 @@
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="type" type="StringName">
|
||||
<argument index="1" name="node_type" type="StringName">
|
||||
</argument>
|
||||
<description>
|
||||
Returns the icon [StyleBox] at [code]name[/code] if the theme has [code]type[/code].
|
||||
Returns the icon [StyleBox] at [code]name[/code] if the theme has [code]node_type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_stylebox_list" qualifiers="const">
|
||||
<return type="PackedStringArray">
|
||||
</return>
|
||||
<argument index="0" name="type" type="String">
|
||||
<argument index="0" name="node_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]type[/code].
|
||||
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].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_stylebox_types" qualifiers="const">
|
||||
<return type="PackedStringArray">
|
||||
</return>
|
||||
<description>
|
||||
Returns all the [StyleBox] types as a [PackedStringArray] filled with each [StyleBox]'s type, for use in [method get_stylebox] and/or [method get_stylebox_list], if the theme has [code]type[/code].
|
||||
Returns all the [StyleBox] types as a [PackedStringArray] filled with each [StyleBox]'s type, for use in [method get_stylebox] and/or [method get_stylebox_list], if the theme has [code]node_type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_type_list" qualifiers="const">
|
||||
<return type="PackedStringArray">
|
||||
</return>
|
||||
<argument index="0" name="type" type="String">
|
||||
<argument index="0" name="node_type" type="String">
|
||||
</argument>
|
||||
<description>
|
||||
Returns all the types in [code]type[/code] as a [PackedStringArray] for use in any of the [code]get_*[/code] functions, if the theme has [code]type[/code].
|
||||
Returns all the types in [code]node_type[/code] as a [PackedStringArray] for use in any of the [code]get_*[/code] functions, if the theme has [code]node_type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="has_color" qualifiers="const">
|
||||
@@ -210,11 +210,11 @@
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="type" type="StringName">
|
||||
<argument index="1" name="node_type" type="StringName">
|
||||
</argument>
|
||||
<description>
|
||||
Returns [code]true[/code] if [Color] 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 [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].
|
||||
</description>
|
||||
</method>
|
||||
<method name="has_constant" qualifiers="const">
|
||||
@@ -222,11 +222,11 @@
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="type" type="StringName">
|
||||
<argument index="1" name="node_type" type="StringName">
|
||||
</argument>
|
||||
<description>
|
||||
Returns [code]true[/code] if constant 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 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].
|
||||
</description>
|
||||
</method>
|
||||
<method name="has_font" qualifiers="const">
|
||||
@@ -234,11 +234,11 @@
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="type" type="StringName">
|
||||
<argument index="1" name="node_type" type="StringName">
|
||||
</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]node_type[/code].
|
||||
Returns [code]false[/code] if the theme does not have [code]node_type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="has_icon" qualifiers="const">
|
||||
@@ -246,11 +246,11 @@
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="type" type="StringName">
|
||||
<argument index="1" name="node_type" type="StringName">
|
||||
</argument>
|
||||
<description>
|
||||
Returns [code]true[/code] if icon [Texture2D] 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 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].
|
||||
</description>
|
||||
</method>
|
||||
<method name="has_stylebox" qualifiers="const">
|
||||
@@ -258,11 +258,11 @@
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="type" type="StringName">
|
||||
<argument index="1" name="node_type" type="StringName">
|
||||
</argument>
|
||||
<description>
|
||||
Returns [code]true[/code] if [StyleBox] 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 [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].
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_color">
|
||||
@@ -270,13 +270,13 @@
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="type" type="StringName">
|
||||
<argument index="1" name="node_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]type[/code].
|
||||
Does nothing if the theme does not have [code]type[/code].
|
||||
Sets the theme's [Color] to [code]color[/code] at [code]name[/code] in [code]node_type[/code].
|
||||
Does nothing if the theme does not have [code]node_type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_constant">
|
||||
@@ -284,13 +284,13 @@
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="type" type="StringName">
|
||||
<argument index="1" name="node_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]type[/code].
|
||||
Does nothing if the theme does not have [code]type[/code].
|
||||
Sets the theme's constant to [code]constant[/code] at [code]name[/code] in [code]node_type[/code].
|
||||
Does nothing if the theme does not have [code]node_type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_font">
|
||||
@@ -298,13 +298,13 @@
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="type" type="StringName">
|
||||
<argument index="1" name="node_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]type[/code].
|
||||
Does nothing if the theme does not have [code]type[/code].
|
||||
Sets the theme's [Font] to [code]font[/code] at [code]name[/code] in [code]node_type[/code].
|
||||
Does nothing if the theme does not have [code]node_type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_icon">
|
||||
@@ -312,13 +312,13 @@
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="type" type="StringName">
|
||||
<argument index="1" name="node_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]type[/code].
|
||||
Does nothing if the theme does not have [code]type[/code].
|
||||
Sets the theme's icon [Texture2D] to [code]texture[/code] at [code]name[/code] in [code]node_type[/code].
|
||||
Does nothing if the theme does not have [code]node_type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_stylebox">
|
||||
@@ -326,13 +326,13 @@
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="type" type="StringName">
|
||||
<argument index="1" name="node_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]type[/code].
|
||||
Does nothing if the theme does not have [code]type[/code].
|
||||
Sets theme's [StyleBox] to [code]stylebox[/code] at [code]name[/code] in [code]node_type[/code].
|
||||
Does nothing if the theme does not have [code]node_type[/code].
|
||||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
|
||||
@@ -728,13 +728,13 @@ 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_type) {
|
||||
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
|
||||
Control *theme_owner = p_theme_owner;
|
||||
Window *theme_owner_window = p_theme_owner_window;
|
||||
|
||||
while (theme_owner || theme_owner_window) {
|
||||
StringName class_name = p_type;
|
||||
StringName class_name = p_node_type;
|
||||
|
||||
while (class_name != StringName()) {
|
||||
if (theme_owner && (theme_owner->data.theme.operator->()->*has_func)(p_name, class_name)) {
|
||||
@@ -771,13 +771,13 @@ bool Control::_find_theme_item(Control *p_theme_owner, Window *p_theme_owner_win
|
||||
return false;
|
||||
}
|
||||
|
||||
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_type) {
|
||||
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
|
||||
Control *theme_owner = p_theme_owner;
|
||||
Window *theme_owner_window = p_theme_owner_window;
|
||||
|
||||
while (theme_owner || theme_owner_window) {
|
||||
StringName class_name = p_type;
|
||||
StringName class_name = p_node_type;
|
||||
|
||||
while (class_name != StringName()) {
|
||||
if (theme_owner && (theme_owner->data.theme.operator->()->*has_func)(p_name, class_name)) {
|
||||
@@ -812,176 +812,176 @@ bool Control::_has_theme_item(Control *p_theme_owner, Window *p_theme_owner_wind
|
||||
return false;
|
||||
}
|
||||
|
||||
Ref<Texture2D> Control::get_theme_icon(const StringName &p_name, const StringName &p_type) const {
|
||||
if (p_type == StringName() || p_type == get_class_name()) {
|
||||
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()) {
|
||||
const Ref<Texture2D> *tex = data.icon_override.getptr(p_name);
|
||||
if (tex) {
|
||||
return *tex;
|
||||
}
|
||||
}
|
||||
|
||||
StringName type = p_type ? p_type : get_class_name();
|
||||
StringName type = p_node_type ? p_node_type : get_class_name();
|
||||
|
||||
return get_icons(data.theme_owner, data.theme_owner_window, p_name, type);
|
||||
}
|
||||
|
||||
Ref<Texture2D> Control::get_icons(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type) {
|
||||
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_type)) {
|
||||
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_type)) {
|
||||
return Theme::get_project_default()->get_icon(p_name, p_type);
|
||||
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_type);
|
||||
return Theme::get_default()->get_icon(p_name, p_node_type);
|
||||
}
|
||||
|
||||
Ref<Shader> Control::get_theme_shader(const StringName &p_name, const StringName &p_type) const {
|
||||
if (p_type == StringName() || p_type == get_class_name()) {
|
||||
Ref<Shader> Control::get_theme_shader(const StringName &p_name, const StringName &p_node_type) const {
|
||||
if (p_node_type == StringName() || p_node_type == get_class_name()) {
|
||||
const Ref<Shader> *sdr = data.shader_override.getptr(p_name);
|
||||
if (sdr) {
|
||||
return *sdr;
|
||||
}
|
||||
}
|
||||
|
||||
StringName type = p_type ? p_type : get_class_name();
|
||||
StringName type = p_node_type ? p_node_type : get_class_name();
|
||||
|
||||
return get_shaders(data.theme_owner, data.theme_owner_window, p_name, type);
|
||||
}
|
||||
|
||||
Ref<Shader> Control::get_shaders(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type) {
|
||||
Ref<Shader> Control::get_shaders(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type) {
|
||||
Ref<Shader> shader;
|
||||
|
||||
if (_find_theme_item(p_theme_owner, p_theme_owner_window, shader, &Theme::get_shader, &Theme::has_shader, p_name, p_type)) {
|
||||
if (_find_theme_item(p_theme_owner, p_theme_owner_window, shader, &Theme::get_shader, &Theme::has_shader, p_name, p_node_type)) {
|
||||
return shader;
|
||||
}
|
||||
|
||||
if (Theme::get_project_default().is_valid()) {
|
||||
if (Theme::get_project_default()->has_shader(p_name, p_type)) {
|
||||
return Theme::get_project_default()->get_shader(p_name, p_type);
|
||||
if (Theme::get_project_default()->has_shader(p_name, p_node_type)) {
|
||||
return Theme::get_project_default()->get_shader(p_name, p_node_type);
|
||||
}
|
||||
}
|
||||
|
||||
return Theme::get_default()->get_shader(p_name, p_type);
|
||||
return Theme::get_default()->get_shader(p_name, p_node_type);
|
||||
}
|
||||
|
||||
Ref<StyleBox> Control::get_theme_stylebox(const StringName &p_name, const StringName &p_type) const {
|
||||
if (p_type == StringName() || p_type == get_class_name()) {
|
||||
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()) {
|
||||
const Ref<StyleBox> *style = data.style_override.getptr(p_name);
|
||||
if (style) {
|
||||
return *style;
|
||||
}
|
||||
}
|
||||
|
||||
StringName type = p_type ? p_type : get_class_name();
|
||||
StringName type = p_node_type ? p_node_type : get_class_name();
|
||||
|
||||
return get_styleboxs(data.theme_owner, data.theme_owner_window, p_name, type);
|
||||
}
|
||||
|
||||
Ref<StyleBox> Control::get_styleboxs(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type) {
|
||||
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_type)) {
|
||||
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_type)) {
|
||||
return Theme::get_project_default()->get_stylebox(p_name, p_type);
|
||||
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_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_type) const {
|
||||
if (p_type == StringName() || p_type == get_class_name()) {
|
||||
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()) {
|
||||
const Ref<Font> *font = data.font_override.getptr(p_name);
|
||||
if (font) {
|
||||
return *font;
|
||||
}
|
||||
}
|
||||
|
||||
StringName type = p_type ? p_type : get_class_name();
|
||||
StringName type = p_node_type ? p_node_type : get_class_name();
|
||||
|
||||
return get_fonts(data.theme_owner, data.theme_owner_window, p_name, type);
|
||||
}
|
||||
|
||||
Ref<Font> Control::get_fonts(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type) {
|
||||
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_type)) {
|
||||
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_type)) {
|
||||
return Theme::get_project_default()->get_font(p_name, p_type);
|
||||
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_type);
|
||||
return Theme::get_default()->get_font(p_name, p_node_type);
|
||||
}
|
||||
|
||||
Color Control::get_theme_color(const StringName &p_name, const StringName &p_type) const {
|
||||
if (p_type == StringName() || p_type == get_class_name()) {
|
||||
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()) {
|
||||
const Color *color = data.color_override.getptr(p_name);
|
||||
if (color) {
|
||||
return *color;
|
||||
}
|
||||
}
|
||||
|
||||
StringName type = p_type ? p_type : get_class_name();
|
||||
StringName type = p_node_type ? p_node_type : get_class_name();
|
||||
|
||||
return get_colors(data.theme_owner, data.theme_owner_window, p_name, type);
|
||||
}
|
||||
|
||||
Color Control::get_colors(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type) {
|
||||
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_type)) {
|
||||
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_type)) {
|
||||
return Theme::get_project_default()->get_color(p_name, p_type);
|
||||
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_type);
|
||||
return Theme::get_default()->get_color(p_name, p_node_type);
|
||||
}
|
||||
|
||||
int Control::get_theme_constant(const StringName &p_name, const StringName &p_type) const {
|
||||
if (p_type == StringName() || p_type == get_class_name()) {
|
||||
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()) {
|
||||
const int *constant = data.constant_override.getptr(p_name);
|
||||
if (constant) {
|
||||
return *constant;
|
||||
}
|
||||
}
|
||||
|
||||
StringName type = p_type ? p_type : get_class_name();
|
||||
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_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_type)) {
|
||||
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_type)) {
|
||||
return Theme::get_project_default()->get_constant(p_name, p_type);
|
||||
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_type);
|
||||
return Theme::get_default()->get_constant(p_name, p_node_type);
|
||||
}
|
||||
|
||||
bool Control::has_theme_icon_override(const StringName &p_name) const {
|
||||
@@ -1014,154 +1014,154 @@ 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_type) const {
|
||||
if (p_type == StringName() || p_type == get_class_name()) {
|
||||
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()) {
|
||||
if (has_theme_icon_override(p_name)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
StringName type = p_type ? p_type : get_class_name();
|
||||
StringName type = p_node_type ? p_node_type : get_class_name();
|
||||
|
||||
return has_icons(data.theme_owner, data.theme_owner_window, p_name, type);
|
||||
}
|
||||
|
||||
bool Control::has_icons(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type) {
|
||||
if (_has_theme_item(p_theme_owner, p_theme_owner_window, &Theme::has_icon, p_name, p_type)) {
|
||||
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_type)) {
|
||||
if (Theme::get_project_default()->has_color(p_name, p_node_type)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return Theme::get_default()->has_icon(p_name, p_type);
|
||||
return Theme::get_default()->has_icon(p_name, p_node_type);
|
||||
}
|
||||
|
||||
bool Control::has_theme_shader(const StringName &p_name, const StringName &p_type) const {
|
||||
if (p_type == StringName() || p_type == get_class_name()) {
|
||||
bool Control::has_theme_shader(const StringName &p_name, const StringName &p_node_type) const {
|
||||
if (p_node_type == StringName() || p_node_type == get_class_name()) {
|
||||
if (has_theme_shader_override(p_name)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
StringName type = p_type ? p_type : get_class_name();
|
||||
StringName type = p_node_type ? p_node_type : get_class_name();
|
||||
|
||||
return has_shaders(data.theme_owner, data.theme_owner_window, p_name, type);
|
||||
}
|
||||
|
||||
bool Control::has_shaders(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type) {
|
||||
if (_has_theme_item(p_theme_owner, p_theme_owner_window, &Theme::has_shader, p_name, p_type)) {
|
||||
bool Control::has_shaders(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_shader, p_name, p_node_type)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Theme::get_project_default().is_valid()) {
|
||||
if (Theme::get_project_default()->has_shader(p_name, p_type)) {
|
||||
if (Theme::get_project_default()->has_shader(p_name, p_node_type)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return Theme::get_default()->has_shader(p_name, p_type);
|
||||
return Theme::get_default()->has_shader(p_name, p_node_type);
|
||||
}
|
||||
|
||||
bool Control::has_theme_stylebox(const StringName &p_name, const StringName &p_type) const {
|
||||
if (p_type == StringName() || p_type == get_class_name()) {
|
||||
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()) {
|
||||
if (has_theme_stylebox_override(p_name)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
StringName type = p_type ? p_type : get_class_name();
|
||||
StringName type = p_node_type ? p_node_type : get_class_name();
|
||||
|
||||
return has_styleboxs(data.theme_owner, data.theme_owner_window, p_name, type);
|
||||
}
|
||||
|
||||
bool Control::has_styleboxs(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type) {
|
||||
if (_has_theme_item(p_theme_owner, p_theme_owner_window, &Theme::has_stylebox, p_name, p_type)) {
|
||||
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_type)) {
|
||||
if (Theme::get_project_default()->has_stylebox(p_name, p_node_type)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return Theme::get_default()->has_stylebox(p_name, p_type);
|
||||
return Theme::get_default()->has_stylebox(p_name, p_node_type);
|
||||
}
|
||||
|
||||
bool Control::has_theme_font(const StringName &p_name, const StringName &p_type) const {
|
||||
if (p_type == StringName() || p_type == get_class_name()) {
|
||||
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()) {
|
||||
if (has_theme_font_override(p_name)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
StringName type = p_type ? p_type : get_class_name();
|
||||
StringName type = p_node_type ? p_node_type : get_class_name();
|
||||
|
||||
return has_fonts(data.theme_owner, data.theme_owner_window, p_name, type);
|
||||
}
|
||||
|
||||
bool Control::has_fonts(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type) {
|
||||
if (_has_theme_item(p_theme_owner, p_theme_owner_window, &Theme::has_font, p_name, p_type)) {
|
||||
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_type)) {
|
||||
if (Theme::get_project_default()->has_font(p_name, p_node_type)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return Theme::get_default()->has_font(p_name, p_type);
|
||||
return Theme::get_default()->has_font(p_name, p_node_type);
|
||||
}
|
||||
|
||||
bool Control::has_theme_color(const StringName &p_name, const StringName &p_type) const {
|
||||
if (p_type == StringName() || p_type == get_class_name()) {
|
||||
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()) {
|
||||
if (has_theme_color_override(p_name)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
StringName type = p_type ? p_type : get_class_name();
|
||||
StringName type = p_node_type ? p_node_type : get_class_name();
|
||||
|
||||
return has_colors(data.theme_owner, data.theme_owner_window, p_name, type);
|
||||
}
|
||||
|
||||
bool Control::has_colors(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type) {
|
||||
if (_has_theme_item(p_theme_owner, p_theme_owner_window, &Theme::has_color, p_name, p_type)) {
|
||||
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_type)) {
|
||||
if (Theme::get_project_default()->has_color(p_name, p_node_type)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return Theme::get_default()->has_color(p_name, p_type);
|
||||
return Theme::get_default()->has_color(p_name, p_node_type);
|
||||
}
|
||||
|
||||
bool Control::has_theme_constant(const StringName &p_name, const StringName &p_type) const {
|
||||
if (p_type == StringName() || p_type == get_class_name()) {
|
||||
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()) {
|
||||
if (has_theme_constant_override(p_name)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
StringName type = p_type ? p_type : get_class_name();
|
||||
StringName type = p_node_type ? p_node_type : get_class_name();
|
||||
|
||||
return has_constants(data.theme_owner, data.theme_owner_window, p_name, p_type);
|
||||
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_type) {
|
||||
if (_has_theme_item(p_theme_owner, p_theme_owner_window, &Theme::has_constant, p_name, p_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_type)) {
|
||||
if (Theme::get_project_default()->has_constant(p_name, p_node_type)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return Theme::get_default()->has_constant(p_name, p_type);
|
||||
return Theme::get_default()->has_constant(p_name, p_node_type);
|
||||
}
|
||||
|
||||
Rect2 Control::get_parent_anchorable_rect() const {
|
||||
|
||||
@@ -236,23 +236,23 @@ 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_type);
|
||||
_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_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_type = StringName());
|
||||
static Ref<Shader> get_shaders(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type = StringName());
|
||||
static Ref<StyleBox> get_styleboxs(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type = StringName());
|
||||
static Ref<Font> get_fonts(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type = StringName());
|
||||
static Color get_colors(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type = StringName());
|
||||
static int get_constants(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type = StringName());
|
||||
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<Shader> get_shaders(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 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_type = StringName());
|
||||
static bool has_shaders(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type = StringName());
|
||||
static bool has_styleboxs(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type = StringName());
|
||||
static bool has_fonts(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type = StringName());
|
||||
static bool has_colors(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type = StringName());
|
||||
static bool has_constants(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_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_shaders(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_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());
|
||||
|
||||
protected:
|
||||
virtual void add_child_notify(Node *p_child) override;
|
||||
@@ -429,12 +429,12 @@ public:
|
||||
void add_theme_color_override(const StringName &p_name, const Color &p_color);
|
||||
void add_theme_constant_override(const StringName &p_name, int p_constant);
|
||||
|
||||
Ref<Texture2D> get_theme_icon(const StringName &p_name, const StringName &p_type = StringName()) const;
|
||||
Ref<Shader> get_theme_shader(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;
|
||||
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_node_type = StringName()) const;
|
||||
Ref<Shader> get_theme_shader(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;
|
||||
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;
|
||||
|
||||
bool has_theme_icon_override(const StringName &p_name) const;
|
||||
bool has_theme_shader_override(const StringName &p_name) const;
|
||||
@@ -443,12 +443,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_type = StringName()) const;
|
||||
bool has_theme_shader(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_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_node_type = StringName()) const;
|
||||
bool has_theme_shader(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_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;
|
||||
|
||||
/* TOOLTIP */
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -51,13 +51,13 @@ class Theme : public Resource {
|
||||
HashMap<StringName, HashMap<StringName, Color>> color_map;
|
||||
HashMap<StringName, HashMap<StringName, int>> constant_map;
|
||||
|
||||
Vector<String> _get_icon_list(const String &p_type) const;
|
||||
Vector<String> _get_stylebox_list(const String &p_type) const;
|
||||
Vector<String> _get_icon_list(const String &p_node_type) const;
|
||||
Vector<String> _get_stylebox_list(const String &p_node_type) const;
|
||||
Vector<String> _get_stylebox_types() const;
|
||||
Vector<String> _get_font_list(const String &p_type) const;
|
||||
Vector<String> _get_color_list(const String &p_type) const;
|
||||
Vector<String> _get_constant_list(const String &p_type) const;
|
||||
Vector<String> _get_type_list(const String &p_type) const;
|
||||
Vector<String> _get_font_list(const String &p_node_type) const;
|
||||
Vector<String> _get_color_list(const String &p_node_type) const;
|
||||
Vector<String> _get_constant_list(const String &p_node_type) const;
|
||||
Vector<String> _get_type_list(const String &p_node_type) const;
|
||||
|
||||
protected:
|
||||
bool _set(const StringName &p_name, const Variant &p_value);
|
||||
@@ -88,42 +88,42 @@ public:
|
||||
void set_default_theme_font(const Ref<Font> &p_default_font);
|
||||
Ref<Font> get_default_theme_font() const;
|
||||
|
||||
void set_icon(const StringName &p_name, const StringName &p_type, const Ref<Texture2D> &p_icon);
|
||||
Ref<Texture2D> get_icon(const StringName &p_name, const StringName &p_type) const;
|
||||
bool has_icon(const StringName &p_name, const StringName &p_type) const;
|
||||
void clear_icon(const StringName &p_name, const StringName &p_type);
|
||||
void get_icon_list(StringName p_type, List<StringName> *p_list) 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;
|
||||
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 set_shader(const StringName &p_name, const StringName &p_type, const Ref<Shader> &p_shader);
|
||||
Ref<Shader> get_shader(const StringName &p_name, const StringName &p_type) const;
|
||||
bool has_shader(const StringName &p_name, const StringName &p_type) const;
|
||||
void clear_shader(const StringName &p_name, const StringName &p_type);
|
||||
void get_shader_list(const StringName &p_type, List<StringName> *p_list) const;
|
||||
void set_shader(const StringName &p_name, const StringName &p_node_type, const Ref<Shader> &p_shader);
|
||||
Ref<Shader> get_shader(const StringName &p_name, const StringName &p_node_type) const;
|
||||
bool has_shader(const StringName &p_name, const StringName &p_node_type) const;
|
||||
void clear_shader(const StringName &p_name, const StringName &p_node_type);
|
||||
void get_shader_list(const StringName &p_node_type, List<StringName> *p_list) const;
|
||||
|
||||
void set_stylebox(const StringName &p_name, const StringName &p_type, const Ref<StyleBox> &p_style);
|
||||
Ref<StyleBox> get_stylebox(const StringName &p_name, const StringName &p_type) const;
|
||||
bool has_stylebox(const StringName &p_name, const StringName &p_type) const;
|
||||
void clear_stylebox(const StringName &p_name, const StringName &p_type);
|
||||
void get_stylebox_list(StringName p_type, 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;
|
||||
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 get_stylebox_types(List<StringName> *p_list) const;
|
||||
|
||||
void set_font(const StringName &p_name, const StringName &p_type, const Ref<Font> &p_font);
|
||||
Ref<Font> get_font(const StringName &p_name, const StringName &p_type) const;
|
||||
bool has_font(const StringName &p_name, const StringName &p_type) const;
|
||||
void clear_font(const StringName &p_name, const StringName &p_type);
|
||||
void get_font_list(StringName p_type, 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;
|
||||
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 set_color(const StringName &p_name, const StringName &p_type, const Color &p_color);
|
||||
Color get_color(const StringName &p_name, const StringName &p_type) const;
|
||||
bool has_color(const StringName &p_name, const StringName &p_type) const;
|
||||
void clear_color(const StringName &p_name, const StringName &p_type);
|
||||
void get_color_list(StringName p_type, 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;
|
||||
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 set_constant(const StringName &p_name, const StringName &p_type, int p_constant);
|
||||
int get_constant(const StringName &p_name, const StringName &p_type) const;
|
||||
bool has_constant(const StringName &p_name, const StringName &p_type) const;
|
||||
void clear_constant(const StringName &p_name, const StringName &p_type);
|
||||
void get_constant_list(StringName p_type, 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;
|
||||
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 get_type_list(List<StringName> *p_list) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user