mirror of
https://github.com/godotengine/godot.git
synced 2024-11-27 09:16:35 +08:00
Fixed file system dialog icons
This commit is contained in:
parent
fe33ef5a19
commit
15904d66b4
@ -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);
|
||||
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");
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
file_thumbnail = get_icon("ResizedFile", "EditorIcons");
|
||||
|
||||
preview_vb->hide();
|
||||
|
||||
} else {
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user