1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-15 13:51:40 +00:00

Merge pull request #40140 from hinlopen/tree-scroll-center

This commit is contained in:
Rémi Verschelde
2022-02-08 13:43:19 +01:00
committed by GitHub
5 changed files with 24 additions and 15 deletions

View File

@@ -446,14 +446,14 @@ void CreateDialog::_notification(int p_what) {
}
}
void CreateDialog::select_type(const String &p_type) {
void CreateDialog::select_type(const String &p_type, bool p_center_on_item) {
if (!search_options_types.has(p_type)) {
return;
}
TreeItem *to_select = search_options_types[p_type];
to_select->select(0);
search_options->scroll_to_item(to_select);
search_options->scroll_to_item(to_select, p_center_on_item);
if (EditorHelp::get_doc_data()->class_list.has(p_type) && !DTR(EditorHelp::get_doc_data()->class_list[p_type].brief_description).is_empty()) {
// Display both class name and description, since the help bit may be displayed
@@ -510,7 +510,7 @@ Variant CreateDialog::instance_selected() {
void CreateDialog::_item_selected() {
String name = get_selected_type();
select_type(name);
select_type(name, false);
}
void CreateDialog::_hide_requested() {