浏览代码

Select root node if search_box is empty in create_dialog

Vincenzo Greco 7 年之前
父节点
当前提交
586e735125
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      editor/create_dialog.cpp

+ 4 - 0
editor/create_dialog.cpp

@@ -312,6 +312,10 @@ void CreateDialog::_update_search() {
 		}
 		}
 	}
 	}
 
 
+	if (search_box->get_text() == "") {
+		to_select = root;
+	}
+
 	if (to_select) {
 	if (to_select) {
 		to_select->select(0);
 		to_select->select(0);
 		search_options->scroll_to_item(to_select);
 		search_options->scroll_to_item(to_select);