Allow images to be imported "for editor use" and respect editor settings

This commit is contained in:
Yuri Sizov
2022-08-22 22:07:02 +03:00
parent 6b92dbfce2
commit 817d4db21f
7 changed files with 167 additions and 62 deletions
+2
View File
@@ -3364,6 +3364,8 @@ void EditorNode::add_editor_plugin(EditorPlugin *p_editor, bool p_config_changed
Ref<Texture2D> icon = p_editor->get_icon();
if (icon.is_valid()) {
tb->set_icon(icon);
// Make sure the control is updated if the icon is reimported.
icon->connect("changed", callable_mp((Control *)tb, &Control::update_minimum_size));
} else if (singleton->gui_base->has_theme_icon(p_editor->get_name(), SNAME("EditorIcons"))) {
tb->set_icon(singleton->gui_base->get_theme_icon(p_editor->get_name(), SNAME("EditorIcons")));
}