diff --git a/editor/gui/editor_object_selector.cpp b/editor/gui/editor_object_selector.cpp index 9988e285c7c..7cc830416c6 100644 --- a/editor/gui/editor_object_selector.cpp +++ b/editor/gui/editor_object_selector.cpp @@ -100,7 +100,6 @@ void EditorObjectSelector::_show_popup() { sub_objects_menu->set_position(gp); sub_objects_menu->set_size(Size2(size.width, 1)); - sub_objects_menu->set_parent_rect(Rect2(Point2(gp - sub_objects_menu->get_position()), size)); sub_objects_menu->take_mouse_focus(); sub_objects_menu->popup(); diff --git a/scene/gui/menu_bar.cpp b/scene/gui/menu_bar.cpp index 2a3956dd221..d8ec581089d 100644 --- a/scene/gui/menu_bar.cpp +++ b/scene/gui/menu_bar.cpp @@ -131,7 +131,6 @@ void MenuBar::_open_popup(int p_index, bool p_focus_item) { screen_pos.x += screen_size.x - pm->get_size().width; } pm->set_position(screen_pos); - pm->set_parent_rect(Rect2(Point2(screen_pos - pm->get_position()), Size2(screen_size.x, screen_pos.y))); pm->popup(); if (p_focus_item) { diff --git a/scene/gui/menu_button.cpp b/scene/gui/menu_button.cpp index 3074bc369f8..f75b761d6e4 100644 --- a/scene/gui/menu_button.cpp +++ b/scene/gui/menu_button.cpp @@ -106,7 +106,6 @@ void MenuButton::show_popup() { gp.x += size.width - popup->get_size().width; } popup->set_position(gp); - popup->set_parent_rect(Rect2(Point2(gp - popup->get_position()), size)); // If not triggered by the mouse, start the popup with its first enabled item focused. if (!_was_pressed_by_mouse()) { diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index 445edc1ef94..adeaf9a49f4 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -2033,10 +2033,6 @@ String PopupMenu::get_tooltip(const Point2 &p_pos) const { return items[over].tooltip; } -void PopupMenu::set_parent_rect(const Rect2 &p_rect) { - parent_rect = p_rect; -} - void PopupMenu::add_autohide_area(const Rect2 &p_area) { autohide_areas.push_back(p_area); } diff --git a/scene/gui/popup_menu.h b/scene/gui/popup_menu.h index 892559ba3cb..572467bf94d 100644 --- a/scene/gui/popup_menu.h +++ b/scene/gui/popup_menu.h @@ -98,7 +98,6 @@ class PopupMenu : public Popup { bool during_grabbed_click = false; int mouse_over = -1; int submenu_over = -1; - Rect2 parent_rect; String _get_accel_text(const Item &p_item) const; int _get_mouse_over(const Point2 &p_over) const; virtual Size2 _get_contents_minimum_size() const override; @@ -292,8 +291,6 @@ public: void clear(); - void set_parent_rect(const Rect2 &p_rect); - virtual String get_tooltip(const Point2 &p_pos) const; void add_autohide_area(const Rect2 &p_area);