diff options
author | groud <gilles.roudiere@gmail.com> | 2018-09-13 19:06:40 +0200 |
---|---|---|
committer | groud <gilles.roudiere@gmail.com> | 2018-09-14 10:22:13 +0200 |
commit | d7b638ed328e3fbd27fbe255278d7687a815b389 (patch) | |
tree | 9d19f1e7b0b1a3a6ff3a8affc34d8f6cde568e8d | |
parent | bc5dfdde78919e8d27be9e3482b722457bf0701a (diff) |
Replace the -show in filesystem- button by a RMB entry
-rw-r--r-- | editor/editor_node.cpp | 9 | ||||
-rw-r--r-- | editor/editor_node.h | 1 | ||||
-rw-r--r-- | editor/filesystem_dock.cpp | 19 | ||||
-rw-r--r-- | editor/filesystem_dock.h | 2 |
4 files changed, 11 insertions, 20 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 0a3aa3e997..666deb16c8 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -2045,6 +2045,14 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { emit_signal("stop_pressed"); } break; + + case FILE_SHOW_IN_FILESYSTEM: { + String path = editor_data.get_scene_path(editor_data.get_edited_scene()); + if (path != String()) { + filesystem_dock->navigate_to_path(path); + } + } break; + case RUN_PLAY_SCENE: { _save_default_environment(); @@ -3901,6 +3909,7 @@ void EditorNode::_scene_tab_input(const Ref<InputEvent> &p_input) { scene_tabs_context_menu->add_shortcut(ED_GET_SHORTCUT("editor/save_all_scenes"), FILE_SAVE_ALL_SCENES); if (scene_tabs->get_hovered_tab() >= 0) { scene_tabs_context_menu->add_separator(); + scene_tabs_context_menu->add_item(TTR("Show in filesystem"), FILE_SHOW_IN_FILESYSTEM); scene_tabs_context_menu->add_item(TTR("Play This Scene"), RUN_PLAY_SCENE); scene_tabs_context_menu->add_item(TTR("Close Tab"), FILE_CLOSE); } diff --git a/editor/editor_node.h b/editor/editor_node.h index 93f5d499b7..2011a083ce 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -125,6 +125,7 @@ private: FILE_SAVE_ALL_SCENES, FILE_SAVE_BEFORE_RUN, FILE_SAVE_AND_RUN, + FILE_SHOW_IN_FILESYSTEM, FILE_IMPORT_SUBSCENE, FILE_EXPORT_PROJECT, FILE_EXPORT_MESH_LIBRARY, diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index b01c72e150..50ce31e266 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -97,6 +97,7 @@ bool FileSystemDock::_create_tree(TreeItem *p_parent, EditorFileSystemDirectory file_item->set_metadata(0, file_metadata); if (path == file_metadata) { file_item->select(0); + file_item->set_as_cursor(0); } Array udata; udata.push_back(tree_update_id); @@ -263,7 +264,6 @@ void FileSystemDock::_notification(int p_what) { button_hist_next->set_icon(get_icon("Forward", ei)); button_hist_prev->set_icon(get_icon("Back", ei)); - button_show->set_icon(get_icon("GuiVisibilityVisible", "EditorIcons")); file_list_popup->connect("id_pressed", this, "_file_list_rmb_option"); tree_popup->connect("id_pressed", this, "_tree_rmb_option"); @@ -368,15 +368,6 @@ void FileSystemDock::_tree_multi_selected(Object *p_item, int p_column, bool p_s } } -void FileSystemDock::_show_current_scene_file() { - - int index = EditorNode::get_editor_data().get_edited_scene(); - String path = EditorNode::get_editor_data().get_scene_path(index); - if (path != String()) { - navigate_to_path(path); - } -} - String FileSystemDock::get_selected_path() const { if (path.ends_with("/")) return path; @@ -2061,7 +2052,6 @@ void FileSystemDock::_bind_methods() { ClassDB::bind_method(D_METHOD("_update_tree"), &FileSystemDock::_update_tree); ClassDB::bind_method(D_METHOD("_rescan"), &FileSystemDock::_rescan); - ClassDB::bind_method(D_METHOD("_show_current_scene_file"), &FileSystemDock::_show_current_scene_file); //ClassDB::bind_method(D_METHOD("_instance_pressed"),&ScenesDock::_instance_pressed); ClassDB::bind_method(D_METHOD("_tree_rmb_option", "option"), &FileSystemDock::_tree_rmb_option); @@ -2145,13 +2135,6 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { //toolbar_hbc->add_spacer(); - button_show = memnew(Button); - button_show->set_flat(true); - button_show->connect("pressed", this, "_show_current_scene_file"); - toolbar_hbc->add_child(button_show); - button_show->set_focus_mode(FOCUS_NONE); - button_show->set_tooltip(TTR("Show current scene file.")); - //Control *spacer = memnew( Control); /* diff --git a/editor/filesystem_dock.h b/editor/filesystem_dock.h index 22ba095225..cefdea1628 100644 --- a/editor/filesystem_dock.h +++ b/editor/filesystem_dock.h @@ -112,7 +112,6 @@ private: Button *button_file_list_display_mode; Button *button_hist_next; Button *button_hist_prev; - Button *button_show; LineEdit *current_path; LineEdit *search_box; TextureRect *search_icon; @@ -227,7 +226,6 @@ private: void _set_scanning_mode(); void _rescan(); - void _show_current_scene_file(); void _search_changed(const String &p_text); void _file_and_folders_fill_popup(PopupMenu *p_popup, Vector<String> p_paths); |