You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-15 13:51:40 +00:00
Don't navigate to path when file is double-clicked
This commit is contained in:
@@ -1191,7 +1191,7 @@ HashSet<String> FileSystemDock::_get_valid_conversions_for_file_paths(const Vect
|
|||||||
return all_valid_conversion_to_targets;
|
return all_valid_conversion_to_targets;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileSystemDock::_select_file(const String &p_path, bool p_select_in_favorites) {
|
void FileSystemDock::_select_file(const String &p_path, bool p_select_in_favorites, bool p_navigate) {
|
||||||
String fpath = p_path;
|
String fpath = p_path;
|
||||||
if (fpath.ends_with("/")) {
|
if (fpath.ends_with("/")) {
|
||||||
// Ignore a directory.
|
// Ignore a directory.
|
||||||
@@ -1258,8 +1258,10 @@ void FileSystemDock::_select_file(const String &p_path, bool p_select_in_favorit
|
|||||||
EditorNode::get_singleton()->load_resource(fpath);
|
EditorNode::get_singleton()->load_resource(fpath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (p_navigate) {
|
||||||
_navigate_to_path(fpath, p_select_in_favorites);
|
_navigate_to_path(fpath, p_select_in_favorites);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void FileSystemDock::_tree_activate_file() {
|
void FileSystemDock::_tree_activate_file() {
|
||||||
TreeItem *selected = tree->get_selected();
|
TreeItem *selected = tree->get_selected();
|
||||||
@@ -1272,7 +1274,7 @@ void FileSystemDock::_tree_activate_file() {
|
|||||||
bool collapsed = selected->is_collapsed();
|
bool collapsed = selected->is_collapsed();
|
||||||
selected->set_collapsed(!collapsed);
|
selected->set_collapsed(!collapsed);
|
||||||
} else {
|
} else {
|
||||||
_select_file(file_path, is_favorite && !file_path.ends_with("/"));
|
_select_file(file_path, is_favorite && !file_path.ends_with("/"), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -262,7 +262,7 @@ private:
|
|||||||
void _set_file_display(bool p_active);
|
void _set_file_display(bool p_active);
|
||||||
void _fs_changed();
|
void _fs_changed();
|
||||||
|
|
||||||
void _select_file(const String &p_path, bool p_select_in_favorites = false);
|
void _select_file(const String &p_path, bool p_select_in_favorites = false, bool p_navigate = true);
|
||||||
void _tree_activate_file();
|
void _tree_activate_file();
|
||||||
void _file_list_activate_file(int p_idx);
|
void _file_list_activate_file(int p_idx);
|
||||||
void _file_multi_selected(int p_index, bool p_selected);
|
void _file_multi_selected(int p_index, bool p_selected);
|
||||||
|
|||||||
Reference in New Issue
Block a user