summaryrefslogtreecommitdiff
path: root/editor/plugins/script_text_editor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/plugins/script_text_editor.cpp')
-rw-r--r--editor/plugins/script_text_editor.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index d5af7c5b38..cc685ca899 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -396,8 +396,17 @@ String ScriptTextEditor::get_name() {
}
Ref<Texture2D> ScriptTextEditor::get_theme_icon() {
- if (get_parent_control() && get_parent_control()->has_theme_icon(script->get_class(), "EditorIcons")) {
- return get_parent_control()->get_theme_icon(script->get_class(), "EditorIcons");
+ if (get_parent_control()) {
+ String icon_name = script->get_class();
+ if (script->is_built_in()) {
+ icon_name += "Internal";
+ }
+
+ if (get_parent_control()->has_theme_icon(icon_name, "EditorIcons")) {
+ return get_parent_control()->get_theme_icon(icon_name, "EditorIcons");
+ } else if (get_parent_control()->has_theme_icon(script->get_class(), "EditorIcons")) {
+ return get_parent_control()->get_theme_icon(script->get_class(), "EditorIcons");
+ }
}
return Ref<Texture2D>();