diff options
-rw-r--r-- | editor/editor_file_dialog.cpp | 28 | ||||
-rw-r--r-- | editor/editor_node.cpp | 2 |
2 files changed, 7 insertions, 23 deletions
diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index abcdc0b64c..0d6c552d1d 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -506,30 +506,14 @@ void EditorFileDialog::update_file_list() { item_list->set_max_text_lines(2); item_list->set_fixed_icon_size(Size2(thumbnail_size, thumbnail_size)); - if (!has_icon("ResizedFolder", "EditorIcons")) { - Ref<ImageTexture> folder = get_icon("FolderBig", "EditorIcons"); - Ref<Image> img = folder->get_data(); - img = img->duplicate(); - img->resize(thumbnail_size, thumbnail_size); - Ref<ImageTexture> resized_folder = Ref<ImageTexture>(memnew(ImageTexture)); - resized_folder->create_from_image(img, 0); - Theme::get_default()->set_icon("ResizedFolder", "EditorIcons", resized_folder); - } - - folder_thumbnail = get_icon("ResizedFolder", "EditorIcons"); - - if (!has_icon("ResizedFile", "EditorIcons")) { - Ref<ImageTexture> file = get_icon("FileBig", "EditorIcons"); - Ref<Image> img = file->get_data(); - img = img->duplicate(); - img->resize(thumbnail_size, thumbnail_size); - Ref<ImageTexture> resized_file = Ref<ImageTexture>(memnew(ImageTexture)); - resized_file->create_from_image(img, 0); - Theme::get_default()->set_icon("ResizedFile", "EditorIcons", resized_file); + if (thumbnail_size < 64) { + folder_thumbnail = get_icon("FolderMediumThumb", "EditorIcons"); + file_thumbnail = get_icon("FileMediumThumb", "EditorIcons"); + } else { + folder_thumbnail = get_icon("FolderBigThumb", "EditorIcons"); + file_thumbnail = get_icon("FileBigThumb", "EditorIcons"); } - file_thumbnail = get_icon("ResizedFile", "EditorIcons"); - preview_vb->hide(); } else { diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 240d3563ae..76b108f779 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -4128,7 +4128,7 @@ Variant EditorNode::drag_resource(const Ref<Resource> &p_res, Control *p_from) { { //todo make proper previews - Ref<ImageTexture> pic = gui_base->get_icon("FileBig", "EditorIcons"); + Ref<ImageTexture> pic = gui_base->get_icon("FileBigThumb", "EditorIcons"); Ref<Image> img = pic->get_data(); img = img->duplicate(); img->resize(48, 48); //meh |