diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml
index 43e3c97bff..0834521c91 100644
--- a/doc/classes/Control.xml
+++ b/doc/classes/Control.xml
@@ -306,6 +306,18 @@
[/codeblocks]
+
+
+
+ Prevents [code]*_theme_*_override[/code] methods from emitting [constant NOTIFICATION_THEME_CHANGED] until [method end_bulk_theme_override] is called.
+
+
+
+
+
+ Ends a bulk theme override update. See [method begin_bulk_theme_override].
+
+
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index a2e6872da6..d37ccd63ec 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -1686,6 +1686,17 @@ Rect2 Control::get_anchorable_rect() const {
return Rect2(Point2(), get_size());
}
+void Control::begin_bulk_theme_override() {
+ data.bulk_theme_override = true;
+}
+
+void Control::end_bulk_theme_override() {
+ ERR_FAIL_COND(!data.bulk_theme_override);
+
+ data.bulk_theme_override = false;
+ _notify_theme_changed();
+}
+
void Control::add_theme_icon_override(const StringName &p_name, const Ref &p_icon) {
ERR_FAIL_COND(!p_icon.is_valid());
@@ -1695,7 +1706,7 @@ void Control::add_theme_icon_override(const StringName &p_name, const Refconnect("changed", callable_mp(this, &Control::_override_changed), Vector(), CONNECT_REFERENCE_COUNTED);
- notification(NOTIFICATION_THEME_CHANGED);
+ _notify_theme_changed();
}
void Control::add_theme_style_override(const StringName &p_name, const Ref &p_style) {
@@ -1707,7 +1718,7 @@ void Control::add_theme_style_override(const StringName &p_name, const Ref