summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-08-16 14:36:03 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-08-16 14:36:03 +0200
commitc153b15110f6cab07ffa14abce2f5c9613817f8b (patch)
treedc22d7f888a8157d1747900bbcd41a95489ea9fa
parent491287aafe243628b9c5ca88c728108fd97b6f67 (diff)
parent4c6b3191db1f7d9869d8e8b5aafc200c0c072ccb (diff)
downloadredot-engine-c153b15110f6cab07ffa14abce2f5c9613817f8b.tar.gz
Merge pull request #95546 from KoBeWi/that_array
Remove type icon array from PropertySelector
-rw-r--r--editor/property_selector.cpp46
1 files changed, 1 insertions, 45 deletions
diff --git a/editor/property_selector.cpp b/editor/property_selector.cpp
index 0394c9e249..a1a7d923ae 100644
--- a/editor/property_selector.cpp
+++ b/editor/property_selector.cpp
@@ -123,50 +123,6 @@ void PropertySelector::_update_search() {
TreeItem *category = nullptr;
bool found = false;
-
- Ref<Texture2D> type_icons[] = {
- search_options->get_editor_theme_icon(SNAME("Variant")),
- search_options->get_editor_theme_icon(SNAME("bool")),
- search_options->get_editor_theme_icon(SNAME("int")),
- search_options->get_editor_theme_icon(SNAME("float")),
- search_options->get_editor_theme_icon(SNAME("String")),
- search_options->get_editor_theme_icon(SNAME("Vector2")),
- search_options->get_editor_theme_icon(SNAME("Vector2i")),
- search_options->get_editor_theme_icon(SNAME("Rect2")),
- search_options->get_editor_theme_icon(SNAME("Rect2i")),
- search_options->get_editor_theme_icon(SNAME("Vector3")),
- search_options->get_editor_theme_icon(SNAME("Vector3i")),
- search_options->get_editor_theme_icon(SNAME("Transform2D")),
- search_options->get_editor_theme_icon(SNAME("Vector4")),
- search_options->get_editor_theme_icon(SNAME("Vector4i")),
- search_options->get_editor_theme_icon(SNAME("Plane")),
- search_options->get_editor_theme_icon(SNAME("Quaternion")),
- search_options->get_editor_theme_icon(SNAME("AABB")),
- search_options->get_editor_theme_icon(SNAME("Basis")),
- search_options->get_editor_theme_icon(SNAME("Transform3D")),
- search_options->get_editor_theme_icon(SNAME("Projection")),
- search_options->get_editor_theme_icon(SNAME("Color")),
- search_options->get_editor_theme_icon(SNAME("StringName")),
- search_options->get_editor_theme_icon(SNAME("NodePath")),
- search_options->get_editor_theme_icon(SNAME("RID")),
- search_options->get_editor_theme_icon(SNAME("MiniObject")),
- search_options->get_editor_theme_icon(SNAME("Callable")),
- search_options->get_editor_theme_icon(SNAME("Signal")),
- search_options->get_editor_theme_icon(SNAME("Dictionary")),
- search_options->get_editor_theme_icon(SNAME("Array")),
- search_options->get_editor_theme_icon(SNAME("PackedByteArray")),
- search_options->get_editor_theme_icon(SNAME("PackedInt32Array")),
- search_options->get_editor_theme_icon(SNAME("PackedInt64Array")),
- search_options->get_editor_theme_icon(SNAME("PackedFloat32Array")),
- search_options->get_editor_theme_icon(SNAME("PackedFloat64Array")),
- search_options->get_editor_theme_icon(SNAME("PackedStringArray")),
- search_options->get_editor_theme_icon(SNAME("PackedVector2Array")),
- search_options->get_editor_theme_icon(SNAME("PackedVector3Array")),
- search_options->get_editor_theme_icon(SNAME("PackedColorArray")),
- search_options->get_editor_theme_icon(SNAME("PackedVector4Array")),
- };
- 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) {
if (category && category->get_first_child() == nullptr) {
@@ -201,7 +157,7 @@ void PropertySelector::_update_search() {
TreeItem *item = search_options->create_item(category ? category : root);
item->set_text(0, E.name);
item->set_metadata(0, E.name);
- item->set_icon(0, type_icons[E.type]);
+ item->set_icon(0, search_options->get_editor_theme_icon(Variant::get_type_name(E.type)));
if (!found && !search_box->get_text().is_empty() && E.name.containsn(search_text)) {
item->select(0);