diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-02-08 10:14:58 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-02-08 10:17:25 +0100 |
commit | fc076ece3ddecd44a62dc0febed7baee47f2eede (patch) | |
tree | 6401f0a7ae1b39d516f86a0a44cd7c14aec569a6 /modules/visual_script/editor/visual_script_property_selector.cpp | |
parent | 0154ce2c8d66528d617e10b139640fd4c4405c6b (diff) | |
download | redot-engine-fc076ece3ddecd44a62dc0febed7baee47f2eede.tar.gz |
Revert "Add missing SNAME macro optimization to all theme methods call"
This reverts commit a988fad9a092053434545c32afae91ccbdfbe792.
As discussed in #57725 and clarified in #57788, `SNAME` is not meant to be used
everywhere but only in critical code paths. For theme methods specifically, it
was by design that only getters use `SNAME` and not setters.
Diffstat (limited to 'modules/visual_script/editor/visual_script_property_selector.cpp')
-rw-r--r-- | modules/visual_script/editor/visual_script_property_selector.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/modules/visual_script/editor/visual_script_property_selector.cpp b/modules/visual_script/editor/visual_script_property_selector.cpp index 8913b88d1a..4072dcebe5 100644 --- a/modules/visual_script/editor/visual_script_property_selector.cpp +++ b/modules/visual_script/editor/visual_script_property_selector.cpp @@ -46,7 +46,7 @@ void VisualScriptPropertySelector::_update_icons() { search_box->set_right_icon(results_tree->get_theme_icon(SNAME("Search"), SNAME("EditorIcons"))); search_box->set_clear_button_enabled(true); - search_box->add_theme_icon_override(SNAME("right_icon"), results_tree->get_theme_icon(SNAME("Search"), SNAME("EditorIcons"))); + search_box->add_theme_icon_override("right_icon", results_tree->get_theme_icon(SNAME("Search"), SNAME("EditorIcons"))); search_visual_script_nodes->set_icon(results_tree->get_theme_icon(SNAME("VisualScript"), SNAME("EditorIcons"))); search_classes->set_icon(results_tree->get_theme_icon(SNAME("Object"), SNAME("EditorIcons"))); @@ -1114,14 +1114,14 @@ TreeItem *VisualScriptPropertySelector::SearchRunner::_create_class_item(TreeIte String details = p_doc->name; if (p_doc->category.begins_with("VisualScriptCustomNode/")) { Vector<String> path = p_doc->name.split("/"); - icon = ui_service->get_theme_icon(SNAME("VisualScript"), SNAME("EditorIcons")); + icon = ui_service->get_theme_icon("VisualScript", "EditorIcons"); text_0 = path[path.size() - 1]; text_1 = "VisualScriptCustomNode"; what = "VisualScriptCustomNode"; details = "CustomNode"; } else if (p_doc->category.begins_with("VisualScriptNode/")) { Vector<String> path = p_doc->name.split("/"); - icon = ui_service->get_theme_icon(SNAME("VisualScript"), SNAME("EditorIcons")); + icon = ui_service->get_theme_icon("VisualScript", "EditorIcons"); text_0 = path[path.size() - 1]; if (p_doc->category.begins_with("VisualScriptNode/deconstruct")) { text_0 = "deconstruct " + text_0; @@ -1142,11 +1142,11 @@ TreeItem *VisualScriptPropertySelector::SearchRunner::_create_class_item(TreeIte } else { if (p_doc->name.is_quoted()) { text_0 = p_doc->name.unquote().get_file(); - if (ui_service->has_theme_icon(p_doc->inherits, SNAME("EditorIcons"))) { - icon = ui_service->get_theme_icon(p_doc->inherits, SNAME("EditorIcons")); + if (ui_service->has_theme_icon(p_doc->inherits, "EditorIcons")) { + icon = ui_service->get_theme_icon(p_doc->inherits, "EditorIcons"); } - } else if (ui_service->has_theme_icon(p_doc->name, SNAME("EditorIcons"))) { - icon = ui_service->get_theme_icon(p_doc->name, SNAME("EditorIcons")); + } else if (ui_service->has_theme_icon(p_doc->name, "EditorIcons")) { + icon = ui_service->get_theme_icon(p_doc->name, "EditorIcons"); } else if (ClassDB::class_exists(p_doc->name) && ClassDB::is_parent_class(p_doc->name, "Object")) { icon = ui_service->get_theme_icon(SNAME("Object"), SNAME("EditorIcons")); } |