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_editor.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_editor.cpp')
-rw-r--r-- | modules/visual_script/editor/visual_script_editor.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/modules/visual_script/editor/visual_script_editor.cpp b/modules/visual_script/editor/visual_script_editor.cpp index 6e3b173fce..1a7d473bd4 100644 --- a/modules/visual_script/editor/visual_script_editor.cpp +++ b/modules/visual_script/editor/visual_script_editor.cpp @@ -713,7 +713,7 @@ void VisualScriptEditor::_update_graph(int p_only_id) { LineEdit *line_edit = memnew(LineEdit); line_edit->set_text(node->get_text()); line_edit->set_expand_to_text_length_enabled(true); - line_edit->add_theme_font_override(SNAME("font"), get_theme_font(SNAME("source"), SNAME("EditorFonts"))); + line_edit->add_theme_font_override("font", get_theme_font(SNAME("source"), SNAME("EditorFonts"))); gnode->add_child(line_edit); line_edit->connect("text_changed", callable_mp(this, &VisualScriptEditor::_expression_text_changed), varray(E)); } else { @@ -743,11 +743,11 @@ void VisualScriptEditor::_update_graph(int p_only_id) { Color c = sbf->get_border_color(); c = ((c.r + c.g + c.b) / 3) < 0.7 ? Color(1.0, 1.0, 1.0, 0.85) : Color(0.0, 0.0, 0.0, 0.85); Color ic = c; - gnode->add_theme_color_override(SNAME("title_color"), c); + gnode->add_theme_color_override("title_color", c); c.a = 1; - gnode->add_theme_color_override(SNAME("close_color"), c); - gnode->add_theme_color_override(SNAME("resizer_color"), ic); - gnode->add_theme_style_override(SNAME("frame"), sbf); + gnode->add_theme_color_override("close_color", c); + gnode->add_theme_color_override("resizer_color", ic); + gnode->add_theme_style_override("frame", sbf); } const Color mono_color = get_theme_color(SNAME("mono_color"), SNAME("Editor")); @@ -2661,7 +2661,7 @@ Ref<Texture2D> VisualScriptEditor::get_theme_icon() { icon_name += "Internal"; } - if (Control::has_theme_icon(icon_name, SNAME("EditorIcons"))) { + if (Control::has_theme_icon(icon_name, "EditorIcons")) { return Control::get_theme_icon(icon_name, SNAME("EditorIcons")); } @@ -3931,13 +3931,13 @@ void VisualScriptEditor::_notification(int p_what) { update_toggle_scripts_button(); - edit_variable_edit->add_theme_style_override(SNAME("bg"), get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); - edit_signal_edit->add_theme_style_override(SNAME("bg"), get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); - func_input_scroll->add_theme_style_override(SNAME("bg"), get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); + edit_variable_edit->add_theme_style_override("bg", get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); + edit_signal_edit->add_theme_style_override("bg", get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); + func_input_scroll->add_theme_style_override("bg", get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); Ref<Theme> tm = EditorNode::get_singleton()->get_theme_base()->get_theme(); - bool dark_theme = tm->get_constant(SNAME("dark_theme"), SNAME("Editor")); + bool dark_theme = tm->get_constant("dark_theme", "Editor"); if (dark_theme) { node_colors["flow_control"] = Color(0.96, 0.96, 0.96); |