Merge pull request #80184 from MewPurPur/gray=abstract

Use the gray color for all abstract classes
This commit is contained in:
Rémi Verschelde
2023-09-01 16:00:58 +02:00
21 changed files with 42 additions and 38 deletions

View File

@@ -4237,9 +4237,19 @@ Ref<Texture2D> EditorNode::_get_class_or_script_icon(const String &p_class, cons
return gui_base->get_theme_icon(p_class, SNAME("EditorIcons"));
}
if (p_fallback.length() && gui_base->has_theme_icon(p_fallback, SNAME("EditorIcons"))) {
if (!p_fallback.is_empty() && gui_base->has_theme_icon(p_fallback, SNAME("EditorIcons"))) {
return gui_base->get_theme_icon(p_fallback, SNAME("EditorIcons"));
}
// If the fallback is empty or wasn't found, use the default fallback.
if (ClassDB::class_exists(p_class)) {
bool instantiable = !ClassDB::is_virtual(p_class) && ClassDB::can_instantiate(p_class);
if (ClassDB::is_parent_class(p_class, SNAME("Node"))) {
return gui_base->get_theme_icon(instantiable ? "Node" : "NodeDisabled", SNAME("EditorIcons"));
} else {
return gui_base->get_theme_icon(instantiable ? "Object" : "ObjectDisabled", SNAME("EditorIcons"));
}
}
}
return nullptr;