summaryrefslogtreecommitdiffstats
path: root/editor/filesystem_dock.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/filesystem_dock.cpp')
-rw-r--r--editor/filesystem_dock.cpp35
1 files changed, 16 insertions, 19 deletions
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp
index 2df0b2edaa..9b08d21bdc 100644
--- a/editor/filesystem_dock.cpp
+++ b/editor/filesystem_dock.cpp
@@ -495,7 +495,7 @@ void FileSystemDock::_update_display_mode(bool p_force) {
if (p_force || old_display_mode != display_mode) {
switch (display_mode) {
case DISPLAY_MODE_TREE_ONLY:
- button_toggle_display_mode->set_icon(get_editor_theme_icon(SNAME("Panels1")));
+ button_toggle_display_mode->set_button_icon(get_editor_theme_icon(SNAME("Panels1")));
tree->show();
tree->set_v_size_flags(SIZE_EXPAND_FILL);
toolbar2_hbc->show();
@@ -512,7 +512,7 @@ void FileSystemDock::_update_display_mode(bool p_force) {
const int actual_offset = is_vertical ? split_box_offset_v : split_box_offset_h;
split_box->set_split_offset(actual_offset);
const StringName icon = is_vertical ? SNAME("Panels2") : SNAME("Panels2Alt");
- button_toggle_display_mode->set_icon(get_editor_theme_icon(icon));
+ button_toggle_display_mode->set_button_icon(get_editor_theme_icon(icon));
tree->show();
tree->set_v_size_flags(SIZE_EXPAND_FILL);
@@ -597,7 +597,7 @@ void FileSystemDock::_notification(int p_what) {
case NOTIFICATION_THEME_CHANGED: {
_update_display_mode(true);
- button_reload->set_icon(get_editor_theme_icon(SNAME("Reload")));
+ button_reload->set_button_icon(get_editor_theme_icon(SNAME("Reload")));
StringName mode_icon = "Panels1";
if (display_mode == DISPLAY_MODE_VSPLIT) {
@@ -605,28 +605,28 @@ void FileSystemDock::_notification(int p_what) {
} else if (display_mode == DISPLAY_MODE_HSPLIT) {
mode_icon = "Panels2Alt";
}
- button_toggle_display_mode->set_icon(get_editor_theme_icon(mode_icon));
+ button_toggle_display_mode->set_button_icon(get_editor_theme_icon(mode_icon));
if (file_list_display_mode == FILE_LIST_DISPLAY_LIST) {
- button_file_list_display_mode->set_icon(get_editor_theme_icon(SNAME("FileThumbnail")));
+ button_file_list_display_mode->set_button_icon(get_editor_theme_icon(SNAME("FileThumbnail")));
} else {
- button_file_list_display_mode->set_icon(get_editor_theme_icon(SNAME("FileList")));
+ button_file_list_display_mode->set_button_icon(get_editor_theme_icon(SNAME("FileList")));
}
tree_search_box->set_right_icon(get_editor_theme_icon(SNAME("Search")));
- tree_button_sort->set_icon(get_editor_theme_icon(SNAME("Sort")));
+ tree_button_sort->set_button_icon(get_editor_theme_icon(SNAME("Sort")));
file_list_search_box->set_right_icon(get_editor_theme_icon(SNAME("Search")));
- file_list_button_sort->set_icon(get_editor_theme_icon(SNAME("Sort")));
+ file_list_button_sort->set_button_icon(get_editor_theme_icon(SNAME("Sort")));
- button_dock_placement->set_icon(get_editor_theme_icon(SNAME("GuiTabMenuHl")));
+ button_dock_placement->set_button_icon(get_editor_theme_icon(SNAME("GuiTabMenuHl")));
if (is_layout_rtl()) {
- button_hist_next->set_icon(get_editor_theme_icon(SNAME("Back")));
- button_hist_prev->set_icon(get_editor_theme_icon(SNAME("Forward")));
+ button_hist_next->set_button_icon(get_editor_theme_icon(SNAME("Back")));
+ button_hist_prev->set_button_icon(get_editor_theme_icon(SNAME("Forward")));
} else {
- button_hist_next->set_icon(get_editor_theme_icon(SNAME("Forward")));
- button_hist_prev->set_icon(get_editor_theme_icon(SNAME("Back")));
+ button_hist_next->set_button_icon(get_editor_theme_icon(SNAME("Forward")));
+ button_hist_prev->set_button_icon(get_editor_theme_icon(SNAME("Back")));
}
overwrite_dialog_scroll->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), "Tree"));
@@ -818,11 +818,11 @@ void FileSystemDock::_toggle_file_display() {
void FileSystemDock::_set_file_display(bool p_active) {
if (p_active) {
file_list_display_mode = FILE_LIST_DISPLAY_LIST;
- button_file_list_display_mode->set_icon(get_editor_theme_icon(SNAME("FileThumbnail")));
+ button_file_list_display_mode->set_button_icon(get_editor_theme_icon(SNAME("FileThumbnail")));
button_file_list_display_mode->set_tooltip_text(TTR("View items as a grid of thumbnails."));
} else {
file_list_display_mode = FILE_LIST_DISPLAY_THUMBNAILS;
- button_file_list_display_mode->set_icon(get_editor_theme_icon(SNAME("FileList")));
+ button_file_list_display_mode->set_button_icon(get_editor_theme_icon(SNAME("FileList")));
button_file_list_display_mode->set_tooltip_text(TTR("View items as a list."));
}
@@ -2472,9 +2472,6 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected
make_dir_dialog->popup_centered();
} break;
- case FILE_INFO: {
- } break;
-
case FILE_REIMPORT: {
ImportDock::get_singleton()->reimport_resources(p_selected);
} break;
@@ -2716,7 +2713,7 @@ void FileSystemDock::focus_on_filter() {
}
void FileSystemDock::create_directory(const String &p_path, const String &p_base_dir) {
- Error err = EditorFileSystem::get_singleton()->make_dir_recursive(p_path, p_base_dir);
+ Error err = EditorFileSystem::get_singleton()->make_dir_recursive(p_path.trim_prefix(p_base_dir), p_base_dir);
if (err != OK) {
EditorNode::get_singleton()->show_warning(vformat(TTR("Could not create folder: %s"), error_names[err]));
}