Repository: godotengine/godot
File: scene/gui/tree.cpp (C++)

Code before:

	line_editor = memnew(LineEdit);
	line_editor->set_v_size_flags(SIZE_EXPAND_FILL);
	line_editor->hide();
	popup_editor_vb->add_child(line_editor);

	text_editor = memnew(TextEdit);
	text_editor->set_v_size_flags(SIZE_EXPAND_FILL);
	text_editor->hide();
	popup_editor_vb->add_child(text_editor);

	h_scroll = memnew(HScrollBar);
	v_scroll = memnew(VScrollBar);

	add_child(h_scroll, false, INTERNAL_MODE_FRONT);
	add_child(v_scroll, false, INTERNAL_MODE_FRONT);

	range_click_timer = memnew(Timer);
	range_click_timer->connect("timeout", callable_mp(this, &Tree::_range_click_timeout));
	add_child(range_click_timer, false, INTERNAL_MODE_FRONT);

	dropping_unfold_timer = memnew(Timer);
	dropping_unfold_timer->set_one_shot(true);
	dropping_unfold_timer->connect("timeout", callable_mp(this, &Tree::_on_dropping_unfold_timer_timeout));
	add_child(dropping_unfold_timer);

	h_scroll->connect(SceneStringName(value_changed), callable_mp(this, &Tree::_scroll_moved));
	v_scroll->connect(SceneStringName(value_changed), callable_mp(this, &Tree::_scroll_moved));
	line_editor->connect(SceneStringName(text_submitted), callable_mp(this, &Tree::_line_editor_submit));
	text_editor->connect(SceneStringName(gui_input), callable_mp(this, &Tree::_text_editor_gui_input));
	popup_editor->connect("popup_hide", callable_mp(this, &Tree::_text_editor_popup_modal_close));

	set_notify_transform(true);

	set_mouse_filter(MOUSE_FILTER_STOP);

	set_clip_contents(true);
}

Tree::~Tree() {
	if (root) {
		memdelete(root);
	}
}


Review comment (suggestion):
```suggestion
	dropping_unfold_timer->connect(SNAME("timeout"), callable_mp(this, &Tree::_on_dropping_unfold_timer_timeout));
```

Code after:
	popup_editor_vb->set_anchors_and_offsets_preset(PRESET_FULL_RECT);
	popup_editor->add_child(popup_editor_vb);

	line_editor = memnew(LineEdit);
	line_editor->set_v_size_flags(SIZE_EXPAND_FILL);
	line_editor->hide();
	popup_editor_vb->add_child(line_editor);

	text_editor = memnew(TextEdit);
	text_editor->set_v_size_flags(SIZE_EXPAND_FILL);
	text_editor->hide();
	popup_editor_vb->add_child(text_editor);

	h_scroll = memnew(HScrollBar);
	v_scroll = memnew(VScrollBar);

	add_child(h_scroll, false, INTERNAL_MODE_FRONT);
	add_child(v_scroll, false, INTERNAL_MODE_FRONT);

	range_click_timer = memnew(Timer);
	range_click_timer->connect("timeout", callable_mp(this, &Tree::_range_click_timeout));
	add_child(range_click_timer, false, INTERNAL_MODE_FRONT);

	dropping_unfold_timer = memnew(Timer);
	dropping_unfold_timer->set_one_shot(true);
	dropping_unfold_timer->connect("timeout", callable_mp(this, &Tree::_on_dropping_unfold_timer_timeout));
	add_child(dropping_unfold_timer);

	h_scroll->connect(SceneStringName(value_changed), callable_mp(this, &Tree::_scroll_moved));
	v_scroll->connect(SceneStringName(value_changed), callable_mp(this, &Tree::_scroll_moved));
	line_editor->connect(SceneStringName(text_submitted), callable_mp(this, &Tree::_line_editor_submit));
	text_editor->connect(SceneStringName(gui_input), callable_mp(this, &Tree::_text_editor_gui_input));
	popup_editor->connect("popup_hide", callable_mp(this, &Tree::_text_editor_popup_modal_close));

	set_notify_transform(true);

	set_mouse_filter(MOUSE_FILTER_STOP);

	set_clip_contents(true);
}

Tree::~Tree() {
	if (root) {
		memdelete(root);
	}
}