Skip to content

Commit

Permalink
Merge pull request #74482 from AThousandShips/property_selector_fix
Browse files Browse the repository at this point in the history
Fix type icons in `PropertySelector`
  • Loading branch information
akien-mga committed Mar 6, 2023
2 parents fd755ae + ca86d53 commit f17864e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion editor/property_selector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ void PropertySelector::_update_search() {

bool found = false;

Ref<Texture2D> type_icons[Variant::VARIANT_MAX] = {
Ref<Texture2D> type_icons[] = {
search_options->get_theme_icon(SNAME("Variant"), SNAME("EditorIcons")),
search_options->get_theme_icon(SNAME("bool"), SNAME("EditorIcons")),
search_options->get_theme_icon(SNAME("int"), SNAME("EditorIcons")),
Expand All @@ -137,11 +137,14 @@ void PropertySelector::_update_search() {
search_options->get_theme_icon(SNAME("Vector3"), SNAME("EditorIcons")),
search_options->get_theme_icon(SNAME("Vector3i"), SNAME("EditorIcons")),
search_options->get_theme_icon(SNAME("Transform2D"), SNAME("EditorIcons")),
search_options->get_theme_icon(SNAME("Vector4"), SNAME("EditorIcons")),
search_options->get_theme_icon(SNAME("Vector4"), SNAME("EditorIcons")), // Vector4i, needs icon.
search_options->get_theme_icon(SNAME("Plane"), SNAME("EditorIcons")),
search_options->get_theme_icon(SNAME("Quaternion"), SNAME("EditorIcons")),
search_options->get_theme_icon(SNAME("AABB"), SNAME("EditorIcons")),
search_options->get_theme_icon(SNAME("Basis"), SNAME("EditorIcons")),
search_options->get_theme_icon(SNAME("Transform3D"), SNAME("EditorIcons")),
search_options->get_theme_icon(SNAME("Variant"), SNAME("EditorIcons")), // Projection, needs icon.
search_options->get_theme_icon(SNAME("Color"), SNAME("EditorIcons")),
search_options->get_theme_icon(SNAME("StringName"), SNAME("EditorIcons")),
search_options->get_theme_icon(SNAME("NodePath"), SNAME("EditorIcons")),
Expand All @@ -161,6 +164,7 @@ void PropertySelector::_update_search() {
search_options->get_theme_icon(SNAME("PackedVector3Array"), SNAME("EditorIcons")),
search_options->get_theme_icon(SNAME("PackedColorArray"), SNAME("EditorIcons"))
};
static_assert((sizeof(type_icons) / sizeof(type_icons[0])) == Variant::VARIANT_MAX, "Number of type icons doesn't match the number of Variant types.");

for (const PropertyInfo &E : props) {
if (E.usage == PROPERTY_USAGE_CATEGORY) {
Expand Down

0 comments on commit f17864e

Please sign in to comment.