You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 12:50:35 +00:00
New Quick Open Dialog
- Updated list view with thumbnails, and separate file name.
- Added a grid view which has larger icons.
- Added toggle to filter out files from addons.
- Store history for each opened resource type.
New Editor settings for Quick Open:
- Startup display mode (grid or list):
- Determined by the requested resource type.
- Whatever was last used.
- Toggle to filter out files from addons (for persistence).
Notes
- The dialog is now created once in EditorNode, and globally available for other components.
- A fixed number of result scenes are instantiated, and reused based on query.
- Drop support for multiselect.
This commit is contained in:
@@ -94,7 +94,7 @@
|
||||
#include "editor/editor_paths.h"
|
||||
#include "editor/editor_properties.h"
|
||||
#include "editor/editor_property_name_processor.h"
|
||||
#include "editor/editor_quick_open.h"
|
||||
#include "editor/editor_resource_picker.h"
|
||||
#include "editor/editor_resource_preview.h"
|
||||
#include "editor/editor_run.h"
|
||||
#include "editor/editor_run_native.h"
|
||||
@@ -109,6 +109,7 @@
|
||||
#include "editor/filesystem_dock.h"
|
||||
#include "editor/gui/editor_bottom_panel.h"
|
||||
#include "editor/gui/editor_file_dialog.h"
|
||||
#include "editor/gui/editor_quick_open_dialog.h"
|
||||
#include "editor/gui/editor_run_bar.h"
|
||||
#include "editor/gui/editor_scene_tabs.h"
|
||||
#include "editor/gui/editor_title_bar.h"
|
||||
@@ -2669,19 +2670,13 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
|
||||
|
||||
} break;
|
||||
case FILE_QUICK_OPEN: {
|
||||
quick_open->popup_dialog("Resource", true);
|
||||
quick_open->set_title(TTR("Quick Open..."));
|
||||
|
||||
quick_open_dialog->popup_dialog({ "Resource" }, callable_mp(this, &EditorNode::_quick_opened));
|
||||
} break;
|
||||
case FILE_QUICK_OPEN_SCENE: {
|
||||
quick_open->popup_dialog("PackedScene", true);
|
||||
quick_open->set_title(TTR("Quick Open Scene..."));
|
||||
|
||||
quick_open_dialog->popup_dialog({ "PackedScene" }, callable_mp(this, &EditorNode::_quick_opened));
|
||||
} break;
|
||||
case FILE_QUICK_OPEN_SCRIPT: {
|
||||
quick_open->popup_dialog("Script", true);
|
||||
quick_open->set_title(TTR("Quick Open Script..."));
|
||||
|
||||
quick_open_dialog->popup_dialog({ "Script" }, callable_mp(this, &EditorNode::_quick_opened));
|
||||
} break;
|
||||
case FILE_OPEN_PREV: {
|
||||
if (previous_scenes.is_empty()) {
|
||||
@@ -4599,17 +4594,11 @@ void EditorNode::_update_recent_scenes() {
|
||||
recent_scenes->reset_size();
|
||||
}
|
||||
|
||||
void EditorNode::_quick_opened() {
|
||||
Vector<String> files = quick_open->get_selected_files();
|
||||
|
||||
bool open_scene_dialog = quick_open->get_base_type() == "PackedScene";
|
||||
for (int i = 0; i < files.size(); i++) {
|
||||
const String &res_path = files[i];
|
||||
if (open_scene_dialog || ClassDB::is_parent_class(ResourceLoader::get_resource_type(res_path), "PackedScene")) {
|
||||
open_request(res_path);
|
||||
} else {
|
||||
load_resource(res_path);
|
||||
}
|
||||
void EditorNode::_quick_opened(const String &p_file_path) {
|
||||
if (ClassDB::is_parent_class(ResourceLoader::get_resource_type(p_file_path), "PackedScene")) {
|
||||
open_request(p_file_path);
|
||||
} else {
|
||||
load_resource(p_file_path);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7848,9 +7837,8 @@ EditorNode::EditorNode() {
|
||||
open_imported->connect("custom_action", callable_mp(this, &EditorNode::_inherit_imported));
|
||||
gui_base->add_child(open_imported);
|
||||
|
||||
quick_open = memnew(EditorQuickOpen);
|
||||
gui_base->add_child(quick_open);
|
||||
quick_open->connect("quick_open", callable_mp(this, &EditorNode::_quick_opened));
|
||||
quick_open_dialog = memnew(EditorQuickOpenDialog);
|
||||
gui_base->add_child(quick_open_dialog);
|
||||
|
||||
_update_recent_scenes();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user