diff options
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/container.cpp | 6 | ||||
-rw-r--r-- | scene/gui/container.h | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/scene/gui/container.cpp b/scene/gui/container.cpp index 11941529cd..a1bd82f6f7 100644 --- a/scene/gui/container.cpp +++ b/scene/gui/container.cpp @@ -87,6 +87,9 @@ void Container::_sort_children() { return; } + notification(NOTIFICATION_PRE_SORT_CHILDREN); + emit_signal(SceneStringNames::get_singleton()->pre_sort_children); + notification(NOTIFICATION_SORT_CHILDREN); emit_signal(SceneStringNames::get_singleton()->sort_children); pending_sort = false; @@ -174,7 +177,10 @@ void Container::_bind_methods() { ClassDB::bind_method(D_METHOD("queue_sort"), &Container::queue_sort); ClassDB::bind_method(D_METHOD("fit_child_in_rect", "child", "rect"), &Container::fit_child_in_rect); + BIND_CONSTANT(NOTIFICATION_PRE_SORT_CHILDREN); BIND_CONSTANT(NOTIFICATION_SORT_CHILDREN); + + ADD_SIGNAL(MethodInfo("pre_sort_children")); ADD_SIGNAL(MethodInfo("sort_children")); } diff --git a/scene/gui/container.h b/scene/gui/container.h index bce3085f0c..f3ae948556 100644 --- a/scene/gui/container.h +++ b/scene/gui/container.h @@ -51,7 +51,8 @@ protected: public: enum { - NOTIFICATION_SORT_CHILDREN = 50 + NOTIFICATION_PRE_SORT_CHILDREN = 50, + NOTIFICATION_SORT_CHILDREN = 51, }; void fit_child_in_rect(Control *p_child, const Rect2 &p_rect); |