summaryrefslogtreecommitdiff
path: root/editor/filesystem_dock.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/filesystem_dock.cpp')
-rw-r--r--editor/filesystem_dock.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp
index 9d10117418..c324f474bb 100644
--- a/editor/filesystem_dock.cpp
+++ b/editor/filesystem_dock.cpp
@@ -150,10 +150,11 @@ void FileSystemDock::_notification(int p_what) {
}
button_display_mode->connect("pressed", this, "_change_file_display");
//file_options->set_icon( get_icon("Tools","EditorIcons"));
+
files->connect("item_activated", this, "_select_file");
button_hist_next->connect("pressed", this, "_fw_history");
button_hist_prev->connect("pressed", this, "_bw_history");
- search_icon->set_texture(get_icon("Zoom", "EditorIcons"));
+ search_icon->set_texture(get_icon("Search", "EditorIcons"));
button_hist_next->set_icon(get_icon("Forward", "EditorIcons"));
button_hist_prev->set_icon(get_icon("Back", "EditorIcons"));
@@ -1064,6 +1065,11 @@ void FileSystemDock::_folder_option(int p_option) {
child = child->get_next();
}
break;
+ case FOLDER_SHOW_IN_EXPLORER:
+ String path = item->get_metadata(tree->get_selected_column());
+ String dir = GlobalConfig::get_singleton()->globalize_path(path);
+ OS::get_singleton()->shell_open(String("file://") + dir);
+ return;
}
}
@@ -1102,6 +1108,9 @@ void FileSystemDock::_dir_rmb_pressed(const Vector2 &p_pos) {
folder_options->add_item(TTR("Expand all"), FOLDER_EXPAND_ALL);
folder_options->add_item(TTR("Collapse all"), FOLDER_COLLAPSE_ALL);
+ folder_options->add_separator();
+ folder_options->add_item(TTR("Show In File Manager"), FOLDER_SHOW_IN_EXPLORER);
+
folder_options->set_position(tree->get_global_position() + p_pos);
folder_options->popup();
}
@@ -1659,8 +1668,6 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) {
button_reload->set_tooltip(TTR("Re-Scan Filesystem"));
button_reload->hide();
- //toolbar_hbc->add_spacer();
-
button_favorite = memnew(Button);
button_favorite->set_flat(true);
button_favorite->set_toggle_mode(true);
@@ -1715,6 +1722,7 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) {
tree->connect("item_rmb_selected", this, "_dir_rmb_pressed");
files = memnew(ItemList);
+ files->add_style_override("bg", editor->get_gui_base()->get_stylebox("EditorBG", "EditorStyles"));
files->set_v_size_flags(SIZE_EXPAND_FILL);
files->set_select_mode(ItemList::SELECT_MULTI);
files->set_drag_forwarding(this);
@@ -1728,6 +1736,7 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) {
file_list_vb->set_v_size_flags(SIZE_EXPAND_FILL);
path_hb = memnew(HBoxContainer);
+ path_hb->add_child(memnew(Control));
file_list_vb->add_child(path_hb);
button_back = memnew(ToolButton);