Browse Source

Merge pull request #101745 from Rindbee/remove-is_top_level_control

Remove confusing `Control::is_top_level_control()`
Thaddeus Crews 4 months ago
parent
commit
c7fc877895
2 changed files with 0 additions and 11 deletions
  1. 0 9
      scene/gui/control.cpp
  2. 0 2
      scene/gui/control.h

+ 0 - 9
scene/gui/control.cpp

@@ -624,11 +624,6 @@ bool Control::_property_get_revert(const StringName &p_name, Variant &r_property
 
 // Global relations.
 
-bool Control::is_top_level_control() const {
-	ERR_READ_THREAD_GUARD_V(false);
-	return is_inside_tree() && (!data.parent_canvas_item && !data.RI && is_set_as_top_level());
-}
-
 Control *Control::get_parent_control() const {
 	ERR_READ_THREAD_GUARD_V(nullptr);
 	return data.parent_control;
@@ -648,10 +643,6 @@ Control *Control::get_root_parent_control() const {
 		const Control *c = Object::cast_to<Control>(ci);
 		if (c) {
 			root = c;
-
-			if (c->data.RI || c->is_top_level_control()) {
-				break;
-			}
 		}
 
 		ci = ci->get_parent_item();

+ 0 - 2
scene/gui/control.h

@@ -454,8 +454,6 @@ public:
 
 	// Global relations.
 
-	bool is_top_level_control() const;
-
 	Control *get_parent_control() const;
 	Window *get_parent_window() const;
 	Control *get_root_parent_control() const;