From fc076ece3ddecd44a62dc0febed7baee47f2eede Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 8 Feb 2022 10:14:58 +0100 Subject: 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. --- editor/plugins/theme_editor_preview.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'editor/plugins/theme_editor_preview.cpp') diff --git a/editor/plugins/theme_editor_preview.cpp b/editor/plugins/theme_editor_preview.cpp index a1f98df2aa..c4ef6e086d 100644 --- a/editor/plugins/theme_editor_preview.cpp +++ b/editor/plugins/theme_editor_preview.cpp @@ -247,10 +247,10 @@ ThemeEditorPreview::ThemeEditorPreview() { preview_content = memnew(MarginContainer); preview_root->add_child(preview_content); - preview_content->add_theme_constant_override(SNAME("margin_right"), 4 * EDSCALE); - preview_content->add_theme_constant_override(SNAME("margin_top"), 4 * EDSCALE); - preview_content->add_theme_constant_override(SNAME("margin_left"), 4 * EDSCALE); - preview_content->add_theme_constant_override(SNAME("margin_bottom"), 4 * EDSCALE); + preview_content->add_theme_constant_override("margin_right", 4 * EDSCALE); + preview_content->add_theme_constant_override("margin_top", 4 * EDSCALE); + preview_content->add_theme_constant_override("margin_left", 4 * EDSCALE); + preview_content->add_theme_constant_override("margin_bottom", 4 * EDSCALE); preview_overlay = memnew(MarginContainer); preview_overlay->set_mouse_filter(MOUSE_FILTER_IGNORE); @@ -269,20 +269,20 @@ DefaultThemeEditorPreview::DefaultThemeEditorPreview() { preview_content->add_child(main_panel); MarginContainer *main_mc = memnew(MarginContainer); - main_mc->add_theme_constant_override(SNAME("margin_right"), 4 * EDSCALE); - main_mc->add_theme_constant_override(SNAME("margin_top"), 4 * EDSCALE); - main_mc->add_theme_constant_override(SNAME("margin_left"), 4 * EDSCALE); - main_mc->add_theme_constant_override(SNAME("margin_bottom"), 4 * EDSCALE); + main_mc->add_theme_constant_override("margin_right", 4 * EDSCALE); + main_mc->add_theme_constant_override("margin_top", 4 * EDSCALE); + main_mc->add_theme_constant_override("margin_left", 4 * EDSCALE); + main_mc->add_theme_constant_override("margin_bottom", 4 * EDSCALE); preview_content->add_child(main_mc); HBoxContainer *main_hb = memnew(HBoxContainer); main_mc->add_child(main_hb); - main_hb->add_theme_constant_override(SNAME("separation"), 20 * EDSCALE); + main_hb->add_theme_constant_override("separation", 20 * EDSCALE); VBoxContainer *first_vb = memnew(VBoxContainer); main_hb->add_child(first_vb); first_vb->set_h_size_flags(SIZE_EXPAND_FILL); - first_vb->add_theme_constant_override(SNAME("separation"), 10 * EDSCALE); + first_vb->add_theme_constant_override("separation", 10 * EDSCALE); first_vb->add_child(memnew(Label("Label"))); @@ -343,7 +343,7 @@ DefaultThemeEditorPreview::DefaultThemeEditorPreview() { VBoxContainer *second_vb = memnew(VBoxContainer); second_vb->set_h_size_flags(SIZE_EXPAND_FILL); main_hb->add_child(second_vb); - second_vb->add_theme_constant_override(SNAME("separation"), 10 * EDSCALE); + second_vb->add_theme_constant_override("separation", 10 * EDSCALE); LineEdit *le = memnew(LineEdit); le->set_text("LineEdit"); second_vb->add_child(le); @@ -383,7 +383,7 @@ DefaultThemeEditorPreview::DefaultThemeEditorPreview() { VBoxContainer *third_vb = memnew(VBoxContainer); third_vb->set_h_size_flags(SIZE_EXPAND_FILL); - third_vb->add_theme_constant_override(SNAME("separation"), 10 * EDSCALE); + third_vb->add_theme_constant_override("separation", 10 * EDSCALE); main_hb->add_child(third_vb); TabContainer *tc = memnew(TabContainer); -- cgit v1.2.3