Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

Remove unnecessary calls in `PopupMenu`'s constructor

Michael Alexsander47ada338bef7
diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp
index 93d616754c7..88a767cb921 100644
--- a/scene/gui/popup_menu.cpp
+++ b/scene/gui/popup_menu.cpp
@@ -3914,9 +3914,6 @@ PopupMenu::PopupMenu() {
add_child(panel, false, INTERNAL_MODE_FRONT);
vbox_container = memnew(VBoxContainer);
- vbox_container->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
- vbox_container->set_h_size_flags(Control::SIZE_EXPAND_FILL);
- vbox_container->set_v_size_flags(Control::SIZE_EXPAND_FILL);
panel->add_child(vbox_container, false, INTERNAL_MODE_FRONT);
search_bar = memnew(LineEdit);
@@ -3929,18 +3926,13 @@ PopupMenu::PopupMenu() {
search_bar->connect(SceneStringName(focus_entered), callable_mp(this, &PopupMenu::_search_bar_focus_entered));
vbox_container->add_child(search_bar, false, INTERNAL_MODE_FRONT);
- // Scroll Container
scroll_container = memnew(ScrollContainer);
- scroll_container->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
- scroll_container->set_h_size_flags(Control::SIZE_EXPAND_FILL);
scroll_container->set_v_size_flags(Control::SIZE_EXPAND_FILL);
vbox_container->add_child(scroll_container, false, INTERNAL_MODE_FRONT);
scroll_container->add_theme_style_override(SceneStringName(panel), memnew(StyleBoxEmpty));
- // The control which will display the items
+ // The control which will display the items.
control = memnew(PopupMenuItems(this));
- control->set_clip_contents(false);
- control->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
control->set_h_size_flags(Control::SIZE_EXPAND_FILL);
control->set_v_size_flags(Control::SIZE_EXPAND_FILL);
control->set_focus_mode(Control::FOCUS_ALL);