summaryrefslogtreecommitdiff
path: root/doc/classes
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-08-26 10:37:44 +0200
committerGitHub <noreply@github.com>2022-08-26 10:37:44 +0200
commit7bb92bc04059c32c38098b0ccf662f5a610e0380 (patch)
tree3ede59dea8948106c300a8becdea963474742ce4 /doc/classes
parent9f48db16c26319f87defa4221c4318494bc6dda0 (diff)
parent74eb2a70bd7ab881776b30fb34bf98d03651bf52 (diff)
Merge pull request #62845 from AaronRecord/dont_update_theme_outside_of_tree
Refactor and remove excessive calls of `NOTIFICATION_THEME_CHANGED`
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/Control.xml8
-rw-r--r--doc/classes/Window.xml9
2 files changed, 15 insertions, 2 deletions
diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml
index b7a9ae235e..a3cd4d0752 100644
--- a/doc/classes/Control.xml
+++ b/doc/classes/Control.xml
@@ -1145,6 +1145,7 @@
</signal>
<signal name="theme_changed">
<description>
+ Emitted when the [constant NOTIFICATION_THEME_CHANGED] notification is sent.
</description>
</signal>
</signals>
@@ -1174,7 +1175,12 @@
Sent when the node loses focus.
</constant>
<constant name="NOTIFICATION_THEME_CHANGED" value="45">
- Sent when the node's [member theme] changes, right before Godot redraws the control. Happens when you call one of the [code]add_theme_*_override[/code] methods.
+ Sent when the node needs to refresh its theme items. This happens in one of the following cases:
+ - The [member theme] property is changed on this node or any of its ancestors.
+ - The [member theme_type_variation] property is changed on this node.
+ - One of the node's theme property overrides is changed.
+ - The node enters the scene tree.
+ [b]Note:[/b] As an optimization, this notification won't be sent from changes that occur while this node is outside of the scene tree. Instead, all of the theme item updates can be applied at once when the node enters the scene tree.
</constant>
<constant name="NOTIFICATION_SCROLL_BEGIN" value="47">
Sent when this node is inside a [ScrollContainer] which has begun being scrolled.
diff --git a/doc/classes/Window.xml b/doc/classes/Window.xml
index ce7ad1e64e..c3002a8a9f 100644
--- a/doc/classes/Window.xml
+++ b/doc/classes/Window.xml
@@ -448,7 +448,7 @@
</signal>
<signal name="theme_changed">
<description>
- Emitted when the [member theme] is modified or changed to another [Theme].
+ Emitted when the [constant NOTIFICATION_THEME_CHANGED] notification is sent.
</description>
</signal>
<signal name="visibility_changed">
@@ -467,6 +467,13 @@
<constant name="NOTIFICATION_VISIBILITY_CHANGED" value="30">
Emitted when [Window]'s visibility changes, right before [signal visibility_changed].
</constant>
+ <constant name="NOTIFICATION_THEME_CHANGED" value="32">
+ Sent when the node needs to refresh its theme items. This happens in one of the following cases:
+ - The [member theme] property is changed on this node or any of its ancestors.
+ - The [member theme_type_variation] property is changed on this node.
+ - The node enters the scene tree.
+ [b]Note:[/b] As an optimization, this notification won't be sent from changes that occur while this node is outside of the scene tree. Instead, all of the theme item updates can be applied at once when the node enters the scene tree.
+ </constant>
<constant name="MODE_WINDOWED" value="0" enum="Mode">
Windowed mode, i.e. [Window] doesn't occupy whole screen (unless set to the size of the screen).
</constant>