From 3bc426c9d80db193792e8639b88935ff388ec6fb Mon Sep 17 00:00:00 2001 From: Markus Sauermann <6299227+Sauermann@users.noreply.github.com> Date: Thu, 2 Feb 2023 17:20:31 +0100 Subject: [PATCH] Fix toplevel nomenclature toplevel was 3.x top_level is 4.x --- scene/gui/control.cpp | 2 +- scene/gui/control.h | 4 ++-- scene/main/canvas_item.cpp | 16 ++++++++-------- scene/main/canvas_item.h | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 6f5e2cf058f..f09e4962a99 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -692,7 +692,7 @@ Transform2D Control::get_transform() const { return xform; } -void Control::_toplevel_changed_on_parent() { +void Control::_top_level_changed_on_parent() { // Update root control status. _notification(NOTIFICATION_EXIT_CANVAS); _notification(NOTIFICATION_ENTER_CANVAS); diff --git a/scene/gui/control.h b/scene/gui/control.h index 5977f4dbea6..2fb5d559b6b 100644 --- a/scene/gui/control.h +++ b/scene/gui/control.h @@ -292,8 +292,8 @@ private: void _update_minimum_size(); void _size_changed(); - void _toplevel_changed() override{}; // Controls don't need to do anything, only other CanvasItems. - void _toplevel_changed_on_parent() override; + void _top_level_changed() override {} // Controls don't need to do anything, only other CanvasItems. + void _top_level_changed_on_parent() override; void _clear_size_warning(); diff --git a/scene/main/canvas_item.cpp b/scene/main/canvas_item.cpp index 541c7a0587e..0ea8f6c5f1e 100644 --- a/scene/main/canvas_item.cpp +++ b/scene/main/canvas_item.cpp @@ -185,7 +185,7 @@ void CanvasItem::_top_level_raise_self() { } void CanvasItem::_enter_canvas() { - // Resolves to nullptr if the node is toplevel. + // Resolves to nullptr if the node is top_level. CanvasItem *parent_item = get_parent_item(); if (parent_item) { @@ -400,26 +400,26 @@ void CanvasItem::set_as_top_level(bool p_top_level) { _exit_canvas(); top_level = p_top_level; - _toplevel_changed(); + _top_level_changed(); _enter_canvas(); _notify_transform(); } -void CanvasItem::_toplevel_changed() { - // Inform children that toplevel status has changed on a parent. +void CanvasItem::_top_level_changed() { + // Inform children that top_level status has changed on a parent. int children = get_child_count(); for (int i = 0; i < children; i++) { CanvasItem *child = Object::cast_to(get_child(i)); if (child) { - child->_toplevel_changed_on_parent(); + child->_top_level_changed_on_parent(); } } } -void CanvasItem::_toplevel_changed_on_parent() { - // Inform children that toplevel status has changed on a parent. - _toplevel_changed(); +void CanvasItem::_top_level_changed_on_parent() { + // Inform children that top_level status has changed on a parent. + _top_level_changed(); } bool CanvasItem::is_set_as_top_level() const { diff --git a/scene/main/canvas_item.h b/scene/main/canvas_item.h index 1ddfaa288c8..2fa1d566670 100644 --- a/scene/main/canvas_item.h +++ b/scene/main/canvas_item.h @@ -125,8 +125,8 @@ private: void _propagate_visibility_changed(bool p_parent_visible_in_tree); void _handle_visibility_change(bool p_visible); - virtual void _toplevel_changed(); - virtual void _toplevel_changed_on_parent(); + virtual void _top_level_changed(); + virtual void _top_level_changed_on_parent(); void _redraw_callback();