Minor visual adjustment in drag preview of the scene and file tree editors

This commit is contained in:
Michael Alexsander Silva Dias 2019-09-30 13:36:49 -03:00
parent 680bcb1ef4
commit 4689ece741
2 changed files with 3 additions and 1 deletions

View File

@ -4905,6 +4905,7 @@ Variant EditorNode::drag_files_and_dirs(const Vector<String> &p_paths, Control *
label->set_text(p_paths[i].get_file());
icon->set_texture(gui_base->get_icon("File", "EditorIcons"));
}
icon->set_stretch_mode(TextureRect::STRETCH_KEEP_CENTERED);
icon->set_size(Size2(16, 16));
hbox->add_child(icon);
hbox->add_child(label);

View File

@ -959,6 +959,7 @@ Variant SceneTreeEditor::get_drag_data_fw(const Point2 &p_point, Control *p_from
HBoxContainer *hb = memnew(HBoxContainer);
TextureRect *tf = memnew(TextureRect);
tf->set_texture(icons[i]);
tf->set_stretch_mode(TextureRect::STRETCH_KEEP_CENTERED);
hb->add_child(tf);
Label *label = memnew(Label(selected[i]->get_name()));
hb->add_child(label);