From 74eb2a70bd7ab881776b30fb34bf98d03651bf52 Mon Sep 17 00:00:00 2001 From: Aaron Record Date: Fri, 8 Jul 2022 13:29:36 -0600 Subject: Refactor and remove excessive calls of `NOTIFICATION_THEME_CHANGED` --- doc/classes/Control.xml | 8 +++++++- doc/classes/Window.xml | 9 ++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'doc/classes') 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 @@ + Emitted when the [constant NOTIFICATION_THEME_CHANGED] notification is sent. @@ -1174,7 +1175,12 @@ Sent when the node loses focus. - 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. 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 @@ - Emitted when the [member theme] is modified or changed to another [Theme]. + Emitted when the [constant NOTIFICATION_THEME_CHANGED] notification is sent. @@ -467,6 +467,13 @@ Emitted when [Window]'s visibility changes, right before [signal visibility_changed]. + + 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. + Windowed mode, i.e. [Window] doesn't occupy whole screen (unless set to the size of the screen). -- cgit v1.2.3