summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-09-12 22:24:57 +0200
committerGitHub <noreply@github.com>2017-09-12 22:24:57 +0200
commit175777596ec3521731665dd750fd7087793b10fc (patch)
treecbcecb4d373172f4624f1339df2669557c746b49 /editor
parenta68f40bf3018f3fcfe0ebb75cecbe884230528ee (diff)
parent15904d66b4890c4106d8d1276a4bda2e552e89aa (diff)
Merge pull request #11204 from djrm/pr_fix_fs_icons
Fixed file system dialog icons [ci skip]
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_file_dialog.cpp28
-rw-r--r--editor/editor_node.cpp2
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