浏览代码

Merge pull request #41846 from EricEzaM/PR/fix-expand-collapse-filesystem-dock

Fixed expand/collapse folder option not showing in FileSystemDock
Rémi Verschelde 5 年之前
父节点
当前提交
8f9ab618ae
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      editor/filesystem_dock.cpp

+ 1 - 1
editor/filesystem_dock.cpp

@@ -2300,6 +2300,7 @@ void FileSystemDock::_tree_rmb_select(const Vector2 &p_pos) {
 	// Right click is pressed in the tree.
 	// Right click is pressed in the tree.
 	Vector<String> paths = _tree_get_selected(false);
 	Vector<String> paths = _tree_get_selected(false);
 
 
+	tree_popup->clear();
 	if (paths.size() == 1) {
 	if (paths.size() == 1) {
 		if (paths[0].ends_with("/")) {
 		if (paths[0].ends_with("/")) {
 			tree_popup->add_icon_item(get_theme_icon("GuiTreeArrowDown", "EditorIcons"), TTR("Expand All"), FOLDER_EXPAND_ALL);
 			tree_popup->add_icon_item(get_theme_icon("GuiTreeArrowDown", "EditorIcons"), TTR("Expand All"), FOLDER_EXPAND_ALL);
@@ -2310,7 +2311,6 @@ void FileSystemDock::_tree_rmb_select(const Vector2 &p_pos) {
 
 
 	// Popup.
 	// Popup.
 	if (!paths.empty()) {
 	if (!paths.empty()) {
-		tree_popup->clear();
 		tree_popup->set_size(Size2(1, 1));
 		tree_popup->set_size(Size2(1, 1));
 		_file_and_folders_fill_popup(tree_popup, paths);
 		_file_and_folders_fill_popup(tree_popup, paths);
 		tree_popup->set_position(tree->get_screen_position() + p_pos);
 		tree_popup->set_position(tree->get_screen_position() + p_pos);