diff options
author | willnationsdev <willnationsdev@gmail.com> | 2018-09-02 16:40:51 -0500 |
---|---|---|
committer | Will Nations <willnationsdev@gmail.com> | 2018-09-14 09:27:56 -0500 |
commit | 5436abefe4f40eb84f96c36ae372df39ec4295d7 (patch) | |
tree | cc234a2987928ec66221c172d205bc8a90d56f86 /editor/plugins/text_editor.cpp | |
parent | 06c8b5a4ffb0ab6787edf071463f17df522b3e79 (diff) |
Refactor editor icon retrieval
Diffstat (limited to 'editor/plugins/text_editor.cpp')
-rw-r--r-- | editor/plugins/text_editor.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/editor/plugins/text_editor.cpp b/editor/plugins/text_editor.cpp index 5d379fb8b3..3bf4140591 100644 --- a/editor/plugins/text_editor.cpp +++ b/editor/plugins/text_editor.cpp @@ -30,6 +30,8 @@ #include "text_editor.h" +#include "editor_node.h" + void TextEditor::add_syntax_highlighter(SyntaxHighlighter *p_highlighter) { highlighters[p_highlighter->get_name()] = p_highlighter; highlighter_menu->add_radio_check_item(p_highlighter->get_name()); @@ -158,10 +160,7 @@ String TextEditor::get_name() { Ref<Texture> TextEditor::get_icon() { - if (get_parent_control() && get_parent_control()->has_icon(text_file->get_class(), "EditorIcons")) { - return get_parent_control()->get_icon(text_file->get_class(), "EditorIcons"); - } - return Ref<Texture>(); + return EditorNode::get_singleton()->get_object_icon(text_file.operator->(), ""); } RES TextEditor::get_edited_resource() const { |