From a988fad9a092053434545c32afae91ccbdfbe792 Mon Sep 17 00:00:00 2001 From: jmb462 Date: Sun, 6 Feb 2022 20:17:35 +0100 Subject: [PATCH] Add missing SNAME macro optimization to all theme methods call --- editor/animation_track_editor.cpp | 8 +- editor/code_editor.cpp | 36 +- editor/connections_dialog.cpp | 4 +- editor/create_dialog.cpp | 4 +- editor/debugger/editor_debugger_node.cpp | 22 +- editor/debugger/editor_network_profiler.cpp | 6 +- editor/debugger/editor_profiler.cpp | 2 +- editor/debugger/editor_visual_profiler.cpp | 2 +- editor/debugger/script_editor_debugger.cpp | 16 +- editor/editor_about.cpp | 16 +- editor/editor_audio_buses.cpp | 24 +- editor/editor_autoload_settings.cpp | 2 +- editor/editor_feature_profile.cpp | 2 +- editor/editor_fonts.cpp | 80 +- editor/editor_help.cpp | 18 +- editor/editor_help_search.cpp | 2 +- editor/editor_inspector.cpp | 26 +- editor/editor_log.cpp | 8 +- editor/editor_log.h | 2 +- editor/editor_node.cpp | 82 +- editor/editor_path.cpp | 6 +- editor/editor_properties.cpp | 20 +- editor/editor_properties_array_dict.cpp | 2 +- editor/editor_sectioned_inspector.cpp | 2 +- editor/editor_settings_dialog.cpp | 20 +- editor/editor_spin_slider.cpp | 2 +- editor/editor_themes.cpp | 1046 +++++++-------- editor/editor_toaster.cpp | 38 +- editor/editor_zoom_widget.cpp | 8 +- editor/export_template_manager.cpp | 10 +- editor/filesystem_dock.cpp | 4 +- editor/find_in_files.cpp | 12 +- editor/groups_editor.cpp | 14 +- editor/import/dynamicfont_import_settings.cpp | 80 +- editor/import_dock.cpp | 10 +- editor/inspector_dock.cpp | 2 +- .../animation_blend_space_1d_editor.cpp | 6 +- .../animation_blend_space_2d_editor.cpp | 6 +- .../animation_blend_tree_editor_plugin.cpp | 10 +- .../animation_player_editor_plugin.cpp | 8 +- .../animation_state_machine_editor.cpp | 6 +- .../plugins/asset_library_editor_plugin.cpp | 44 +- editor/plugins/audio_stream_editor_plugin.cpp | 10 +- editor/plugins/canvas_item_editor_plugin.cpp | 18 +- editor/plugins/debugger_editor_plugin.cpp | 2 +- editor/plugins/input_event_editor_plugin.cpp | 8 +- editor/plugins/node_3d_editor_plugin.cpp | 50 +- editor/plugins/polygon_2d_editor_plugin.cpp | 4 +- editor/plugins/replication_editor_plugin.cpp | 10 +- .../resource_preloader_editor_plugin.cpp | 2 +- editor/plugins/script_editor_plugin.cpp | 10 +- editor/plugins/script_text_editor.cpp | 2 +- editor/plugins/shader_editor_plugin.cpp | 10 +- editor/plugins/skeleton_3d_editor_plugin.cpp | 2 +- .../plugins/sprite_frames_editor_plugin.cpp | 8 +- editor/plugins/style_box_editor_plugin.cpp | 2 +- editor/plugins/text_control_editor_plugin.cpp | 24 +- editor/plugins/text_editor.cpp | 2 +- editor/plugins/texture_3d_editor_plugin.cpp | 10 +- editor/plugins/texture_editor_plugin.cpp | 14 +- .../plugins/texture_layered_editor_plugin.cpp | 10 +- .../plugins/texture_region_editor_plugin.cpp | 2 +- editor/plugins/theme_editor_plugin.cpp | 20 +- editor/plugins/theme_editor_preview.cpp | 24 +- editor/plugins/tiles/tile_atlas_view.cpp | 2 +- editor/plugins/tiles/tile_map_editor.cpp | 2 +- .../tiles/tile_set_atlas_source_editor.cpp | 12 +- .../plugins/visual_shader_editor_plugin.cpp | 44 +- editor/project_export.cpp | 8 +- editor/project_manager.cpp | 24 +- editor/project_settings_editor.cpp | 4 +- editor/quick_open.cpp | 2 +- editor/rename_dialog.cpp | 6 +- editor/scene_tree_dock.cpp | 4 +- editor/scene_tree_editor.cpp | 4 +- editor/script_create_dialog.cpp | 18 +- editor/shader_create_dialog.cpp | 10 +- modules/gridmap/grid_map_editor_plugin.cpp | 2 +- .../editor/visual_script_editor.cpp | 20 +- .../visual_script_property_selector.cpp | 14 +- scene/gui/box_container.cpp | 2 +- scene/gui/button.cpp | 2 +- scene/gui/color_picker.cpp | 24 +- scene/gui/dialogs.cpp | 2 +- scene/gui/file_dialog.cpp | 48 +- scene/gui/popup.cpp | 4 +- scene/gui/popup_menu.cpp | 8 +- scene/gui/tree.cpp | 2 +- .../resources/default_theme/default_theme.cpp | 1180 ++++++++--------- tests/scene/test_gui.cpp | 2 +- 90 files changed, 1706 insertions(+), 1706 deletions(-) diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 2f33619a52e6..dab928794f81 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -4368,7 +4368,7 @@ void AnimationTrackEditor::_update_tracks() { g->set_timeline(timeline); groups.push_back(g); VBoxContainer *vb = memnew(VBoxContainer); - vb->add_theme_constant_override("separation", 0); + vb->add_theme_constant_override(SNAME("separation"), 0); vb->add_child(g); track_vbox->add_child(vb); group_sort[base_path] = vb; @@ -4519,7 +4519,7 @@ void AnimationTrackEditor::_notification(int p_what) { view_group->set_icon(get_theme_icon(view_group->is_pressed() ? SNAME("AnimationTrackList") : SNAME("AnimationTrackGroup"), SNAME("EditorIcons"))); selected_filter->set_icon(get_theme_icon(SNAME("AnimationFilter"), SNAME("EditorIcons"))); imported_anim_warning->set_icon(get_theme_icon(SNAME("NodeWarning"), SNAME("EditorIcons"))); - main_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); + main_panel->add_theme_style_override(SNAME("panel"), get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); edit->get_popup()->set_item_icon(edit->get_popup()->get_item_index(EDIT_APPLY_RESET), get_theme_icon(SNAME("Reload"), SNAME("EditorIcons"))); } @@ -6085,7 +6085,7 @@ AnimationTrackEditor::AnimationTrackEditor() { timeline_scroll->add_child(timeline_vbox); timeline_vbox->set_v_size_flags(SIZE_EXPAND_FILL); timeline_vbox->set_h_size_flags(SIZE_EXPAND_FILL); - timeline_vbox->add_theme_constant_override("separation", 0); + timeline_vbox->add_theme_constant_override(SNAME("separation"), 0); info_message = memnew(Label); info_message->set_text(TTR("Select an AnimationPlayer node to create and edit animations.")); @@ -6140,7 +6140,7 @@ AnimationTrackEditor::AnimationTrackEditor() { scroll->add_child(track_vbox); track_vbox->set_h_size_flags(SIZE_EXPAND_FILL); scroll->set_horizontal_scroll_mode(ScrollContainer::SCROLL_MODE_DISABLED); - track_vbox->add_theme_constant_override("separation", 0); + track_vbox->add_theme_constant_override(SNAME("separation"), 0); HBoxContainer *bottom_hb = memnew(HBoxContainer); add_child(bottom_hb); diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index 2627baaea8f6..daca1e958796 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -105,7 +105,7 @@ void FindReplaceBar::_notification(int p_what) { hide_button->set_pressed_texture(get_theme_icon(SNAME("Close"), SNAME("EditorIcons"))); hide_button->set_custom_minimum_size(hide_button->get_normal_texture()->get_size()); } else if (p_what == NOTIFICATION_THEME_CHANGED) { - matches_label->add_theme_color_override("font_color", results_count > 0 ? get_theme_color(SNAME("font_color"), SNAME("Label")) : get_theme_color(SNAME("error_color"), SNAME("Editor"))); + matches_label->add_theme_color_override(SNAME("font_color"), results_count > 0 ? get_theme_color(SNAME("font_color"), SNAME("Label")) : get_theme_color(SNAME("error_color"), SNAME("Editor"))); } else if (p_what == NOTIFICATION_PREDELETE) { if (base_text_editor) { base_text_editor->remove_find_replace_bar(); @@ -301,7 +301,7 @@ void FindReplaceBar::_replace_all() { } text_editor->set_v_scroll(vsval); - matches_label->add_theme_color_override("font_color", rc > 0 ? get_theme_color(SNAME("font_color"), SNAME("Label")) : get_theme_color(SNAME("error_color"), SNAME("Editor"))); + matches_label->add_theme_color_override(SNAME("font_color"), rc > 0 ? get_theme_color(SNAME("font_color"), SNAME("Label")) : get_theme_color(SNAME("error_color"), SNAME("Editor"))); matches_label->set_text(vformat(TTR("%d replaced."), rc)); text_editor->call_deferred(SNAME("connect"), "text_changed", callable_mp(this, &FindReplaceBar::_editor_text_changed)); @@ -365,7 +365,7 @@ void FindReplaceBar::_update_matches_label() { } else { matches_label->show(); - matches_label->add_theme_color_override("font_color", results_count > 0 ? get_theme_color(SNAME("font_color"), SNAME("Label")) : get_theme_color(SNAME("error_color"), SNAME("Editor"))); + matches_label->add_theme_color_override(SNAME("font_color"), results_count > 0 ? get_theme_color(SNAME("font_color"), SNAME("Label")) : get_theme_color(SNAME("error_color"), SNAME("Editor"))); matches_label->set_text(vformat(results_count == 1 ? TTR("%d match.") : TTR("%d matches."), results_count)); } } @@ -818,7 +818,7 @@ void CodeTextEditor::_zoom_changed() { void CodeTextEditor::_reset_zoom() { EditorSettings::get_singleton()->set("interface/editor/code_font_size", 14); - text_editor->add_theme_font_size_override("font_size", 14 * EDSCALE); + text_editor->add_theme_font_size_override(SNAME("font_size"), 14 * EDSCALE); } void CodeTextEditor::_line_col_changed() { @@ -936,7 +936,7 @@ bool CodeTextEditor::_add_font_size(int p_delta) { if (new_size != old_size) { EditorSettings::get_singleton()->set("interface/editor/code_font_size", new_size / EDSCALE); - text_editor->add_theme_font_size_override("font_size", new_size); + text_editor->add_theme_font_size_override(SNAME("font_size"), new_size); } return true; @@ -1567,14 +1567,14 @@ void CodeTextEditor::_update_text_editor_theme() { Ref status_bar_font = get_theme_font(SNAME("status_source"), SNAME("EditorFonts")); int status_bar_font_size = get_theme_font_size(SNAME("status_source_size"), SNAME("EditorFonts")); - error->add_theme_font_override("font", status_bar_font); - error->add_theme_font_size_override("font_size", status_bar_font_size); + error->add_theme_font_override(SNAME("font"), status_bar_font); + error->add_theme_font_size_override(SNAME("font_size"), status_bar_font_size); int count = status_bar->get_child_count(); for (int i = 0; i < count; i++) { Control *n = Object::cast_to(status_bar->get_child(i)); if (n) { - n->add_theme_font_override("font", status_bar_font); - n->add_theme_font_size_override("font_size", status_bar_font_size); + n->add_theme_font_override(SNAME("font"), status_bar_font); + n->add_theme_font_size_override(SNAME("font_size"), status_bar_font_size); } } error->end_bulk_theme_override(); @@ -1666,17 +1666,17 @@ void CodeTextEditor::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: case NOTIFICATION_THEME_CHANGED: { error_button->set_icon(get_theme_icon(SNAME("StatusError"), SNAME("EditorIcons"))); - error_button->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor"))); - error_button->add_theme_font_override("font", get_theme_font(SNAME("status_source"), SNAME("EditorFonts"))); - error_button->add_theme_font_size_override("font_size", get_theme_font_size(SNAME("status_source_size"), SNAME("EditorFonts"))); + error_button->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("error_color"), SNAME("Editor"))); + error_button->add_theme_font_override(SNAME("font"), get_theme_font(SNAME("status_source"), SNAME("EditorFonts"))); + error_button->add_theme_font_size_override(SNAME("font_size"), get_theme_font_size(SNAME("status_source_size"), SNAME("EditorFonts"))); warning_button->set_icon(get_theme_icon(SNAME("NodeWarning"), SNAME("EditorIcons"))); - warning_button->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), SNAME("Editor"))); - warning_button->add_theme_font_override("font", get_theme_font(SNAME("status_source"), SNAME("EditorFonts"))); - warning_button->add_theme_font_size_override("font_size", get_theme_font_size(SNAME("status_source_size"), SNAME("EditorFonts"))); + warning_button->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("warning_color"), SNAME("Editor"))); + warning_button->add_theme_font_override(SNAME("font"), get_theme_font(SNAME("status_source"), SNAME("EditorFonts"))); + warning_button->add_theme_font_size_override(SNAME("font_size"), get_theme_font_size(SNAME("status_source_size"), SNAME("EditorFonts"))); - line_and_col_txt->add_theme_font_override("font", get_theme_font(SNAME("status_source"), SNAME("EditorFonts"))); - line_and_col_txt->add_theme_font_size_override("font_size", get_theme_font_size(SNAME("status_source_size"), SNAME("EditorFonts"))); + line_and_col_txt->add_theme_font_override(SNAME("font"), get_theme_font(SNAME("status_source"), SNAME("EditorFonts"))); + line_and_col_txt->add_theme_font_size_override(SNAME("font_size"), get_theme_font_size(SNAME("status_source_size"), SNAME("EditorFonts"))); if (p_what == NOTIFICATION_ENTER_TREE) { break; @@ -1935,5 +1935,5 @@ CodeTextEditor::CodeTextEditor() { font_resize_timer->connect("timeout", callable_mp(this, &CodeTextEditor::_font_resize_timeout)); EditorSettings::get_singleton()->connect("settings_changed", callable_mp(this, &CodeTextEditor::_on_settings_change)); - add_theme_constant_override("separation", 4 * EDSCALE); + add_theme_constant_override(SNAME("separation"), 4 * EDSCALE); } diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index 8efcd602103c..146eb5962362 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -381,7 +381,7 @@ void ConnectDialog::init(ConnectionData p_cd, bool p_edit) { void ConnectDialog::popup_dialog(const String &p_for_signal) { from_signal->set_text(p_for_signal); - error_label->add_theme_color_override("font_color", error_label->get_theme_color(SNAME("error_color"), SNAME("Editor"))); + error_label->add_theme_color_override(SNAME("font_color"), error_label->get_theme_color(SNAME("error_color"), SNAME("Editor"))); if (!advanced->is_pressed()) { error_label->set_visible(!_find_first_script(get_tree()->get_edited_scene_root(), get_tree()->get_edited_scene_root())); } @@ -1200,7 +1200,7 @@ ConnectionsDock::ConnectionsDock(EditorNode *p_editor) { tree->connect("item_activated", callable_mp(this, &ConnectionsDock::_tree_item_activated)); tree->connect("item_rmb_selected", callable_mp(this, &ConnectionsDock::_rmb_pressed)); - add_theme_constant_override("separation", 3 * EDSCALE); + add_theme_constant_override(SNAME("separation"), 3 * EDSCALE); EDITOR_DEF("interface/editors/default_signal_callback_name", "_on_{node_name}_{signal_name}"); } diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index e8fd97fa1ac0..119e81c150cb 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -743,7 +743,7 @@ CreateDialog::CreateDialog() { favorites->set_allow_reselect(true); favorites->connect("cell_selected", callable_mp(this, &CreateDialog::_favorite_selected)); favorites->connect("item_activated", callable_mp(this, &CreateDialog::_favorite_activated)); - favorites->add_theme_constant_override("draw_guides", 1); + favorites->add_theme_constant_override(SNAME("draw_guides"), 1); #ifndef _MSC_VER #warning cannot forward drag data to a non control, must be fixed #endif @@ -760,7 +760,7 @@ CreateDialog::CreateDialog() { recent->set_allow_reselect(true); recent->connect("item_selected", callable_mp(this, &CreateDialog::_history_selected)); recent->connect("item_activated", callable_mp(this, &CreateDialog::_history_activated)); - recent->add_theme_constant_override("draw_guides", 1); + recent->add_theme_constant_override(SNAME("draw_guides"), 1); VBoxContainer *vbc = memnew(VBoxContainer); vbc->set_custom_minimum_size(Size2(300, 0) * EDSCALE); diff --git a/editor/debugger/editor_debugger_node.cpp b/editor/debugger/editor_debugger_node.cpp index 4b6a11f38889..6d9ad9398c39 100644 --- a/editor/debugger/editor_debugger_node.cpp +++ b/editor/debugger/editor_debugger_node.cpp @@ -55,8 +55,8 @@ EditorDebuggerNode::EditorDebuggerNode() { singleton = this; } - add_theme_constant_override("margin_left", -EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles"))->get_margin(SIDE_LEFT)); - add_theme_constant_override("margin_right", -EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles"))->get_margin(SIDE_RIGHT)); + add_theme_constant_override(SNAME("margin_left"), -EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles"))->get_margin(SIDE_LEFT)); + add_theme_constant_override(SNAME("margin_right"), -EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles"))->get_margin(SIDE_RIGHT)); tabs = memnew(TabContainer); tabs->set_tab_alignment(TabContainer::ALIGNMENT_LEFT); @@ -66,7 +66,7 @@ EditorDebuggerNode::EditorDebuggerNode() { Ref empty; empty.instantiate(); - tabs->add_theme_style_override("panel", empty); + tabs->add_theme_style_override(SNAME("panel"), empty); auto_switch_remote_scene_tree = EDITOR_DEF("debugger/auto_switch_to_remote_scene_tree", false); _add_debugger(); @@ -113,7 +113,7 @@ ScriptEditorDebugger *EditorDebuggerNode::_add_debugger() { if (tabs->get_tab_count() > 1) { node->clear_style(); tabs->set_tabs_visible(true); - tabs->add_theme_style_override("panel", EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("DebuggerPanel"), SNAME("EditorStyles"))); + tabs->add_theme_style_override(SNAME("panel"), EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("DebuggerPanel"), SNAME("EditorStyles"))); } if (!debugger_plugins.is_empty()) { @@ -233,10 +233,10 @@ void EditorDebuggerNode::_notification(int p_what) { switch (p_what) { case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { if (tabs->get_tab_count() > 1) { - add_theme_constant_override("margin_left", -EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles"))->get_margin(SIDE_LEFT)); - add_theme_constant_override("margin_right", -EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles"))->get_margin(SIDE_RIGHT)); + add_theme_constant_override(SNAME("margin_left"), -EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles"))->get_margin(SIDE_LEFT)); + add_theme_constant_override(SNAME("margin_right"), -EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles"))->get_margin(SIDE_RIGHT)); - tabs->add_theme_style_override("panel", EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("DebuggerPanel"), SNAME("EditorStyles"))); + tabs->add_theme_style_override(SNAME("panel"), EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("DebuggerPanel"), SNAME("EditorStyles"))); } } break; case NOTIFICATION_READY: { @@ -271,20 +271,20 @@ void EditorDebuggerNode::_notification(int p_what) { if (error_count == 0 && warning_count == 0) { debugger_button->set_text(TTR("Debugger")); - debugger_button->remove_theme_color_override("font_color"); + debugger_button->remove_theme_color_override(SNAME("font_color")); debugger_button->set_icon(Ref()); } else { debugger_button->set_text(TTR("Debugger") + " (" + itos(error_count + warning_count) + ")"); if (error_count >= 1 && warning_count >= 1) { debugger_button->set_icon(get_theme_icon(SNAME("ErrorWarning"), SNAME("EditorIcons"))); // Use error color to represent the highest level of severity reported. - debugger_button->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor"))); + debugger_button->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("error_color"), SNAME("Editor"))); } else if (error_count >= 1) { debugger_button->set_icon(get_theme_icon(SNAME("Error"), SNAME("EditorIcons"))); - debugger_button->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor"))); + debugger_button->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("error_color"), SNAME("Editor"))); } else { debugger_button->set_icon(get_theme_icon(SNAME("Warning"), SNAME("EditorIcons"))); - debugger_button->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), SNAME("Editor"))); + debugger_button->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("warning_color"), SNAME("Editor"))); } } last_error_count = error_count; diff --git a/editor/debugger/editor_network_profiler.cpp b/editor/debugger/editor_network_profiler.cpp index 698e950f57aa..c04ec465e5d6 100644 --- a/editor/debugger/editor_network_profiler.cpp +++ b/editor/debugger/editor_network_profiler.cpp @@ -46,8 +46,8 @@ void EditorNetworkProfiler::_notification(int p_what) { outgoing_bandwidth_text->set_right_icon(get_theme_icon(SNAME("ArrowUp"), SNAME("EditorIcons"))); // This needs to be done here to set the faded color when the profiler is first opened - incoming_bandwidth_text->add_theme_color_override("font_uneditable_color", get_theme_color(SNAME("font_color"), SNAME("Editor")) * Color(1, 1, 1, 0.5)); - outgoing_bandwidth_text->add_theme_color_override("font_uneditable_color", get_theme_color(SNAME("font_color"), SNAME("Editor")) * Color(1, 1, 1, 0.5)); + incoming_bandwidth_text->add_theme_color_override(SNAME("font_uneditable_color"), get_theme_color(SNAME("font_color"), SNAME("Editor")) * Color(1, 1, 1, 0.5)); + outgoing_bandwidth_text->add_theme_color_override(SNAME("font_uneditable_color"), get_theme_color(SNAME("font_color"), SNAME("Editor")) * Color(1, 1, 1, 0.5)); } } @@ -126,7 +126,7 @@ bool EditorNetworkProfiler::is_profiling() { EditorNetworkProfiler::EditorNetworkProfiler() { HBoxContainer *hb = memnew(HBoxContainer); - hb->add_theme_constant_override("separation", 8 * EDSCALE); + hb->add_theme_constant_override(SNAME("separation"), 8 * EDSCALE); add_child(hb); activate = memnew(Button); diff --git a/editor/debugger/editor_profiler.cpp b/editor/debugger/editor_profiler.cpp index da1d6a54f2e7..0a10bc95ccf4 100644 --- a/editor/debugger/editor_profiler.cpp +++ b/editor/debugger/editor_profiler.cpp @@ -618,7 +618,7 @@ EditorProfiler::EditorProfiler() { hb->add_child(cursor_metric_edit); cursor_metric_edit->connect("value_changed", callable_mp(this, &EditorProfiler::_cursor_metric_changed)); - hb->add_theme_constant_override("separation", 8 * EDSCALE); + hb->add_theme_constant_override(SNAME("separation"), 8 * EDSCALE); h_split = memnew(HSplitContainer); add_child(h_split); diff --git a/editor/debugger/editor_visual_profiler.cpp b/editor/debugger/editor_visual_profiler.cpp index 3cb5d3513df5..5f61edcf8cb9 100644 --- a/editor/debugger/editor_visual_profiler.cpp +++ b/editor/debugger/editor_visual_profiler.cpp @@ -758,7 +758,7 @@ EditorVisualProfiler::EditorVisualProfiler() { hb->add_child(cursor_metric_edit); cursor_metric_edit->connect("value_changed", callable_mp(this, &EditorVisualProfiler::_cursor_metric_changed)); - hb->add_theme_constant_override("separation", 8 * EDSCALE); + hb->add_theme_constant_override(SNAME("separation"), 8 * EDSCALE); h_split = memnew(HSplitContainer); add_child(h_split); diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp index 6aedfa6ccb45..d0be846f76a1 100644 --- a/editor/debugger/script_editor_debugger.cpp +++ b/editor/debugger/script_editor_debugger.cpp @@ -147,7 +147,7 @@ void ScriptEditorDebugger::update_tabs() { } void ScriptEditorDebugger::clear_style() { - tabs->remove_theme_style_override("panel"); + tabs->remove_theme_style_override(SNAME("panel")); } void ScriptEditorDebugger::save_node(ObjectID p_id, const String &p_file) { @@ -762,13 +762,13 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da void ScriptEditorDebugger::_set_reason_text(const String &p_reason, MessageType p_type) { switch (p_type) { case MESSAGE_ERROR: - reason->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor"))); + reason->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("error_color"), SNAME("Editor"))); break; case MESSAGE_WARNING: - reason->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), SNAME("Editor"))); + reason->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("warning_color"), SNAME("Editor"))); break; default: - reason->add_theme_color_override("font_color", get_theme_color(SNAME("success_color"), SNAME("Editor"))); + reason->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("success_color"), SNAME("Editor"))); } reason->set_text(p_reason); reason->set_tooltip(p_reason.word_wrap(80)); @@ -793,7 +793,7 @@ void ScriptEditorDebugger::_notification(int p_what) { vmem_export->set_icon(get_theme_icon(SNAME("Save"), SNAME("EditorIcons"))); search->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons"))); - reason->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor"))); + reason->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("error_color"), SNAME("Editor"))); } break; case NOTIFICATION_PROCESS: { @@ -855,8 +855,8 @@ void ScriptEditorDebugger::_notification(int p_what) { }; } break; case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { - if (tabs->has_theme_stylebox_override("panel")) { - tabs->add_theme_style_override("panel", editor->get_gui_base()->get_theme_stylebox(SNAME("DebuggerPanel"), SNAME("EditorStyles"))); + if (tabs->has_theme_stylebox_override(SNAME("panel"))) { + tabs->add_theme_style_override(SNAME("panel"), editor->get_gui_base()->get_theme_stylebox(SNAME("DebuggerPanel"), SNAME("EditorStyles"))); } copy->set_icon(get_theme_icon(SNAME("ActionCopy"), SNAME("EditorIcons"))); @@ -1665,7 +1665,7 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { tabs = memnew(TabContainer); tabs->set_tab_alignment(TabContainer::ALIGNMENT_LEFT); - tabs->add_theme_style_override("panel", editor->get_gui_base()->get_theme_stylebox(SNAME("DebuggerPanel"), SNAME("EditorStyles"))); + tabs->add_theme_style_override(SNAME("panel"), editor->get_gui_base()->get_theme_stylebox(SNAME("DebuggerPanel"), SNAME("EditorStyles"))); tabs->connect("tab_changed", callable_mp(this, &ScriptEditorDebugger::_tab_changed)); add_child(tabs); diff --git a/editor/editor_about.cpp b/editor/editor_about.cpp index 54377971c68d..267fe875ca73 100644 --- a/editor/editor_about.cpp +++ b/editor/editor_about.cpp @@ -43,12 +43,12 @@ static const String META_TEXT_TO_COPY = "text_to_copy"; void EditorAbout::_theme_changed() { const Ref font = get_theme_font(SNAME("source"), SNAME("EditorFonts")); const int font_size = get_theme_font_size(SNAME("source_size"), SNAME("EditorFonts")); - _tpl_text->add_theme_font_override("normal_font", font); - _tpl_text->add_theme_font_size_override("normal_font_size", font_size); - _tpl_text->add_theme_constant_override("line_separation", 6 * EDSCALE); - _license_text->add_theme_font_override("normal_font", font); - _license_text->add_theme_font_size_override("normal_font_size", font_size); - _license_text->add_theme_constant_override("line_separation", 6 * EDSCALE); + _tpl_text->add_theme_font_override(SNAME("normal_font"), font); + _tpl_text->add_theme_font_size_override(SNAME("normal_font_size"), font_size); + _tpl_text->add_theme_constant_override(SNAME("line_separation"), 6 * EDSCALE); + _license_text->add_theme_font_override(SNAME("normal_font"), font); + _license_text->add_theme_font_size_override(SNAME("normal_font_size"), font_size); + _license_text->add_theme_constant_override(SNAME("line_separation"), 6 * EDSCALE); _logo->set_texture(get_theme_icon(SNAME("Logo"), SNAME("EditorIcons"))); } @@ -101,7 +101,7 @@ ScrollContainer *EditorAbout::_populate_list(const String &p_name, const Listset_same_column_width(true); il->set_auto_height(true); il->set_mouse_filter(Control::MOUSE_FILTER_IGNORE); - il->add_theme_constant_override("hseparation", 16 * EDSCALE); + il->add_theme_constant_override(SNAME("hseparation"), 16 * EDSCALE); while (*names_ptr) { il->add_item(String::utf8(*names_ptr++), nullptr, false); } @@ -126,7 +126,7 @@ EditorAbout::EditorAbout() { HBoxContainer *hbc = memnew(HBoxContainer); hbc->set_h_size_flags(Control::SIZE_EXPAND_FILL); hbc->set_alignment(BoxContainer::ALIGNMENT_CENTER); - hbc->add_theme_constant_override("separation", 30 * EDSCALE); + hbc->add_theme_constant_override(SNAME("separation"), 30 * EDSCALE); add_child(vbc); vbc->add_child(hbc); diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index 5e4e375db458..9434a4e67b29 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -79,17 +79,17 @@ void EditorAudioBus::_notification(int p_what) { Color bypass_color = EditorSettings::get_singleton()->is_dark_theme() ? Color(0.13, 0.8, 1.0) : Color(0.44, 0.87, 1.0); solo->set_icon(get_theme_icon(SNAME("AudioBusSolo"), SNAME("EditorIcons"))); - solo->add_theme_color_override("icon_pressed_color", solo_color); + solo->add_theme_color_override(SNAME("icon_pressed_color"), solo_color); mute->set_icon(get_theme_icon(SNAME("AudioBusMute"), SNAME("EditorIcons"))); - mute->add_theme_color_override("icon_pressed_color", mute_color); + mute->add_theme_color_override(SNAME("icon_pressed_color"), mute_color); bypass->set_icon(get_theme_icon(SNAME("AudioBusBypass"), SNAME("EditorIcons"))); - bypass->add_theme_color_override("icon_pressed_color", bypass_color); + bypass->add_theme_color_override(SNAME("icon_pressed_color"), bypass_color); bus_options->set_icon(get_theme_icon(SNAME("GuiTabMenuHl"), SNAME("EditorIcons"))); - audio_value_preview_label->add_theme_color_override("font_color", get_theme_color(SNAME("font_color"), SNAME("TooltipLabel"))); - audio_value_preview_label->add_theme_color_override("font_shadow_color", get_theme_color(SNAME("font_shadow_color"), SNAME("TooltipLabel"))); - audio_value_preview_box->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("TooltipPanel"))); + audio_value_preview_label->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("font_color"), SNAME("TooltipLabel"))); + audio_value_preview_label->add_theme_color_override(SNAME("font_shadow_color"), get_theme_color(SNAME("font_shadow_color"), SNAME("TooltipLabel"))); + audio_value_preview_box->add_theme_style_override(SNAME("panel"), get_theme_stylebox(SNAME("panel"), SNAME("TooltipPanel"))); } break; case NOTIFICATION_READY: { @@ -574,7 +574,7 @@ Variant EditorAudioBus::get_drag_data(const Point2 &p_point) { Panel *p = memnew(Panel); c->add_child(p); p->set_modulate(Color(1, 1, 1, 0.7)); - p->add_theme_style_override("panel", get_theme_stylebox(SNAME("focus"), SNAME("Button"))); + p->add_theme_style_override(SNAME("panel"), get_theme_stylebox(SNAME("focus"), SNAME("Button"))); p->set_size(get_size()); p->set_position(-p_point); set_drag_preview(c); @@ -804,10 +804,10 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) { Ref sbempty = memnew(StyleBoxEmpty); for (int i = 0; i < hbc->get_child_count(); i++) { Control *child = Object::cast_to(hbc->get_child(i)); - child->add_theme_style_override("normal", sbempty); - child->add_theme_style_override("hover", sbempty); - child->add_theme_style_override("focus", sbempty); - child->add_theme_style_override("pressed", sbempty); + child->add_theme_style_override(SNAME("normal"), sbempty); + child->add_theme_style_override(SNAME("hover"), sbempty); + child->add_theme_style_override(SNAME("focus"), sbempty); + child->add_theme_style_override(SNAME("pressed"), sbempty); } HSeparator *separator = memnew(HSeparator); @@ -1013,7 +1013,7 @@ void EditorAudioBuses::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: case NOTIFICATION_THEME_CHANGED: { - bus_scroll->add_theme_style_override("bg", get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); + bus_scroll->add_theme_style_override(SNAME("bg"), get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); } break; case NOTIFICATION_READY: { _update_buses(); diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp index d74a6e12b21e..d27d0c8b532b 100644 --- a/editor/editor_autoload_settings.cpp +++ b/editor/editor_autoload_settings.cpp @@ -839,7 +839,7 @@ EditorAutoloadSettings::EditorAutoloadSettings() { error_message = memnew(Label); error_message->hide(); error_message->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT); - error_message->add_theme_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("error_color"), SNAME("Editor"))); + error_message->add_theme_color_override(SNAME("font_color"), EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("error_color"), SNAME("Editor"))); add_child(error_message); Label *l = memnew(Label); diff --git a/editor/editor_feature_profile.cpp b/editor/editor_feature_profile.cpp index 1d73bdfa6e07..c8101ccaafcd 100644 --- a/editor/editor_feature_profile.cpp +++ b/editor/editor_feature_profile.cpp @@ -947,7 +947,7 @@ EditorFeatureProfileManager::EditorFeatureProfileManager() { // Add some spacing above the help label. Ref sb = memnew(StyleBoxEmpty); sb->set_default_margin(SIDE_TOP, 20 * EDSCALE); - no_profile_selected_help->add_theme_style_override("normal", sb); + no_profile_selected_help->add_theme_style_override(SNAME("normal"), sb); no_profile_selected_help->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); no_profile_selected_help->set_v_size_flags(Control::SIZE_EXPAND_FILL); h_split->add_child(no_profile_selected_help); diff --git a/editor/editor_fonts.cpp b/editor/editor_fonts.cpp index 0c9a7b297282..db87801fbb22 100644 --- a/editor/editor_fonts.cpp +++ b/editor/editor_fonts.cpp @@ -279,67 +279,67 @@ void editor_register_fonts(Ref p_theme) { p_theme->set_default_font(df); // Default theme font p_theme->set_default_font_size(default_font_size); - p_theme->set_font_size("main_size", "EditorFonts", default_font_size); - p_theme->set_font("main", "EditorFonts", df); + p_theme->set_font_size(SNAME("main_size"), SNAME("EditorFonts"), default_font_size); + p_theme->set_font(SNAME("main"), SNAME("EditorFonts"), df); // Bold font MAKE_BOLD_FONT(df_bold, String()); - p_theme->set_font_size("bold_size", "EditorFonts", default_font_size); - p_theme->set_font("bold", "EditorFonts", df_bold); + p_theme->set_font_size(SNAME("bold_size"), SNAME("EditorFonts"), default_font_size); + p_theme->set_font(SNAME("bold"), SNAME("EditorFonts"), df_bold); // Title font - p_theme->set_font_size("title_size", "EditorFonts", default_font_size + 1 * EDSCALE); - p_theme->set_font("title", "EditorFonts", df_bold); + p_theme->set_font_size(SNAME("title_size"), SNAME("EditorFonts"), default_font_size + 1 * EDSCALE); + p_theme->set_font(SNAME("title"), SNAME("EditorFonts"), df_bold); - p_theme->set_font_size("main_button_font_size", "EditorFonts", default_font_size + 1 * EDSCALE); - p_theme->set_font("main_button_font", "EditorFonts", df_bold); + p_theme->set_font_size(SNAME("main_button_font_size"), SNAME("EditorFonts"), default_font_size + 1 * EDSCALE); + p_theme->set_font(SNAME("main_button_font"), SNAME("EditorFonts"), df_bold); - p_theme->set_font("font", "Label", df); + p_theme->set_font(SNAME("font"), SNAME("Label"), df); - p_theme->set_type_variation("HeaderSmall", "Label"); - p_theme->set_font("font", "HeaderSmall", df_bold); - p_theme->set_font_size("font_size", "HeaderSmall", default_font_size); + p_theme->set_type_variation(SNAME("HeaderSmall"), SNAME("Label")); + p_theme->set_font(SNAME("font"), SNAME("HeaderSmall"), df_bold); + p_theme->set_font_size(SNAME("font_size"), SNAME("HeaderSmall"), default_font_size); - p_theme->set_type_variation("HeaderMedium", "Label"); - p_theme->set_font("font", "HeaderMedium", df_bold); - p_theme->set_font_size("font_size", "HeaderMedium", default_font_size + 1 * EDSCALE); + p_theme->set_type_variation(SNAME("HeaderMedium"), SNAME("Label")); + p_theme->set_font(SNAME("font"), SNAME("HeaderMedium"), df_bold); + p_theme->set_font_size(SNAME("font_size"), SNAME("HeaderMedium"), default_font_size + 1 * EDSCALE); - p_theme->set_type_variation("HeaderLarge", "Label"); - p_theme->set_font("font", "HeaderLarge", df_bold); - p_theme->set_font_size("font_size", "HeaderLarge", default_font_size + 3 * EDSCALE); + p_theme->set_type_variation(SNAME("HeaderLarge"), SNAME("Label")); + p_theme->set_font(SNAME("font"), SNAME("HeaderLarge"), df_bold); + p_theme->set_font_size(SNAME("font_size"), SNAME("HeaderLarge"), default_font_size + 3 * EDSCALE); // Documentation fonts String code_font_custom_variations = EditorSettings::get_singleton()->get("interface/editor/code_font_custom_variations"); MAKE_SOURCE_FONT(df_code, code_font_custom_variations); - p_theme->set_font_size("doc_size", "EditorFonts", int(EDITOR_GET("text_editor/help/help_font_size")) * EDSCALE); - p_theme->set_font("doc", "EditorFonts", df); - p_theme->set_font_size("doc_bold_size", "EditorFonts", int(EDITOR_GET("text_editor/help/help_font_size")) * EDSCALE); - p_theme->set_font("doc_bold", "EditorFonts", df_bold); - p_theme->set_font_size("doc_title_size", "EditorFonts", int(EDITOR_GET("text_editor/help/help_title_font_size")) * EDSCALE); - p_theme->set_font("doc_title", "EditorFonts", df_bold); - p_theme->set_font_size("doc_source_size", "EditorFonts", int(EDITOR_GET("text_editor/help/help_source_font_size")) * EDSCALE); - p_theme->set_font("doc_source", "EditorFonts", df_code); - p_theme->set_font_size("doc_keyboard_size", "EditorFonts", (int(EDITOR_GET("text_editor/help/help_source_font_size")) - 1) * EDSCALE); - p_theme->set_font("doc_keyboard", "EditorFonts", df_code); + p_theme->set_font_size(SNAME("doc_size"), SNAME("EditorFonts"), int(EDITOR_GET("text_editor/help/help_font_size")) * EDSCALE); + p_theme->set_font(SNAME("doc"), SNAME("EditorFonts"), df); + p_theme->set_font_size(SNAME("doc_bold_size"), SNAME("EditorFonts"), int(EDITOR_GET("text_editor/help/help_font_size")) * EDSCALE); + p_theme->set_font(SNAME("doc_bold"), SNAME("EditorFonts"), df_bold); + p_theme->set_font_size(SNAME("doc_title_size"), SNAME("EditorFonts"), int(EDITOR_GET("text_editor/help/help_title_font_size")) * EDSCALE); + p_theme->set_font(SNAME("doc_title"), SNAME("EditorFonts"), df_bold); + p_theme->set_font_size(SNAME("doc_source_size"), SNAME("EditorFonts"), int(EDITOR_GET("text_editor/help/help_source_font_size")) * EDSCALE); + p_theme->set_font(SNAME("doc_source"), SNAME("EditorFonts"), df_code); + p_theme->set_font_size(SNAME("doc_keyboard_size"), SNAME("EditorFonts"), (int(EDITOR_GET("text_editor/help/help_source_font_size")) - 1) * EDSCALE); + p_theme->set_font(SNAME("doc_keyboard"), SNAME("EditorFonts"), df_code); // Ruler font - p_theme->set_font_size("rulers_size", "EditorFonts", 8 * EDSCALE); - p_theme->set_font("rulers", "EditorFonts", df); + p_theme->set_font_size(SNAME("rulers_size"), SNAME("EditorFonts"), 8 * EDSCALE); + p_theme->set_font(SNAME("rulers"), SNAME("EditorFonts"), df); // Rotation widget font - p_theme->set_font_size("rotation_control_size", "EditorFonts", 14 * EDSCALE); - p_theme->set_font("rotation_control", "EditorFonts", df); + p_theme->set_font_size(SNAME("rotation_control_size"), SNAME("EditorFonts"), 14 * EDSCALE); + p_theme->set_font(SNAME("rotation_control"), SNAME("EditorFonts"), df); // Code font - p_theme->set_font_size("source_size", "EditorFonts", int(EDITOR_GET("interface/editor/code_font_size")) * EDSCALE); - p_theme->set_font("source", "EditorFonts", df_code); + p_theme->set_font_size(SNAME("source_size"), SNAME("EditorFonts"), int(EDITOR_GET("interface/editor/code_font_size")) * EDSCALE); + p_theme->set_font(SNAME("source"), SNAME("EditorFonts"), df_code); - p_theme->set_font_size("expression_size", "EditorFonts", (int(EDITOR_GET("interface/editor/code_font_size")) - 1) * EDSCALE); - p_theme->set_font("expression", "EditorFonts", df_code); + p_theme->set_font_size(SNAME("expression_size"), SNAME("EditorFonts"), (int(EDITOR_GET("interface/editor/code_font_size")) - 1) * EDSCALE); + p_theme->set_font(SNAME("expression"), SNAME("EditorFonts"), df_code); - p_theme->set_font_size("output_source_size", "EditorFonts", int(EDITOR_GET("run/output/font_size")) * EDSCALE); - p_theme->set_font("output_source", "EditorFonts", df_code); + p_theme->set_font_size(SNAME("output_source_size"), SNAME("EditorFonts"), int(EDITOR_GET("run/output/font_size")) * EDSCALE); + p_theme->set_font(SNAME("output_source"), SNAME("EditorFonts"), df_code); - p_theme->set_font_size("status_source_size", "EditorFonts", default_font_size); - p_theme->set_font("status_source", "EditorFonts", df_code); + p_theme->set_font_size(SNAME("status_source_size"), SNAME("EditorFonts"), default_font_size); + p_theme->set_font(SNAME("status_source"), SNAME("EditorFonts"), df_code); } diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index e80e9c43b0e8..dd5eeac4e559 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -54,10 +54,10 @@ void EditorHelp::_update_theme() { qualifier_color = get_theme_color(SNAME("qualifier_color"), SNAME("EditorHelp")); type_color = get_theme_color(SNAME("type_color"), SNAME("EditorHelp")); - class_desc->add_theme_color_override("selection_color", get_theme_color(SNAME("selection_color"), SNAME("EditorHelp"))); - class_desc->add_theme_constant_override("line_separation", get_theme_constant(SNAME("line_separation"), SNAME("EditorHelp"))); - class_desc->add_theme_constant_override("table_hseparation", get_theme_constant(SNAME("table_hseparation"), SNAME("EditorHelp"))); - class_desc->add_theme_constant_override("table_vseparation", get_theme_constant(SNAME("table_vseparation"), SNAME("EditorHelp"))); + class_desc->add_theme_color_override(SNAME("selection_color"), get_theme_color(SNAME("selection_color"), SNAME("EditorHelp"))); + class_desc->add_theme_constant_override(SNAME("line_separation"), get_theme_constant(SNAME("line_separation"), SNAME("EditorHelp"))); + class_desc->add_theme_constant_override(SNAME("table_hseparation"), get_theme_constant(SNAME("table_hseparation"), SNAME("EditorHelp"))); + class_desc->add_theme_constant_override(SNAME("table_vseparation"), get_theme_constant(SNAME("table_vseparation"), SNAME("EditorHelp"))); doc_font = get_theme_font(SNAME("doc"), SNAME("EditorFonts")); doc_bold_font = get_theme_font(SNAME("doc_bold"), SNAME("EditorFonts")); @@ -176,7 +176,7 @@ void EditorHelp::_class_desc_resized(bool p_force_update_theme) { Ref class_desc_stylebox = EditorNode::get_singleton()->get_theme_base()->get_theme_stylebox(SNAME("normal"), SNAME("RichTextLabel"))->duplicate(); class_desc_stylebox->set_default_margin(SIDE_LEFT, display_margin); class_desc_stylebox->set_default_margin(SIDE_RIGHT, display_margin); - class_desc->add_theme_style_override("normal", class_desc_stylebox); + class_desc->add_theme_style_override(SNAME("normal"), class_desc_stylebox); } } @@ -1872,7 +1872,7 @@ EditorHelp::EditorHelp() { class_desc = memnew(RichTextLabel); add_child(class_desc); class_desc->set_v_size_flags(SIZE_EXPAND_FILL); - class_desc->add_theme_color_override("selection_color", get_theme_color(SNAME("accent_color"), SNAME("Editor")) * Color(1, 1, 1, 0.4)); + class_desc->add_theme_color_override(SNAME("selection_color"), get_theme_color(SNAME("accent_color"), SNAME("Editor")) * Color(1, 1, 1, 0.4)); class_desc->connect("meta_clicked", callable_mp(this, &EditorHelp::_class_desc_select)); class_desc->connect("gui_input", callable_mp(this, &EditorHelp::_class_desc_input)); @@ -1951,7 +1951,7 @@ void EditorHelpBit::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: case NOTIFICATION_THEME_CHANGED: { - rich_text->add_theme_color_override("selection_color", get_theme_color(SNAME("selection_color"), SNAME("EditorHelp"))); + rich_text->add_theme_color_override(SNAME("selection_color"), get_theme_color(SNAME("selection_color"), SNAME("EditorHelp"))); rich_text->clear(); _add_text_to_rt(text, rich_text); rich_text->reset_size(); // Force recalculating size after parsing bbcode. @@ -2039,7 +2039,7 @@ void FindBar::_notification(int p_what) { hide_button->set_hover_texture(get_theme_icon(SNAME("Close"), SNAME("EditorIcons"))); hide_button->set_pressed_texture(get_theme_icon(SNAME("Close"), SNAME("EditorIcons"))); hide_button->set_custom_minimum_size(hide_button->get_normal_texture()->get_size()); - matches_label->add_theme_color_override("font_color", results_count > 0 ? get_theme_color(SNAME("font_color"), SNAME("Label")) : get_theme_color(SNAME("error_color"), SNAME("Editor"))); + matches_label->add_theme_color_override(SNAME("font_color"), results_count > 0 ? get_theme_color(SNAME("font_color"), SNAME("Label")) : get_theme_color(SNAME("error_color"), SNAME("Editor"))); } break; case NOTIFICATION_VISIBILITY_CHANGED: { set_process_unhandled_input(is_visible_in_tree()); @@ -2110,7 +2110,7 @@ void FindBar::_update_matches_label() { } else { matches_label->show(); - matches_label->add_theme_color_override("font_color", results_count > 0 ? get_theme_color(SNAME("font_color"), SNAME("Label")) : get_theme_color(SNAME("error_color"), SNAME("Editor"))); + matches_label->add_theme_color_override(SNAME("font_color"), results_count > 0 ? get_theme_color(SNAME("font_color"), SNAME("Label")) : get_theme_color(SNAME("error_color"), SNAME("Editor"))); matches_label->set_text(vformat(results_count == 1 ? TTR("%d match.") : TTR("%d matches."), results_count)); } } diff --git a/editor/editor_help_search.cpp b/editor/editor_help_search.cpp index 36d3ac9e66d7..550e6ee72bc2 100644 --- a/editor/editor_help_search.cpp +++ b/editor/editor_help_search.cpp @@ -38,7 +38,7 @@ void EditorHelpSearch::_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("right_icon", results_tree->get_theme_icon(SNAME("Search"), SNAME("EditorIcons"))); + search_box->add_theme_icon_override(SNAME("right_icon"), results_tree->get_theme_icon(SNAME("Search"), SNAME("EditorIcons"))); case_sensitive_button->set_icon(results_tree->get_theme_icon(SNAME("MatchCase"), SNAME("EditorIcons"))); hierarchy_button->set_icon(results_tree->get_theme_icon(SNAME("ClassList"), SNAME("EditorIcons"))); diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 29d175257827..d898c84a02f3 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -1890,10 +1890,10 @@ void EditorInspectorArray::_setup() { ae.margin->set_mouse_filter(MOUSE_FILTER_PASS); if (is_inside_tree()) { Size2 min_size = get_theme_stylebox(SNAME("Focus"), SNAME("EditorStyles"))->get_minimum_size(); - ae.margin->add_theme_constant_override("margin_left", min_size.x / 2); - ae.margin->add_theme_constant_override("margin_top", min_size.y / 2); - ae.margin->add_theme_constant_override("margin_right", min_size.x / 2); - ae.margin->add_theme_constant_override("margin_bottom", min_size.y / 2); + ae.margin->add_theme_constant_override(SNAME("margin_left"), min_size.x / 2); + ae.margin->add_theme_constant_override(SNAME("margin_top"), min_size.y / 2); + ae.margin->add_theme_constant_override(SNAME("margin_right"), min_size.x / 2); + ae.margin->add_theme_constant_override(SNAME("margin_bottom"), min_size.y / 2); } ae.panel->add_child(ae.margin); @@ -1989,10 +1989,10 @@ void EditorInspectorArray::_notification(int p_what) { ae.move_texture_rect->set_texture(get_theme_icon(SNAME("TripleBar"), SNAME("EditorIcons"))); Size2 min_size = get_theme_stylebox(SNAME("Focus"), SNAME("EditorStyles"))->get_minimum_size(); - ae.margin->add_theme_constant_override("margin_left", min_size.x / 2); - ae.margin->add_theme_constant_override("margin_top", min_size.y / 2); - ae.margin->add_theme_constant_override("margin_right", min_size.x / 2); - ae.margin->add_theme_constant_override("margin_bottom", min_size.y / 2); + ae.margin->add_theme_constant_override(SNAME("margin_left"), min_size.x / 2); + ae.margin->add_theme_constant_override(SNAME("margin_top"), min_size.y / 2); + ae.margin->add_theme_constant_override(SNAME("margin_right"), min_size.x / 2); + ae.margin->add_theme_constant_override(SNAME("margin_bottom"), min_size.y / 2); } add_button->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons"))); @@ -2083,7 +2083,7 @@ EditorInspectorArray::EditorInspectorArray() { add_child(rmb_popup); elements_vbox = memnew(VBoxContainer); - elements_vbox->add_theme_constant_override("separation", 0); + elements_vbox->add_theme_constant_override(SNAME("separation"), 0); vbox->add_child(elements_vbox); add_button = memnew(Button); @@ -2109,7 +2109,7 @@ EditorInspectorArray::EditorInspectorArray() { page_line_edit = memnew(LineEdit); page_line_edit->connect("text_submitted", callable_mp(this, &EditorInspectorArray::_page_line_edit_text_submitted)); - page_line_edit->add_theme_constant_override("minimum_character_width", 2); + page_line_edit->add_theme_constant_override(SNAME("minimum_character_width"), 2); hbox_pagination->add_child(page_line_edit); page_count_label = memnew(Label); @@ -3020,9 +3020,9 @@ void EditorInspector::_update_inspector_bg() { n = n->get_parent(); } count_subinspectors = MIN(15, count_subinspectors); - add_theme_style_override("bg", get_theme_stylebox("sub_inspector_bg" + itos(count_subinspectors), "Editor")); + add_theme_style_override(SNAME("bg"), get_theme_stylebox("sub_inspector_bg" + itos(count_subinspectors), SNAME("Editor"))); } else { - add_theme_style_override("bg", get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); + add_theme_style_override(SNAME("bg"), get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); } } void EditorInspector::set_sub_inspector(bool p_enable) { @@ -3551,7 +3551,7 @@ EditorInspector::EditorInspector() { undo_redo = nullptr; main_vbox = memnew(VBoxContainer); main_vbox->set_h_size_flags(SIZE_EXPAND_FILL); - main_vbox->add_theme_constant_override("separation", 0); + main_vbox->add_theme_constant_override(SNAME("separation"), 0); add_child(main_vbox); set_horizontal_scroll_mode(SCROLL_MODE_DISABLED); diff --git a/editor/editor_log.cpp b/editor/editor_log.cpp index db4de3bed024..e6aa38e7c44d 100644 --- a/editor/editor_log.cpp +++ b/editor/editor_log.cpp @@ -64,15 +64,15 @@ void EditorLog::_error_handler(void *p_self, const char *p_func, const char *p_f void EditorLog::_update_theme() { Ref normal_font = get_theme_font(SNAME("output_source"), SNAME("EditorFonts")); if (normal_font.is_valid()) { - log->add_theme_font_override("normal_font", normal_font); + log->add_theme_font_override(SNAME("normal_font"), normal_font); } - log->add_theme_font_size_override("normal_font_size", get_theme_font_size(SNAME("output_source_size"), SNAME("EditorFonts"))); - log->add_theme_color_override("selection_color", get_theme_color(SNAME("accent_color"), SNAME("Editor")) * Color(1, 1, 1, 0.4)); + log->add_theme_font_size_override(SNAME("normal_font_size"), get_theme_font_size(SNAME("output_source_size"), SNAME("EditorFonts"))); + log->add_theme_color_override(SNAME("selection_color"), get_theme_color(SNAME("accent_color"), SNAME("Editor")) * Color(1, 1, 1, 0.4)); Ref bold_font = get_theme_font(SNAME("bold"), SNAME("EditorFonts")); if (bold_font.is_valid()) { - log->add_theme_font_override("bold_font", bold_font); + log->add_theme_font_override(SNAME("bold_font"), bold_font); } type_filter_map[MSG_TYPE_STD]->toggle_button->set_icon(get_theme_icon(SNAME("Popup"), SNAME("EditorIcons"))); diff --git a/editor/editor_log.h b/editor/editor_log.h index 69a6a0b44961..abfc78fdcd11 100644 --- a/editor/editor_log.h +++ b/editor/editor_log.h @@ -85,7 +85,7 @@ class EditorLog : public HBoxContainer { toggle_button->set_text(itos(message_count)); toggle_button->set_tooltip(TTR(p_tooltip)); // Don't tint the icon even when in "pressed" state. - toggle_button->add_theme_color_override("icon_color_pressed", Color(1, 1, 1, 1)); + toggle_button->add_theme_color_override(SNAME("icon_color_pressed"), Color(1, 1, 1, 1)); toggle_button->set_focus_mode(FOCUS_NONE); // When toggled call the callback and pass the MessageType this button is for. toggle_button->connect("toggled", p_toggled_callback, varray(type)); diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index bf7e463559ed..aa58ae79ed6b 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -692,17 +692,17 @@ void EditorNode::_notification(int p_what) { theme_base->set_theme(theme); gui_base->set_theme(theme); - gui_base->add_theme_style_override("panel", gui_base->get_theme_stylebox(SNAME("Background"), SNAME("EditorStyles"))); - scene_root_parent->add_theme_style_override("panel", gui_base->get_theme_stylebox(SNAME("Content"), SNAME("EditorStyles"))); - bottom_panel->add_theme_style_override("panel", gui_base->get_theme_stylebox(SNAME("panel"), SNAME("TabContainer"))); - scene_tabs->add_theme_style_override("tab_selected", gui_base->get_theme_stylebox(SNAME("SceneTabFG"), SNAME("EditorStyles"))); - scene_tabs->add_theme_style_override("tab_unselected", gui_base->get_theme_stylebox(SNAME("SceneTabBG"), SNAME("EditorStyles"))); - - file_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles"))); - project_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles"))); - debug_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles"))); - settings_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles"))); - help_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles"))); + gui_base->add_theme_style_override(SNAME("panel"), gui_base->get_theme_stylebox(SNAME("Background"), SNAME("EditorStyles"))); + scene_root_parent->add_theme_style_override(SNAME("panel"), gui_base->get_theme_stylebox(SNAME("Content"), SNAME("EditorStyles"))); + bottom_panel->add_theme_style_override(SNAME("panel"), gui_base->get_theme_stylebox(SNAME("panel"), SNAME("TabContainer"))); + scene_tabs->add_theme_style_override(SNAME("tab_selected"), gui_base->get_theme_stylebox(SNAME("SceneTabFG"), SNAME("EditorStyles"))); + scene_tabs->add_theme_style_override(SNAME("tab_unselected"), gui_base->get_theme_stylebox(SNAME("SceneTabBG"), SNAME("EditorStyles"))); + + file_menu->add_theme_style_override(SNAME("hover"), gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles"))); + project_menu->add_theme_style_override(SNAME("hover"), gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles"))); + debug_menu->add_theme_style_override(SNAME("hover"), gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles"))); + settings_menu->add_theme_style_override(SNAME("hover"), gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles"))); + help_menu->add_theme_style_override(SNAME("hover"), gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles"))); if (EDITOR_GET("interface/scene_tabs/resize_if_many_tabs")) { scene_tabs->set_min_width(int(EDITOR_GET("interface/scene_tabs/minimum_width")) * EDSCALE); @@ -715,7 +715,7 @@ void EditorNode::_notification(int p_what) { // debugger area if (EditorDebuggerNode::get_singleton()->is_visible()) { - bottom_panel->add_theme_style_override("panel", gui_base->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles"))); + bottom_panel->add_theme_style_override(SNAME("panel"), gui_base->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles"))); } // update_icons @@ -766,8 +766,8 @@ void EditorNode::_notification(int p_what) { p->set_item_icon(p->get_item_index(HELP_SUPPORT_GODOT_DEVELOPMENT), gui_base->get_theme_icon(SNAME("Heart"), SNAME("EditorIcons"))); for (int i = 0; i < main_editor_buttons.size(); i++) { - main_editor_buttons.write[i]->add_theme_font_override("font", gui_base->get_theme_font(SNAME("main_button_font"), SNAME("EditorFonts"))); - main_editor_buttons.write[i]->add_theme_font_size_override("font_size", gui_base->get_theme_font_size(SNAME("main_button_font_size"), SNAME("EditorFonts"))); + main_editor_buttons.write[i]->add_theme_font_override(SNAME("font"), gui_base->get_theme_font(SNAME("main_button_font"), SNAME("EditorFonts"))); + main_editor_buttons.write[i]->add_theme_font_size_override(SNAME("font_size"), gui_base->get_theme_font_size(SNAME("main_button_font_size"), SNAME("EditorFonts"))); } Set updated_textfile_extensions; @@ -3184,8 +3184,8 @@ void EditorNode::add_editor_plugin(EditorPlugin *p_editor, bool p_config_changed tb->set_icon(singleton->gui_base->get_theme_icon(p_editor->get_name(), SNAME("EditorIcons"))); } - tb->add_theme_font_override("font", singleton->gui_base->get_theme_font(SNAME("main_button_font"), SNAME("EditorFonts"))); - tb->add_theme_font_size_override("font_size", singleton->gui_base->get_theme_font_size(SNAME("main_button_font_size"), SNAME("EditorFonts"))); + tb->add_theme_font_override(SNAME("font"), singleton->gui_base->get_theme_font(SNAME("main_button_font"), SNAME("EditorFonts"))); + tb->add_theme_font_size_override(SNAME("font_size"), singleton->gui_base->get_theme_font_size(SNAME("main_button_font_size"), SNAME("EditorFonts"))); singleton->main_editor_buttons.push_back(tb); singleton->main_editor_button_vb->add_child(tb); @@ -4251,10 +4251,10 @@ void EditorNode::_dock_make_float() { window->add_child(p); MarginContainer *margin = memnew(MarginContainer); margin->set_anchors_and_offsets_preset(Control::PRESET_WIDE); - margin->add_theme_constant_override("margin_right", borders.width); - margin->add_theme_constant_override("margin_top", borders.height); - margin->add_theme_constant_override("margin_left", borders.width); - margin->add_theme_constant_override("margin_bottom", borders.height); + margin->add_theme_constant_override(SNAME("margin_right"), borders.width); + margin->add_theme_constant_override(SNAME("margin_top"), borders.height); + margin->add_theme_constant_override(SNAME("margin_left"), borders.width); + margin->add_theme_constant_override(SNAME("margin_bottom"), borders.height); window->add_child(margin); dock->set_anchors_and_offsets_preset(Control::PRESET_WIDE); margin->add_child(dock); @@ -5199,9 +5199,9 @@ void EditorNode::_bottom_panel_switch(bool p_enable, int p_idx) { bottom_panel_items[i].control->set_visible(i == p_idx); } if (EditorDebuggerNode::get_singleton() == bottom_panel_items[p_idx].control) { // this is the debug panel which uses tabs, so the top section should be smaller - bottom_panel->add_theme_style_override("panel", gui_base->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles"))); + bottom_panel->add_theme_style_override(SNAME("panel"), gui_base->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles"))); } else { - bottom_panel->add_theme_style_override("panel", gui_base->get_theme_stylebox(SNAME("panel"), SNAME("TabContainer"))); + bottom_panel->add_theme_style_override(SNAME("panel"), gui_base->get_theme_stylebox(SNAME("panel"), SNAME("TabContainer"))); } center_split->set_dragger_visibility(SplitContainer::DRAGGER_VISIBLE); center_split->set_collapsed(false); @@ -5211,7 +5211,7 @@ void EditorNode::_bottom_panel_switch(bool p_enable, int p_idx) { bottom_panel_raise->show(); } else { - bottom_panel->add_theme_style_override("panel", gui_base->get_theme_stylebox(SNAME("panel"), SNAME("TabContainer"))); + bottom_panel->add_theme_style_override(SNAME("panel"), gui_base->get_theme_stylebox(SNAME("panel"), SNAME("TabContainer"))); bottom_panel_items[p_idx].button->set_pressed(false); bottom_panel_items[p_idx].control->set_visible(false); center_split->set_dragger_visibility(SplitContainer::DRAGGER_HIDDEN); @@ -5602,9 +5602,9 @@ void EditorNode::_bottom_panel_raise_toggled(bool p_pressed) { void EditorNode::_update_rendering_driver_color() { if (rendering_driver->get_text() == "opengl3") { - rendering_driver->add_theme_color_override("font_color", Color::hex(0x5586a4ff)); + rendering_driver->add_theme_color_override(SNAME("font_color"), Color::hex(0x5586a4ff)); } else if (rendering_driver->get_text() == "vulkan") { - rendering_driver->add_theme_color_override("font_color", theme_base->get_theme_color(SNAME("vulkan_color"), SNAME("Editor"))); + rendering_driver->add_theme_color_override(SNAME("font_color"), theme_base->get_theme_color(SNAME("vulkan_color"), SNAME("Editor"))); } } @@ -6053,7 +6053,7 @@ EditorNode::EditorNode() { theme_base->set_theme(theme); gui_base->set_theme(theme); - gui_base->add_theme_style_override("panel", gui_base->get_theme_stylebox(SNAME("Background"), SNAME("EditorStyles"))); + gui_base->add_theme_style_override(SNAME("panel"), gui_base->get_theme_stylebox(SNAME("Background"), SNAME("EditorStyles"))); resource_preview = memnew(EditorResourcePreview); add_child(resource_preview); @@ -6068,7 +6068,7 @@ EditorNode::EditorNode() { main_vbox = memnew(VBoxContainer); gui_base->add_child(main_vbox); main_vbox->set_anchors_and_offsets_preset(Control::PRESET_WIDE, Control::PRESET_MODE_MINSIZE, 8); - main_vbox->add_theme_constant_override("separation", 8 * EDSCALE); + main_vbox->add_theme_constant_override(SNAME("separation"), 8 * EDSCALE); menu_hb = memnew(HBoxContainer); main_vbox->add_child(menu_hb); @@ -6219,7 +6219,7 @@ EditorNode::EditorNode() { VBoxContainer *srt = memnew(VBoxContainer); srt->set_v_size_flags(Control::SIZE_EXPAND_FILL); top_split->add_child(srt); - srt->add_theme_constant_override("separation", 0); + srt->add_theme_constant_override(SNAME("separation"), 0); tab_preview_panel = memnew(Panel); tab_preview_panel->set_size(Size2(100, 100) * EDSCALE); @@ -6237,8 +6237,8 @@ EditorNode::EditorNode() { srt->add_child(tabbar_container); scene_tabs = memnew(TabBar); - scene_tabs->add_theme_style_override("tab_selected", gui_base->get_theme_stylebox(SNAME("SceneTabFG"), SNAME("EditorStyles"))); - scene_tabs->add_theme_style_override("tab_unselected", gui_base->get_theme_stylebox(SNAME("SceneTabBG"), SNAME("EditorStyles"))); + scene_tabs->add_theme_style_override(SNAME("tab_selected"), gui_base->get_theme_stylebox(SNAME("SceneTabFG"), SNAME("EditorStyles"))); + scene_tabs->add_theme_style_override(SNAME("tab_unselected"), gui_base->get_theme_stylebox(SNAME("SceneTabBG"), SNAME("EditorStyles"))); scene_tabs->set_select_with_rmb(true); scene_tabs->add_tab("unsaved"); scene_tabs->set_tab_alignment(TabBar::ALIGNMENT_LEFT); @@ -6264,7 +6264,7 @@ EditorNode::EditorNode() { scene_tab_add->set_flat(true); scene_tab_add->set_tooltip(TTR("Add a new scene.")); scene_tab_add->set_icon(gui_base->get_theme_icon(SNAME("Add"), SNAME("EditorIcons"))); - scene_tab_add->add_theme_color_override("icon_normal_color", Color(0.6f, 0.6f, 0.6f, 0.8f)); + scene_tab_add->add_theme_color_override(SNAME("icon_normal_color"), Color(0.6f, 0.6f, 0.6f, 0.8f)); scene_tabs->add_child(scene_tab_add); scene_tab_add->connect("pressed", callable_mp(this, &EditorNode::_menu_option), make_binds(FILE_NEW_SCENE)); @@ -6286,7 +6286,7 @@ EditorNode::EditorNode() { scene_root_parent = memnew(PanelContainer); scene_root_parent->set_custom_minimum_size(Size2(0, 80) * EDSCALE); - scene_root_parent->add_theme_style_override("panel", gui_base->get_theme_stylebox(SNAME("Content"), SNAME("EditorStyles"))); + scene_root_parent->add_theme_style_override(SNAME("panel"), gui_base->get_theme_stylebox(SNAME("Content"), SNAME("EditorStyles"))); scene_root_parent->set_draw_behind_parent(true); srt->add_child(scene_root_parent); scene_root_parent->set_v_size_flags(Control::SIZE_EXPAND_FILL); @@ -6300,7 +6300,7 @@ EditorNode::EditorNode() { main_control = memnew(VBoxContainer); main_control->set_v_size_flags(Control::SIZE_EXPAND_FILL); - main_control->add_theme_constant_override("separation", 0); + main_control->add_theme_constant_override(SNAME("separation"), 0); scene_root_parent->add_child(main_control); HBoxContainer *left_menu_hb = memnew(HBoxContainer); @@ -6310,7 +6310,7 @@ EditorNode::EditorNode() { file_menu->set_flat(false); file_menu->set_switch_on_hover(true); file_menu->set_text(TTR("Scene")); - file_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles"))); + file_menu->add_theme_style_override(SNAME("hover"), gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles"))); left_menu_hb->add_child(file_menu); prev_scene = memnew(Button); @@ -6426,7 +6426,7 @@ EditorNode::EditorNode() { project_menu->set_switch_on_hover(true); project_menu->set_tooltip(TTR("Miscellaneous project or scene-wide tools.")); project_menu->set_text(TTR("Project")); - project_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles"))); + project_menu->add_theme_style_override(SNAME("hover"), gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles"))); left_menu_hb->add_child(project_menu); p = project_menu->get_popup(); @@ -6476,7 +6476,7 @@ EditorNode::EditorNode() { debug_menu->set_flat(false); debug_menu->set_switch_on_hover(true); debug_menu->set_text(TTR("Debug")); - debug_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles"))); + debug_menu->add_theme_style_override(SNAME("hover"), gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles"))); left_menu_hb->add_child(debug_menu); menu_hb->add_spacer(); @@ -6485,7 +6485,7 @@ EditorNode::EditorNode() { settings_menu->set_flat(false); settings_menu->set_switch_on_hover(true); settings_menu->set_text(TTR("Editor")); - settings_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles"))); + settings_menu->add_theme_style_override(SNAME("hover"), gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles"))); left_menu_hb->add_child(settings_menu); p = settings_menu->get_popup(); @@ -6533,7 +6533,7 @@ EditorNode::EditorNode() { help_menu->set_flat(false); help_menu->set_switch_on_hover(true); help_menu->set_text(TTR("Help")); - help_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles"))); + help_menu->add_theme_style_override(SNAME("hover"), gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles"))); left_menu_hb->add_child(help_menu); p = help_menu->get_popup(); @@ -6637,8 +6637,8 @@ EditorNode::EditorNode() { rendering_driver->set_flat(true); rendering_driver->set_focus_mode(Control::FOCUS_NONE); rendering_driver->connect("item_selected", callable_mp(this, &EditorNode::_rendering_driver_selected)); - rendering_driver->add_theme_font_override("font", gui_base->get_theme_font(SNAME("bold"), SNAME("EditorFonts"))); - rendering_driver->add_theme_font_size_override("font_size", gui_base->get_theme_font_size(SNAME("bold_size"), SNAME("EditorFonts"))); + rendering_driver->add_theme_font_override(SNAME("font"), gui_base->get_theme_font(SNAME("bold"), SNAME("EditorFonts"))); + rendering_driver->add_theme_font_size_override(SNAME("font_size"), gui_base->get_theme_font_size(SNAME("bold_size"), SNAME("EditorFonts"))); right_menu_hb->add_child(rendering_driver); @@ -6761,7 +6761,7 @@ EditorNode::EditorNode() { // Bottom panels bottom_panel = memnew(PanelContainer); - bottom_panel->add_theme_style_override("panel", gui_base->get_theme_stylebox(SNAME("panel"), SNAME("TabContainer"))); + bottom_panel->add_theme_style_override(SNAME("panel"), gui_base->get_theme_stylebox(SNAME("panel"), SNAME("TabContainer"))); center_split->add_child(bottom_panel); center_split->set_dragger_visibility(SplitContainer::DRAGGER_HIDDEN); diff --git a/editor/editor_path.cpp b/editor/editor_path.cpp index 3dee06fb3e44..e9ffb08cecec 100644 --- a/editor/editor_path.cpp +++ b/editor/editor_path.cpp @@ -181,7 +181,7 @@ void EditorPath::_notification(int p_what) { update_path(); sub_objects_icon->set_texture(get_theme_icon(SNAME("select_arrow"), SNAME("Tree"))); - current_object_label->add_theme_font_override("font", get_theme_font(SNAME("main"), SNAME("EditorFonts"))); + current_object_label->add_theme_font_override(SNAME("font"), get_theme_font(SNAME("main"), SNAME("EditorFonts"))); } break; case NOTIFICATION_READY: { @@ -198,8 +198,8 @@ EditorPath::EditorPath(EditorHistory *p_history) { MarginContainer *main_mc = memnew(MarginContainer); main_mc->set_anchors_and_offsets_preset(PRESET_WIDE); - main_mc->add_theme_constant_override("margin_left", 4 * EDSCALE); - main_mc->add_theme_constant_override("margin_right", 6 * EDSCALE); + main_mc->add_theme_constant_override(SNAME("margin_left"), 4 * EDSCALE); + main_mc->add_theme_constant_override(SNAME("margin_right"), 6 * EDSCALE); add_child(main_mc); HBoxContainer *main_hb = memnew(HBoxContainer); diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index ef1ceebabf9b..80da8363ad33 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -3087,18 +3087,18 @@ void EditorPropertyResource::_update_property_bg() { } count_subinspectors = MIN(15, count_subinspectors); - add_theme_color_override("property_color", get_theme_color(SNAME("sub_inspector_property_color"), SNAME("Editor"))); - add_theme_style_override("bg_selected", get_theme_stylebox("sub_inspector_property_bg_selected" + itos(count_subinspectors), SNAME("Editor"))); - add_theme_style_override("bg", get_theme_stylebox("sub_inspector_property_bg" + itos(count_subinspectors), SNAME("Editor"))); + add_theme_color_override(SNAME("property_color"), get_theme_color(SNAME("sub_inspector_property_color"), SNAME("Editor"))); + add_theme_style_override(SNAME("bg_selected"), get_theme_stylebox("sub_inspector_property_bg_selected" + itos(count_subinspectors), SNAME("Editor"))); + add_theme_style_override(SNAME("bg"), get_theme_stylebox("sub_inspector_property_bg" + itos(count_subinspectors), SNAME("Editor"))); - add_theme_constant_override("font_offset", get_theme_constant(SNAME("sub_inspector_font_offset"), SNAME("Editor"))); - add_theme_constant_override("vseparation", 0); + add_theme_constant_override(SNAME("font_offset"), get_theme_constant(SNAME("sub_inspector_font_offset"), SNAME("Editor"))); + add_theme_constant_override(SNAME("vseparation"), 0); } else { - add_theme_color_override("property_color", get_theme_color(SNAME("property_color"), SNAME("EditorProperty"))); - add_theme_style_override("bg_selected", get_theme_stylebox(SNAME("bg_selected"), SNAME("EditorProperty"))); - add_theme_style_override("bg", get_theme_stylebox(SNAME("bg"), SNAME("EditorProperty"))); - add_theme_constant_override("vseparation", get_theme_constant(SNAME("vseparation"), SNAME("EditorProperty"))); - add_theme_constant_override("font_offset", get_theme_constant(SNAME("font_offset"), SNAME("EditorProperty"))); + add_theme_color_override(SNAME("property_color"), get_theme_color(SNAME("property_color"), SNAME("EditorProperty"))); + add_theme_style_override(SNAME("bg_selected"), get_theme_stylebox(SNAME("bg_selected"), SNAME("EditorProperty"))); + add_theme_style_override(SNAME("bg"), get_theme_stylebox(SNAME("bg"), SNAME("EditorProperty"))); + add_theme_constant_override(SNAME("vseparation"), get_theme_constant(SNAME("vseparation"), SNAME("EditorProperty"))); + add_theme_constant_override(SNAME("font_offset"), get_theme_constant(SNAME("font_offset"), SNAME("EditorProperty"))); } updating_theme = false; diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp index cfed86d1ae6e..a96b7d3730d7 100644 --- a/editor/editor_properties_array_dict.cpp +++ b/editor/editor_properties_array_dict.cpp @@ -1082,7 +1082,7 @@ void EditorPropertyDictionary::update_property() { } flat->set_bg_color(get_theme_color(SNAME("prop_subsection"), SNAME("Editor"))); - pc->add_theme_style_override("panel", flat); + pc->add_theme_style_override(SNAME("panel"), flat); add_vbox = memnew(VBoxContainer); pc->add_child(add_vbox); } diff --git a/editor/editor_sectioned_inspector.cpp b/editor/editor_sectioned_inspector.cpp index 1bab56ac4a87..012f10a1bd8f 100644 --- a/editor/editor_sectioned_inspector.cpp +++ b/editor/editor_sectioned_inspector.cpp @@ -302,7 +302,7 @@ SectionedInspector::SectionedInspector() : sections(memnew(Tree)), filter(memnew(SectionedInspectorFilter)), inspector(memnew(EditorInspector)) { - add_theme_constant_override("autohide", 1); // Fixes the dragger always showing up + add_theme_constant_override(SNAME("autohide"), 1); // Fixes the dragger always showing up VBoxContainer *left_vb = memnew(VBoxContainer); left_vb->set_custom_minimum_size(Size2(190, 0) * EDSCALE); diff --git a/editor/editor_settings_dialog.cpp b/editor/editor_settings_dialog.cpp index 1cb95226ec65..22425ae37d72 100644 --- a/editor/editor_settings_dialog.cpp +++ b/editor/editor_settings_dialog.cpp @@ -182,9 +182,9 @@ void EditorSettingsDialog::_update_icons() { shortcut_search_box->set_clear_button_enabled(true); restart_close_button->set_icon(shortcuts->get_theme_icon(SNAME("Close"), SNAME("EditorIcons"))); - restart_container->add_theme_style_override("panel", shortcuts->get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); + restart_container->add_theme_style_override(SNAME("panel"), shortcuts->get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); restart_icon->set_texture(shortcuts->get_theme_icon(SNAME("StatusWarning"), SNAME("EditorIcons"))); - restart_label->add_theme_color_override("font_color", shortcuts->get_theme_color(SNAME("warning_color"), SNAME("Editor"))); + restart_label->add_theme_color_override(SNAME("font_color"), shortcuts->get_theme_color(SNAME("warning_color"), SNAME("Editor"))); } void EditorSettingsDialog::_event_config_confirmed() { @@ -272,15 +272,15 @@ void EditorSettingsDialog::_create_shortcut_treeitem(TreeItem *p_parent, const S shortcut_item->set_text(1, sc_text); if (sc_text == "None") { // Fade out unassigned shortcut labels for easier visual grepping. - shortcut_item->set_custom_color(1, shortcuts->get_theme_color("font_color", "Label") * Color(1, 1, 1, 0.5)); + shortcut_item->set_custom_color(1, shortcuts->get_theme_color(SNAME("font_color"), SNAME("Label")) * Color(1, 1, 1, 0.5)); } if (p_allow_revert) { - shortcut_item->add_button(1, shortcuts->get_theme_icon("Reload", "EditorIcons"), SHORTCUT_REVERT); + shortcut_item->add_button(1, shortcuts->get_theme_icon(SNAME("Reload"), SNAME("EditorIcons")), SHORTCUT_REVERT); } - shortcut_item->add_button(1, shortcuts->get_theme_icon("Add", "EditorIcons"), SHORTCUT_ADD); - shortcut_item->add_button(1, shortcuts->get_theme_icon("Close", "EditorIcons"), SHORTCUT_ERASE); + shortcut_item->add_button(1, shortcuts->get_theme_icon(SNAME("Add"), SNAME("EditorIcons")), SHORTCUT_ADD); + shortcut_item->add_button(1, shortcuts->get_theme_icon(SNAME("Close"), SNAME("EditorIcons")), SHORTCUT_ERASE); shortcut_item->set_meta("is_action", p_is_action); shortcut_item->set_meta("type", "shortcut"); @@ -299,11 +299,11 @@ void EditorSettingsDialog::_create_shortcut_treeitem(TreeItem *p_parent, const S event_item->set_text(0, shortcut_item->get_child_count() == 1 ? "Primary" : ""); event_item->set_text(1, ie->as_text()); - event_item->add_button(1, shortcuts->get_theme_icon("Edit", "EditorIcons"), SHORTCUT_EDIT); - event_item->add_button(1, shortcuts->get_theme_icon("Close", "EditorIcons"), SHORTCUT_ERASE); + event_item->add_button(1, shortcuts->get_theme_icon(SNAME("Edit"), SNAME("EditorIcons")), SHORTCUT_EDIT); + event_item->add_button(1, shortcuts->get_theme_icon(SNAME("Close"), SNAME("EditorIcons")), SHORTCUT_ERASE); - event_item->set_custom_bg_color(0, shortcuts->get_theme_color("dark_color_3", "Editor")); - event_item->set_custom_bg_color(1, shortcuts->get_theme_color("dark_color_3", "Editor")); + event_item->set_custom_bg_color(0, shortcuts->get_theme_color(SNAME("dark_color_3"), SNAME("Editor"))); + event_item->set_custom_bg_color(1, shortcuts->get_theme_color(SNAME("dark_color_3"), SNAME("Editor"))); event_item->set_meta("is_action", p_is_action); event_item->set_meta("type", "event"); diff --git a/editor/editor_spin_slider.cpp b/editor/editor_spin_slider.cpp index cd28a65c7bc1..881cd7a8a590 100644 --- a/editor/editor_spin_slider.cpp +++ b/editor/editor_spin_slider.cpp @@ -268,7 +268,7 @@ void EditorSpinSlider::_update_value_input_stylebox() { stylebox->set_default_margin(SIDE_RIGHT, 0); } - value_input->add_theme_style_override("normal", stylebox); + value_input->add_theme_style_override(SNAME("normal"), stylebox); } void EditorSpinSlider::_draw_spin_slider() { diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 2a5fefda20dd..ad5012edbf78 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -446,28 +446,28 @@ Ref create_editor_theme(const Ref p_theme) { float prev_icon_saturation = theme->has_color(SNAME("icon_saturation"), SNAME("Editor")) ? theme->get_color(SNAME("icon_saturation"), SNAME("Editor")).r : 1.0; - theme->set_color("icon_saturation", "Editor", Color(icon_saturation, icon_saturation, icon_saturation)); // can't save single float in theme, so using color - theme->set_color("accent_color", "Editor", accent_color); - theme->set_color("highlight_color", "Editor", highlight_color); - theme->set_color("disabled_highlight_color", "Editor", disabled_highlight_color); - theme->set_color("base_color", "Editor", base_color); - theme->set_color("dark_color_1", "Editor", dark_color_1); - theme->set_color("dark_color_2", "Editor", dark_color_2); - theme->set_color("dark_color_3", "Editor", dark_color_3); - theme->set_color("contrast_color_1", "Editor", contrast_color_1); - theme->set_color("contrast_color_2", "Editor", contrast_color_2); - theme->set_color("box_selection_fill_color", "Editor", accent_color * Color(1, 1, 1, 0.3)); - theme->set_color("box_selection_stroke_color", "Editor", accent_color * Color(1, 1, 1, 0.8)); - - theme->set_color("axis_x_color", "Editor", Color(0.96, 0.20, 0.32)); - theme->set_color("axis_y_color", "Editor", Color(0.53, 0.84, 0.01)); - theme->set_color("axis_z_color", "Editor", Color(0.16, 0.55, 0.96)); - - theme->set_color("font_color", "Editor", font_color); - theme->set_color("highlighted_font_color", "Editor", font_hover_color); - theme->set_color("disabled_font_color", "Editor", font_disabled_color); - - theme->set_color("mono_color", "Editor", mono_color); + theme->set_color(SNAME("icon_saturation"), SNAME("Editor"), Color(icon_saturation, icon_saturation, icon_saturation)); // can't save single float in theme, so using color + theme->set_color(SNAME("accent_color"), SNAME("Editor"), accent_color); + theme->set_color(SNAME("highlight_color"), SNAME("Editor"), highlight_color); + theme->set_color(SNAME("disabled_highlight_color"), SNAME("Editor"), disabled_highlight_color); + theme->set_color(SNAME("base_color"), SNAME("Editor"), base_color); + theme->set_color(SNAME("dark_color_1"), SNAME("Editor"), dark_color_1); + theme->set_color(SNAME("dark_color_2"), SNAME("Editor"), dark_color_2); + theme->set_color(SNAME("dark_color_3"), SNAME("Editor"), dark_color_3); + theme->set_color(SNAME("contrast_color_1"), SNAME("Editor"), contrast_color_1); + theme->set_color(SNAME("contrast_color_2"), SNAME("Editor"), contrast_color_2); + theme->set_color(SNAME("box_selection_fill_color"), SNAME("Editor"), accent_color * Color(1, 1, 1, 0.3)); + theme->set_color(SNAME("box_selection_stroke_color"), SNAME("Editor"), accent_color * Color(1, 1, 1, 0.8)); + + theme->set_color(SNAME("axis_x_color"), SNAME("Editor"), Color(0.96, 0.20, 0.32)); + theme->set_color(SNAME("axis_y_color"), SNAME("Editor"), Color(0.53, 0.84, 0.01)); + theme->set_color(SNAME("axis_z_color"), SNAME("Editor"), Color(0.16, 0.55, 0.96)); + + theme->set_color(SNAME("font_color"), SNAME("Editor"), font_color); + theme->set_color(SNAME("highlighted_font_color"), SNAME("Editor"), font_hover_color); + theme->set_color(SNAME("disabled_font_color"), SNAME("Editor"), font_disabled_color); + + theme->set_color(SNAME("mono_color"), SNAME("Editor"), mono_color); Color success_color = Color(0.45, 0.95, 0.5); Color warning_color = Color(1, 0.87, 0.4); @@ -483,21 +483,21 @@ Ref create_editor_theme(const Ref p_theme) { error_color = error_color.lerp(mono_color, 0.25); } - theme->set_color("success_color", "Editor", success_color); - theme->set_color("warning_color", "Editor", warning_color); - theme->set_color("error_color", "Editor", error_color); - theme->set_color("property_color", "Editor", property_color); - theme->set_color("readonly_color", "Editor", readonly_color); + theme->set_color(SNAME("success_color"), SNAME("Editor"), success_color); + theme->set_color(SNAME("warning_color"), SNAME("Editor"), warning_color); + theme->set_color(SNAME("error_color"), SNAME("Editor"), error_color); + theme->set_color(SNAME("property_color"), SNAME("Editor"), property_color); + theme->set_color(SNAME("readonly_color"), SNAME("Editor"), readonly_color); if (!dark_theme) { - theme->set_color("vulkan_color", "Editor", Color::hex(0xad1128ff)); + theme->set_color(SNAME("vulkan_color"), SNAME("Editor"), Color::hex(0xad1128ff)); } else { - theme->set_color("vulkan_color", "Editor", Color(1.0, 0.0, 0.0)); + theme->set_color(SNAME("vulkan_color"), SNAME("Editor"), Color(1.0, 0.0, 0.0)); } const int thumb_size = EDITOR_GET("filesystem/file_dialog/thumbnail_size"); - theme->set_constant("scale", "Editor", EDSCALE); - theme->set_constant("thumb_size", "Editor", thumb_size); - theme->set_constant("dark_theme", "Editor", dark_theme); + theme->set_constant(SNAME("scale"), SNAME("Editor"), EDSCALE); + theme->set_constant(SNAME("thumb_size"), SNAME("Editor"), thumb_size); + theme->set_constant(SNAME("dark_theme"), SNAME("Editor"), dark_theme); // Register icons + font @@ -632,113 +632,113 @@ Ref create_editor_theme(const Ref p_theme) { // Editor background Color background_color_opaque = background_color; background_color_opaque.a = 1.0; - theme->set_stylebox("Background", "EditorStyles", make_flat_stylebox(background_color_opaque, default_margin_size, default_margin_size, default_margin_size, default_margin_size)); + theme->set_stylebox(SNAME("Background"), SNAME("EditorStyles"), make_flat_stylebox(background_color_opaque, default_margin_size, default_margin_size, default_margin_size, default_margin_size)); // Focus - theme->set_stylebox("Focus", "EditorStyles", style_widget_focus); + theme->set_stylebox(SNAME("Focus"), SNAME("EditorStyles"), style_widget_focus); // Use a less opaque color to be less distracting for the 2D and 3D editor viewports. Ref style_widget_focus_viewport = style_widget_focus->duplicate(); style_widget_focus_viewport->set_border_color(accent_color * Color(1, 1, 1, 0.5)); - theme->set_stylebox("FocusViewport", "EditorStyles", style_widget_focus_viewport); + theme->set_stylebox(SNAME("FocusViewport"), SNAME("EditorStyles"), style_widget_focus_viewport); // Menu Ref style_menu = style_widget->duplicate(); style_menu->set_draw_center(false); style_menu->set_border_width_all(0); - theme->set_stylebox("panel", "PanelContainer", style_menu); - theme->set_stylebox("MenuPanel", "EditorStyles", style_menu); + theme->set_stylebox(SNAME("panel"), SNAME("PanelContainer"), style_menu); + theme->set_stylebox(SNAME("MenuPanel"), SNAME("EditorStyles"), style_menu); // CanvasItem Editor Ref style_canvas_editor_info = make_flat_stylebox(Color(0.0, 0.0, 0.0, 0.2)); style_canvas_editor_info->set_expand_margin_size_all(4 * EDSCALE); - theme->set_stylebox("CanvasItemInfoOverlay", "EditorStyles", style_canvas_editor_info); + theme->set_stylebox(SNAME("CanvasItemInfoOverlay"), SNAME("EditorStyles"), style_canvas_editor_info); // Script Editor - theme->set_stylebox("ScriptEditorPanel", "EditorStyles", make_empty_stylebox(default_margin_size, 0, default_margin_size, default_margin_size)); - theme->set_stylebox("ScriptEditor", "EditorStyles", make_empty_stylebox(0, 0, 0, 0)); + theme->set_stylebox(SNAME("ScriptEditorPanel"), SNAME("EditorStyles"), make_empty_stylebox(default_margin_size, 0, default_margin_size, default_margin_size)); + theme->set_stylebox(SNAME("ScriptEditor"), SNAME("EditorStyles"), make_empty_stylebox(0, 0, 0, 0)); // Play button group - theme->set_stylebox("PlayButtonPanel", "EditorStyles", style_empty); + theme->set_stylebox(SNAME("PlayButtonPanel"), SNAME("EditorStyles"), style_empty); - theme->set_stylebox("normal", "MenuButton", style_menu); - theme->set_stylebox("hover", "MenuButton", style_widget_hover); - theme->set_stylebox("pressed", "MenuButton", style_menu); - theme->set_stylebox("focus", "MenuButton", style_menu); - theme->set_stylebox("disabled", "MenuButton", style_menu); + theme->set_stylebox(SNAME("normal"), SNAME("MenuButton"), style_menu); + theme->set_stylebox(SNAME("hover"), SNAME("MenuButton"), style_widget_hover); + theme->set_stylebox(SNAME("pressed"), SNAME("MenuButton"), style_menu); + theme->set_stylebox(SNAME("focus"), SNAME("MenuButton"), style_menu); + theme->set_stylebox(SNAME("disabled"), SNAME("MenuButton"), style_menu); - theme->set_color("font_color", "MenuButton", font_color); - theme->set_color("font_hover_color", "MenuButton", font_hover_color); - theme->set_color("font_focus_color", "MenuButton", font_focus_color); + theme->set_color(SNAME("font_color"), SNAME("MenuButton"), font_color); + theme->set_color(SNAME("font_hover_color"), SNAME("MenuButton"), font_hover_color); + theme->set_color(SNAME("font_focus_color"), SNAME("MenuButton"), font_focus_color); - theme->set_stylebox("MenuHover", "EditorStyles", style_widget_hover); + theme->set_stylebox(SNAME("MenuHover"), SNAME("EditorStyles"), style_widget_hover); // Buttons - theme->set_stylebox("normal", "Button", style_widget); - theme->set_stylebox("hover", "Button", style_widget_hover); - theme->set_stylebox("pressed", "Button", style_widget_pressed); - theme->set_stylebox("focus", "Button", style_widget_focus); - theme->set_stylebox("disabled", "Button", style_widget_disabled); - - theme->set_color("font_color", "Button", font_color); - theme->set_color("font_hover_color", "Button", font_hover_color); - theme->set_color("font_focus_color", "Button", font_focus_color); - theme->set_color("font_pressed_color", "Button", accent_color); - theme->set_color("font_disabled_color", "Button", font_disabled_color); - theme->set_color("icon_hover_color", "Button", icon_hover_color); - theme->set_color("icon_focus_color", "Button", icon_focus_color); - theme->set_color("icon_pressed_color", "Button", icon_pressed_color); + theme->set_stylebox(SNAME("normal"), SNAME("Button"), style_widget); + theme->set_stylebox(SNAME("hover"), SNAME("Button"), style_widget_hover); + theme->set_stylebox(SNAME("pressed"), SNAME("Button"), style_widget_pressed); + theme->set_stylebox(SNAME("focus"), SNAME("Button"), style_widget_focus); + theme->set_stylebox(SNAME("disabled"), SNAME("Button"), style_widget_disabled); + + theme->set_color(SNAME("font_color"), SNAME("Button"), font_color); + theme->set_color(SNAME("font_hover_color"), SNAME("Button"), font_hover_color); + theme->set_color(SNAME("font_focus_color"), SNAME("Button"), font_focus_color); + theme->set_color(SNAME("font_pressed_color"), SNAME("Button"), accent_color); + theme->set_color(SNAME("font_disabled_color"), SNAME("Button"), font_disabled_color); + theme->set_color(SNAME("icon_hover_color"), SNAME("Button"), icon_hover_color); + theme->set_color(SNAME("icon_focus_color"), SNAME("Button"), icon_focus_color); + theme->set_color(SNAME("icon_pressed_color"), SNAME("Button"), icon_pressed_color); // OptionButton - theme->set_stylebox("focus", "OptionButton", style_widget_focus); - - theme->set_stylebox("normal", "OptionButton", style_widget); - theme->set_stylebox("hover", "OptionButton", style_widget_hover); - theme->set_stylebox("pressed", "OptionButton", style_widget_pressed); - theme->set_stylebox("disabled", "OptionButton", style_widget_disabled); - - theme->set_stylebox("normal_mirrored", "OptionButton", style_widget); - theme->set_stylebox("hover_mirrored", "OptionButton", style_widget_hover); - theme->set_stylebox("pressed_mirrored", "OptionButton", style_widget_pressed); - theme->set_stylebox("disabled_mirrored", "OptionButton", style_widget_disabled); - - theme->set_color("font_color", "OptionButton", font_color); - theme->set_color("font_hover_color", "OptionButton", font_hover_color); - theme->set_color("font_focus_color", "OptionButton", font_focus_color); - theme->set_color("font_pressed_color", "OptionButton", accent_color); - theme->set_color("font_disabled_color", "OptionButton", font_disabled_color); - theme->set_color("icon_hover_color", "OptionButton", icon_hover_color); - theme->set_color("icon_focus_color", "OptionButton", icon_focus_color); - theme->set_icon("arrow", "OptionButton", theme->get_icon(SNAME("GuiOptionArrow"), SNAME("EditorIcons"))); - theme->set_constant("arrow_margin", "OptionButton", widget_default_margin.x - 2 * EDSCALE); - theme->set_constant("modulate_arrow", "OptionButton", true); - theme->set_constant("hseparation", "OptionButton", 4 * EDSCALE); + theme->set_stylebox(SNAME("focus"), SNAME("OptionButton"), style_widget_focus); + + theme->set_stylebox(SNAME("normal"), SNAME("OptionButton"), style_widget); + theme->set_stylebox(SNAME("hover"), SNAME("OptionButton"), style_widget_hover); + theme->set_stylebox(SNAME("pressed"), SNAME("OptionButton"), style_widget_pressed); + theme->set_stylebox(SNAME("disabled"), SNAME("OptionButton"), style_widget_disabled); + + theme->set_stylebox(SNAME("normal_mirrored"), SNAME("OptionButton"), style_widget); + theme->set_stylebox(SNAME("hover_mirrored"), SNAME("OptionButton"), style_widget_hover); + theme->set_stylebox(SNAME("pressed_mirrored"), SNAME("OptionButton"), style_widget_pressed); + theme->set_stylebox(SNAME("disabled_mirrored"), SNAME("OptionButton"), style_widget_disabled); + + theme->set_color(SNAME("font_color"), SNAME("OptionButton"), font_color); + theme->set_color(SNAME("font_hover_color"), SNAME("OptionButton"), font_hover_color); + theme->set_color(SNAME("font_focus_color"), SNAME("OptionButton"), font_focus_color); + theme->set_color(SNAME("font_pressed_color"), SNAME("OptionButton"), accent_color); + theme->set_color(SNAME("font_disabled_color"), SNAME("OptionButton"), font_disabled_color); + theme->set_color(SNAME("icon_hover_color"), SNAME("OptionButton"), icon_hover_color); + theme->set_color(SNAME("icon_focus_color"), SNAME("OptionButton"), icon_focus_color); + theme->set_icon(SNAME("arrow"), SNAME("OptionButton"), theme->get_icon(SNAME("GuiOptionArrow"), SNAME("EditorIcons"))); + theme->set_constant(SNAME("arrow_margin"), SNAME("OptionButton"), widget_default_margin.x - 2 * EDSCALE); + theme->set_constant(SNAME("modulate_arrow"), SNAME("OptionButton"), true); + theme->set_constant(SNAME("hseparation"), SNAME("OptionButton"), 4 * EDSCALE); // CheckButton - theme->set_stylebox("normal", "CheckButton", style_menu); - theme->set_stylebox("pressed", "CheckButton", style_menu); - theme->set_stylebox("disabled", "CheckButton", style_menu); - theme->set_stylebox("hover", "CheckButton", style_menu); - - theme->set_icon("on", "CheckButton", theme->get_icon(SNAME("GuiToggleOn"), SNAME("EditorIcons"))); - theme->set_icon("on_disabled", "CheckButton", theme->get_icon(SNAME("GuiToggleOnDisabled"), SNAME("EditorIcons"))); - theme->set_icon("off", "CheckButton", theme->get_icon(SNAME("GuiToggleOff"), SNAME("EditorIcons"))); - theme->set_icon("off_disabled", "CheckButton", theme->get_icon(SNAME("GuiToggleOffDisabled"), SNAME("EditorIcons"))); - - theme->set_icon("on_mirrored", "CheckButton", theme->get_icon(SNAME("GuiToggleOnMirrored"), SNAME("EditorIcons"))); - theme->set_icon("on_disabled_mirrored", "CheckButton", theme->get_icon(SNAME("GuiToggleOnDisabledMirrored"), SNAME("EditorIcons"))); - theme->set_icon("off_mirrored", "CheckButton", theme->get_icon(SNAME("GuiToggleOffMirrored"), SNAME("EditorIcons"))); - theme->set_icon("off_disabled_mirrored", "CheckButton", theme->get_icon(SNAME("GuiToggleOffDisabledMirrored"), SNAME("EditorIcons"))); - - theme->set_color("font_color", "CheckButton", font_color); - theme->set_color("font_hover_color", "CheckButton", font_hover_color); - theme->set_color("font_focus_color", "CheckButton", font_focus_color); - theme->set_color("font_pressed_color", "CheckButton", accent_color); - theme->set_color("font_disabled_color", "CheckButton", font_disabled_color); - theme->set_color("icon_hover_color", "CheckButton", icon_hover_color); - theme->set_color("icon_focus_color", "CheckButton", icon_focus_color); - - theme->set_constant("hseparation", "CheckButton", 8 * EDSCALE); - theme->set_constant("check_vadjust", "CheckButton", 0 * EDSCALE); + theme->set_stylebox(SNAME("normal"), SNAME("CheckButton"), style_menu); + theme->set_stylebox(SNAME("pressed"), SNAME("CheckButton"), style_menu); + theme->set_stylebox(SNAME("disabled"), SNAME("CheckButton"), style_menu); + theme->set_stylebox(SNAME("hover"), SNAME("CheckButton"), style_menu); + + theme->set_icon(SNAME("on"), SNAME("CheckButton"), theme->get_icon(SNAME("GuiToggleOn"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("on_disabled"), SNAME("CheckButton"), theme->get_icon(SNAME("GuiToggleOnDisabled"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("off"), SNAME("CheckButton"), theme->get_icon(SNAME("GuiToggleOff"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("off_disabled"), SNAME("CheckButton"), theme->get_icon(SNAME("GuiToggleOffDisabled"), SNAME("EditorIcons"))); + + theme->set_icon(SNAME("on_mirrored"), SNAME("CheckButton"), theme->get_icon(SNAME("GuiToggleOnMirrored"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("on_disabled_mirrored"), SNAME("CheckButton"), theme->get_icon(SNAME("GuiToggleOnDisabledMirrored"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("off_mirrored"), SNAME("CheckButton"), theme->get_icon(SNAME("GuiToggleOffMirrored"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("off_disabled_mirrored"), SNAME("CheckButton"), theme->get_icon(SNAME("GuiToggleOffDisabledMirrored"), SNAME("EditorIcons"))); + + theme->set_color(SNAME("font_color"), SNAME("CheckButton"), font_color); + theme->set_color(SNAME("font_hover_color"), SNAME("CheckButton"), font_hover_color); + theme->set_color(SNAME("font_focus_color"), SNAME("CheckButton"), font_focus_color); + theme->set_color(SNAME("font_pressed_color"), SNAME("CheckButton"), accent_color); + theme->set_color(SNAME("font_disabled_color"), SNAME("CheckButton"), font_disabled_color); + theme->set_color(SNAME("icon_hover_color"), SNAME("CheckButton"), icon_hover_color); + theme->set_color(SNAME("icon_focus_color"), SNAME("CheckButton"), icon_focus_color); + + theme->set_constant(SNAME("hseparation"), SNAME("CheckButton"), 8 * EDSCALE); + theme->set_constant(SNAME("check_vadjust"), SNAME("CheckButton"), 0 * EDSCALE); // Checkbox Ref sb_checkbox = style_menu->duplicate(); @@ -747,32 +747,32 @@ Ref create_editor_theme(const Ref p_theme) { sb_checkbox->set_default_margin(SIDE_TOP, default_margin_size * EDSCALE); sb_checkbox->set_default_margin(SIDE_BOTTOM, default_margin_size * EDSCALE); - theme->set_stylebox("normal", "CheckBox", sb_checkbox); - theme->set_stylebox("pressed", "CheckBox", sb_checkbox); - theme->set_stylebox("disabled", "CheckBox", sb_checkbox); - theme->set_stylebox("hover", "CheckBox", sb_checkbox); - theme->set_icon("checked", "CheckBox", theme->get_icon(SNAME("GuiChecked"), SNAME("EditorIcons"))); - theme->set_icon("unchecked", "CheckBox", theme->get_icon(SNAME("GuiUnchecked"), SNAME("EditorIcons"))); - theme->set_icon("radio_checked", "CheckBox", theme->get_icon(SNAME("GuiRadioChecked"), SNAME("EditorIcons"))); - theme->set_icon("radio_unchecked", "CheckBox", theme->get_icon(SNAME("GuiRadioUnchecked"), SNAME("EditorIcons"))); - theme->set_icon("checked_disabled", "CheckBox", theme->get_icon(SNAME("GuiCheckedDisabled"), SNAME("EditorIcons"))); - theme->set_icon("unchecked_disabled", "CheckBox", theme->get_icon(SNAME("GuiUncheckedDisabled"), SNAME("EditorIcons"))); - theme->set_icon("radio_checked_disabled", "CheckBox", theme->get_icon(SNAME("GuiRadioCheckedDisabled"), SNAME("EditorIcons"))); - theme->set_icon("radio_unchecked_disabled", "CheckBox", theme->get_icon(SNAME("GuiRadioUncheckedDisabled"), SNAME("EditorIcons"))); - - theme->set_color("font_color", "CheckBox", font_color); - theme->set_color("font_hover_color", "CheckBox", font_hover_color); - theme->set_color("font_focus_color", "CheckBox", font_focus_color); - theme->set_color("font_pressed_color", "CheckBox", accent_color); - theme->set_color("font_disabled_color", "CheckBox", font_disabled_color); - theme->set_color("icon_hover_color", "CheckBox", icon_hover_color); - theme->set_color("icon_focus_color", "CheckBox", icon_focus_color); - - theme->set_constant("hseparation", "CheckBox", 8 * EDSCALE); - theme->set_constant("check_vadjust", "CheckBox", 0 * EDSCALE); + theme->set_stylebox(SNAME("normal"), SNAME("CheckBox"), sb_checkbox); + theme->set_stylebox(SNAME("pressed"), SNAME("CheckBox"), sb_checkbox); + theme->set_stylebox(SNAME("disabled"), SNAME("CheckBox"), sb_checkbox); + theme->set_stylebox(SNAME("hover"), SNAME("CheckBox"), sb_checkbox); + theme->set_icon(SNAME("checked"), SNAME("CheckBox"), theme->get_icon(SNAME("GuiChecked"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("unchecked"), SNAME("CheckBox"), theme->get_icon(SNAME("GuiUnchecked"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("radio_checked"), SNAME("CheckBox"), theme->get_icon(SNAME("GuiRadioChecked"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("radio_unchecked"), SNAME("CheckBox"), theme->get_icon(SNAME("GuiRadioUnchecked"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("checked_disabled"), SNAME("CheckBox"), theme->get_icon(SNAME("GuiCheckedDisabled"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("unchecked_disabled"), SNAME("CheckBox"), theme->get_icon(SNAME("GuiUncheckedDisabled"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("radio_checked_disabled"), SNAME("CheckBox"), theme->get_icon(SNAME("GuiRadioCheckedDisabled"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("radio_unchecked_disabled"), SNAME("CheckBox"), theme->get_icon(SNAME("GuiRadioUncheckedDisabled"), SNAME("EditorIcons"))); + + theme->set_color(SNAME("font_color"), SNAME("CheckBox"), font_color); + theme->set_color(SNAME("font_hover_color"), SNAME("CheckBox"), font_hover_color); + theme->set_color(SNAME("font_focus_color"), SNAME("CheckBox"), font_focus_color); + theme->set_color(SNAME("font_pressed_color"), SNAME("CheckBox"), accent_color); + theme->set_color(SNAME("font_disabled_color"), SNAME("CheckBox"), font_disabled_color); + theme->set_color(SNAME("icon_hover_color"), SNAME("CheckBox"), icon_hover_color); + theme->set_color(SNAME("icon_focus_color"), SNAME("CheckBox"), icon_focus_color); + + theme->set_constant(SNAME("hseparation"), SNAME("CheckBox"), 8 * EDSCALE); + theme->set_constant(SNAME("check_vadjust"), SNAME("CheckBox"), 0 * EDSCALE); // PopupDialog - theme->set_stylebox("panel", "PopupDialog", style_popup); + theme->set_stylebox(SNAME("panel"), SNAME("PopupDialog"), style_popup); // PopupMenu const int popup_menu_margin_size = default_margin_size * 1.5 * EDSCALE; @@ -787,39 +787,39 @@ Ref create_editor_theme(const Ref p_theme) { // Always display a border for PopupMenus so they can be distinguished from their background. style_popup_menu->set_border_width_all(1 * EDSCALE); style_popup_menu->set_border_color(dark_color_2); - theme->set_stylebox("panel", "PopupMenu", style_popup_menu); + theme->set_stylebox(SNAME("panel"), SNAME("PopupMenu"), style_popup_menu); Ref style_menu_hover = style_widget_hover->duplicate(); // Don't use rounded corners for hover highlights since the StyleBox touches the PopupMenu's edges. style_menu_hover->set_corner_radius_all(0); - theme->set_stylebox("hover", "PopupMenu", style_menu_hover); - - theme->set_stylebox("separator", "PopupMenu", style_popup_separator); - theme->set_stylebox("labeled_separator_left", "PopupMenu", style_popup_labeled_separator_left); - theme->set_stylebox("labeled_separator_right", "PopupMenu", style_popup_labeled_separator_right); - - theme->set_color("font_color", "PopupMenu", font_color); - theme->set_color("font_hover_color", "PopupMenu", font_hover_color); - theme->set_color("font_accelerator_color", "PopupMenu", font_disabled_color); - theme->set_color("font_disabled_color", "PopupMenu", font_disabled_color); - theme->set_color("font_separator_color", "PopupMenu", font_disabled_color); - theme->set_icon("checked", "PopupMenu", theme->get_icon(SNAME("GuiChecked"), SNAME("EditorIcons"))); - theme->set_icon("unchecked", "PopupMenu", theme->get_icon(SNAME("GuiUnchecked"), SNAME("EditorIcons"))); - theme->set_icon("radio_checked", "PopupMenu", theme->get_icon(SNAME("GuiRadioChecked"), SNAME("EditorIcons"))); - theme->set_icon("radio_unchecked", "PopupMenu", theme->get_icon(SNAME("GuiRadioUnchecked"), SNAME("EditorIcons"))); - theme->set_icon("checked_disabled", "PopupMenu", theme->get_icon(SNAME("GuiCheckedDisabled"), SNAME("EditorIcons"))); - theme->set_icon("unchecked_disabled", "PopupMenu", theme->get_icon(SNAME("GuiUncheckedDisabled"), SNAME("EditorIcons"))); - theme->set_icon("radio_checked_disabled", "PopupMenu", theme->get_icon(SNAME("GuiRadioCheckedDisabled"), SNAME("EditorIcons"))); - theme->set_icon("radio_unchecked_disabled", "PopupMenu", theme->get_icon(SNAME("GuiRadioUncheckedDisabled"), SNAME("EditorIcons"))); - theme->set_icon("submenu", "PopupMenu", theme->get_icon(SNAME("ArrowRight"), SNAME("EditorIcons"))); - theme->set_icon("submenu_mirrored", "PopupMenu", theme->get_icon(SNAME("ArrowLeft"), SNAME("EditorIcons"))); - theme->set_icon("visibility_hidden", "PopupMenu", theme->get_icon(SNAME("GuiVisibilityHidden"), SNAME("EditorIcons"))); - theme->set_icon("visibility_visible", "PopupMenu", theme->get_icon(SNAME("GuiVisibilityVisible"), SNAME("EditorIcons"))); - theme->set_icon("visibility_xray", "PopupMenu", theme->get_icon(SNAME("GuiVisibilityXray"), SNAME("EditorIcons"))); - - theme->set_constant("vseparation", "PopupMenu", (extra_spacing + default_margin_size + 1) * EDSCALE); - theme->set_constant("item_start_padding", "PopupMenu", popup_menu_margin_size * EDSCALE); - theme->set_constant("item_end_padding", "PopupMenu", popup_menu_margin_size * EDSCALE); + theme->set_stylebox(SNAME("hover"), SNAME("PopupMenu"), style_menu_hover); + + theme->set_stylebox(SNAME("separator"), SNAME("PopupMenu"), style_popup_separator); + theme->set_stylebox(SNAME("labeled_separator_left"), SNAME("PopupMenu"), style_popup_labeled_separator_left); + theme->set_stylebox(SNAME("labeled_separator_right"), SNAME("PopupMenu"), style_popup_labeled_separator_right); + + theme->set_color(SNAME("font_color"), SNAME("PopupMenu"), font_color); + theme->set_color(SNAME("font_hover_color"), SNAME("PopupMenu"), font_hover_color); + theme->set_color(SNAME("font_accelerator_color"), SNAME("PopupMenu"), font_disabled_color); + theme->set_color(SNAME("font_disabled_color"), SNAME("PopupMenu"), font_disabled_color); + theme->set_color(SNAME("font_separator_color"), SNAME("PopupMenu"), font_disabled_color); + theme->set_icon(SNAME("checked"), SNAME("PopupMenu"), theme->get_icon(SNAME("GuiChecked"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("unchecked"), SNAME("PopupMenu"), theme->get_icon(SNAME("GuiUnchecked"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("radio_checked"), SNAME("PopupMenu"), theme->get_icon(SNAME("GuiRadioChecked"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("radio_unchecked"), SNAME("PopupMenu"), theme->get_icon(SNAME("GuiRadioUnchecked"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("checked_disabled"), SNAME("PopupMenu"), theme->get_icon(SNAME("GuiCheckedDisabled"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("unchecked_disabled"), SNAME("PopupMenu"), theme->get_icon(SNAME("GuiUncheckedDisabled"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("radio_checked_disabled"), SNAME("PopupMenu"), theme->get_icon(SNAME("GuiRadioCheckedDisabled"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("radio_unchecked_disabled"), SNAME("PopupMenu"), theme->get_icon(SNAME("GuiRadioUncheckedDisabled"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("submenu"), SNAME("PopupMenu"), theme->get_icon(SNAME("ArrowRight"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("submenu_mirrored"), SNAME("PopupMenu"), theme->get_icon(SNAME("ArrowLeft"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("visibility_hidden"), SNAME("PopupMenu"), theme->get_icon(SNAME("GuiVisibilityHidden"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("visibility_visible"), SNAME("PopupMenu"), theme->get_icon(SNAME("GuiVisibilityVisible"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("visibility_xray"), SNAME("PopupMenu"), theme->get_icon(SNAME("GuiVisibilityXray"), SNAME("EditorIcons"))); + + theme->set_constant(SNAME("vseparation"), SNAME("PopupMenu"), (extra_spacing + default_margin_size + 1) * EDSCALE); + theme->set_constant(SNAME("item_start_padding"), SNAME("PopupMenu"), popup_menu_margin_size * EDSCALE); + theme->set_constant(SNAME("item_end_padding"), SNAME("PopupMenu"), popup_menu_margin_size * EDSCALE); for (int i = 0; i < 16; i++) { Color si_base_color = accent_color; @@ -843,7 +843,7 @@ Ref create_editor_theme(const Ref p_theme) { sub_inspector_bg->set_border_color(si_base_color * Color(0.7, 0.7, 0.7, 0.8)); sub_inspector_bg->set_draw_center(true); - theme->set_stylebox("sub_inspector_bg" + itos(i), "Editor", sub_inspector_bg); + theme->set_stylebox("sub_inspector_bg" + itos(i), SNAME("Editor"), sub_inspector_bg); Ref bg_color; bg_color.instantiate(); @@ -855,99 +855,99 @@ Ref create_editor_theme(const Ref p_theme) { bg_color_selected->set_border_width_all(0); bg_color_selected->set_bg_color(si_base_color * Color(0.8, 0.8, 0.8, 0.8)); - theme->set_stylebox("sub_inspector_property_bg" + itos(i), "Editor", bg_color); - theme->set_stylebox("sub_inspector_property_bg_selected" + itos(i), "Editor", bg_color_selected); + theme->set_stylebox("sub_inspector_property_bg" + itos(i), SNAME("Editor"), bg_color); + theme->set_stylebox("sub_inspector_property_bg_selected" + itos(i), SNAME("Editor"), bg_color_selected); } - theme->set_color("sub_inspector_property_color", "Editor", dark_theme ? Color(1, 1, 1, 1) : Color(0, 0, 0, 1)); - theme->set_constant("sub_inspector_font_offset", "Editor", 4 * EDSCALE); + theme->set_color(SNAME("sub_inspector_property_color"), SNAME("Editor"), dark_theme ? Color(1, 1, 1, 1) : Color(0, 0, 0, 1)); + theme->set_constant(SNAME("sub_inspector_font_offset"), SNAME("Editor"), 4 * EDSCALE); Ref style_property_bg = style_default->duplicate(); style_property_bg->set_bg_color(highlight_color); style_property_bg->set_border_width_all(0); - theme->set_constant("font_offset", "EditorProperty", 8 * EDSCALE); - theme->set_stylebox("bg_selected", "EditorProperty", style_property_bg); - theme->set_stylebox("bg", "EditorProperty", Ref(memnew(StyleBoxEmpty))); - theme->set_constant("vseparation", "EditorProperty", (extra_spacing + default_margin_size) * EDSCALE); - theme->set_color("warning_color", "EditorProperty", warning_color); - theme->set_color("property_color", "EditorProperty", property_color); - theme->set_color("readonly_color", "EditorProperty", readonly_color); - theme->set_color("readonly_warning_color", "EditorProperty", readonly_warning_color); + theme->set_constant(SNAME("font_offset"), SNAME("EditorProperty"), 8 * EDSCALE); + theme->set_stylebox(SNAME("bg_selected"), SNAME("EditorProperty"), style_property_bg); + theme->set_stylebox(SNAME("bg"), SNAME("EditorProperty"), Ref(memnew(StyleBoxEmpty))); + theme->set_constant(SNAME("vseparation"), SNAME("EditorProperty"), (extra_spacing + default_margin_size) * EDSCALE); + theme->set_color(SNAME("warning_color"), SNAME("EditorProperty"), warning_color); + theme->set_color(SNAME("property_color"), SNAME("EditorProperty"), property_color); + theme->set_color(SNAME("readonly_color"), SNAME("EditorProperty"), readonly_color); + theme->set_color(SNAME("readonly_warning_color"), SNAME("EditorProperty"), readonly_warning_color); Color inspector_section_color = font_color.lerp(Color(0.5, 0.5, 0.5), 0.35); - theme->set_color("font_color", "EditorInspectorSection", inspector_section_color); + theme->set_color(SNAME("font_color"), SNAME("EditorInspectorSection"), inspector_section_color); - theme->set_constant("inspector_margin", "Editor", 12 * EDSCALE); + theme->set_constant(SNAME("inspector_margin"), SNAME("Editor"), 12 * EDSCALE); // Tree & ItemList background Ref style_tree_bg = style_default->duplicate(); // Make Trees easier to distinguish from other controls by using a darker background color. style_tree_bg->set_bg_color(dark_color_1.lerp(dark_color_2, 0.5)); style_tree_bg->set_border_color(dark_color_3); - theme->set_stylebox("bg", "Tree", style_tree_bg); + theme->set_stylebox(SNAME("bg"), SNAME("Tree"), style_tree_bg); // Tree - theme->set_icon("checked", "Tree", theme->get_icon(SNAME("GuiChecked"), SNAME("EditorIcons"))); - theme->set_icon("indeterminate", "Tree", theme->get_icon(SNAME("GuiIndeterminate"), SNAME("EditorIcons"))); - theme->set_icon("unchecked", "Tree", theme->get_icon(SNAME("GuiUnchecked"), SNAME("EditorIcons"))); - theme->set_icon("arrow", "Tree", theme->get_icon(SNAME("GuiTreeArrowDown"), SNAME("EditorIcons"))); - theme->set_icon("arrow_collapsed", "Tree", theme->get_icon(SNAME("GuiTreeArrowRight"), SNAME("EditorIcons"))); - theme->set_icon("arrow_collapsed_mirrored", "Tree", theme->get_icon(SNAME("GuiTreeArrowLeft"), SNAME("EditorIcons"))); - theme->set_icon("updown", "Tree", theme->get_icon(SNAME("GuiTreeUpdown"), SNAME("EditorIcons"))); - theme->set_icon("select_arrow", "Tree", theme->get_icon(SNAME("GuiDropdown"), SNAME("EditorIcons"))); - theme->set_stylebox("bg_focus", "Tree", style_widget_focus); - theme->set_stylebox("custom_button", "Tree", make_empty_stylebox()); - theme->set_stylebox("custom_button_pressed", "Tree", make_empty_stylebox()); - theme->set_stylebox("custom_button_hover", "Tree", style_widget); - theme->set_color("custom_button_font_highlight", "Tree", font_hover_color); - theme->set_color("font_color", "Tree", font_color); - theme->set_color("font_selected_color", "Tree", mono_color); - theme->set_color("title_button_color", "Tree", font_color); - theme->set_color("drop_position_color", "Tree", accent_color); - theme->set_constant("vseparation", "Tree", widget_default_margin.y - EDSCALE); - theme->set_constant("hseparation", "Tree", 6 * EDSCALE); - theme->set_constant("guide_width", "Tree", border_width); - theme->set_constant("item_margin", "Tree", 3 * default_margin_size * EDSCALE); - theme->set_constant("button_margin", "Tree", default_margin_size * EDSCALE); - theme->set_constant("scroll_border", "Tree", 40 * EDSCALE); - theme->set_constant("scroll_speed", "Tree", 12); + theme->set_icon(SNAME("checked"), SNAME("Tree"), theme->get_icon(SNAME("GuiChecked"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("indeterminate"), SNAME("Tree"), theme->get_icon(SNAME("GuiIndeterminate"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("unchecked"), SNAME("Tree"), theme->get_icon(SNAME("GuiUnchecked"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("arrow"), SNAME("Tree"), theme->get_icon(SNAME("GuiTreeArrowDown"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("arrow_collapsed"), SNAME("Tree"), theme->get_icon(SNAME("GuiTreeArrowRight"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("arrow_collapsed_mirrored"), SNAME("Tree"), theme->get_icon(SNAME("GuiTreeArrowLeft"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("updown"), SNAME("Tree"), theme->get_icon(SNAME("GuiTreeUpdown"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("select_arrow"), SNAME("Tree"), theme->get_icon(SNAME("GuiDropdown"), SNAME("EditorIcons"))); + theme->set_stylebox(SNAME("bg_focus"), SNAME("Tree"), style_widget_focus); + theme->set_stylebox(SNAME("custom_button"), SNAME("Tree"), make_empty_stylebox()); + theme->set_stylebox(SNAME("custom_button_pressed"), SNAME("Tree"), make_empty_stylebox()); + theme->set_stylebox(SNAME("custom_button_hover"), SNAME("Tree"), style_widget); + theme->set_color(SNAME("custom_button_font_highlight"), SNAME("Tree"), font_hover_color); + theme->set_color(SNAME("font_color"), SNAME("Tree"), font_color); + theme->set_color(SNAME("font_selected_color"), SNAME("Tree"), mono_color); + theme->set_color(SNAME("title_button_color"), SNAME("Tree"), font_color); + theme->set_color(SNAME("drop_position_color"), SNAME("Tree"), accent_color); + theme->set_constant(SNAME("vseparation"), SNAME("Tree"), widget_default_margin.y - EDSCALE); + theme->set_constant(SNAME("hseparation"), SNAME("Tree"), 6 * EDSCALE); + theme->set_constant(SNAME("guide_width"), SNAME("Tree"), border_width); + theme->set_constant(SNAME("item_margin"), SNAME("Tree"), 3 * default_margin_size * EDSCALE); + theme->set_constant(SNAME("button_margin"), SNAME("Tree"), default_margin_size * EDSCALE); + theme->set_constant(SNAME("scroll_border"), SNAME("Tree"), 40 * EDSCALE); + theme->set_constant(SNAME("scroll_speed"), SNAME("Tree"), 12); const Color guide_color = mono_color * Color(1, 1, 1, 0.05); Color relationship_line_color = mono_color * Color(1, 1, 1, relationship_line_opacity); - theme->set_constant("draw_guides", "Tree", relationship_line_opacity < 0.01); - theme->set_color("guide_color", "Tree", guide_color); + theme->set_constant(SNAME("draw_guides"), SNAME("Tree"), relationship_line_opacity < 0.01); + theme->set_color(SNAME("guide_color"), SNAME("Tree"), guide_color); int relationship_line_width = 1; Color parent_line_color = mono_color * Color(1, 1, 1, CLAMP(relationship_line_opacity + 0.45, 0.0, 1.0)); Color children_line_color = mono_color * Color(1, 1, 1, CLAMP(relationship_line_opacity + 0.25, 0.0, 1.0)); - theme->set_constant("draw_relationship_lines", "Tree", relationship_line_opacity >= 0.01); - theme->set_constant("relationship_line_width", "Tree", relationship_line_width); - theme->set_constant("parent_hl_line_width", "Tree", relationship_line_width * 2); - theme->set_constant("children_hl_line_width", "Tree", relationship_line_width); - theme->set_constant("parent_hl_line_margin", "Tree", relationship_line_width * 3); - theme->set_color("relationship_line_color", "Tree", relationship_line_color); - theme->set_color("parent_hl_line_color", "Tree", parent_line_color); - theme->set_color("children_hl_line_color", "Tree", children_line_color); + theme->set_constant(SNAME("draw_relationship_lines"), SNAME("Tree"), relationship_line_opacity >= 0.01); + theme->set_constant(SNAME("relationship_line_width"), SNAME("Tree"), relationship_line_width); + theme->set_constant(SNAME("parent_hl_line_width"), SNAME("Tree"), relationship_line_width * 2); + theme->set_constant(SNAME("children_hl_line_width"), SNAME("Tree"), relationship_line_width); + theme->set_constant(SNAME("parent_hl_line_margin"), SNAME("Tree"), relationship_line_width * 3); + theme->set_color(SNAME("relationship_line_color"), SNAME("Tree"), relationship_line_color); + theme->set_color(SNAME("parent_hl_line_color"), SNAME("Tree"), parent_line_color); + theme->set_color(SNAME("children_hl_line_color"), SNAME("Tree"), children_line_color); Ref style_tree_btn = style_default->duplicate(); style_tree_btn->set_bg_color(highlight_color); style_tree_btn->set_border_width_all(0); - theme->set_stylebox("button_pressed", "Tree", style_tree_btn); + theme->set_stylebox(SNAME("button_pressed"), SNAME("Tree"), style_tree_btn); Ref style_tree_hover = style_default->duplicate(); style_tree_hover->set_bg_color(highlight_color * Color(1, 1, 1, 0.4)); style_tree_hover->set_border_width_all(0); - theme->set_stylebox("hover", "Tree", style_tree_hover); + theme->set_stylebox(SNAME("hover"), SNAME("Tree"), style_tree_hover); Ref style_tree_focus = style_default->duplicate(); style_tree_focus->set_bg_color(highlight_color); style_tree_focus->set_border_width_all(0); - theme->set_stylebox("selected_focus", "Tree", style_tree_focus); + theme->set_stylebox(SNAME("selected_focus"), SNAME("Tree"), style_tree_focus); Ref style_tree_selected = style_tree_focus->duplicate(); - theme->set_stylebox("selected", "Tree", style_tree_selected); + theme->set_stylebox(SNAME("selected"), SNAME("Tree"), style_tree_selected); Ref style_tree_cursor = style_default->duplicate(); style_tree_cursor->set_draw_center(false); @@ -957,25 +957,25 @@ Ref create_editor_theme(const Ref p_theme) { Ref style_tree_title = style_default->duplicate(); style_tree_title->set_bg_color(dark_color_3); style_tree_title->set_border_width_all(0); - theme->set_stylebox("cursor", "Tree", style_tree_cursor); - theme->set_stylebox("cursor_unfocused", "Tree", style_tree_cursor); - theme->set_stylebox("title_button_normal", "Tree", style_tree_title); - theme->set_stylebox("title_button_hover", "Tree", style_tree_title); - theme->set_stylebox("title_button_pressed", "Tree", style_tree_title); + theme->set_stylebox(SNAME("cursor"), SNAME("Tree"), style_tree_cursor); + theme->set_stylebox(SNAME("cursor_unfocused"), SNAME("Tree"), style_tree_cursor); + theme->set_stylebox(SNAME("title_button_normal"), SNAME("Tree"), style_tree_title); + theme->set_stylebox(SNAME("title_button_hover"), SNAME("Tree"), style_tree_title); + theme->set_stylebox(SNAME("title_button_pressed"), SNAME("Tree"), style_tree_title); Color prop_category_color = dark_color_1.lerp(mono_color, 0.12); Color prop_section_color = dark_color_1.lerp(mono_color, 0.09); Color prop_subsection_color = dark_color_1.lerp(mono_color, 0.06); - theme->set_color("prop_category", "Editor", prop_category_color); - theme->set_color("prop_section", "Editor", prop_section_color); - theme->set_color("prop_subsection", "Editor", prop_subsection_color); - theme->set_color("drop_position_color", "Tree", accent_color); + theme->set_color(SNAME("prop_category"), SNAME("Editor"), prop_category_color); + theme->set_color(SNAME("prop_section"), SNAME("Editor"), prop_section_color); + theme->set_color(SNAME("prop_subsection"), SNAME("Editor"), prop_subsection_color); + theme->set_color(SNAME("drop_position_color"), SNAME("Tree"), accent_color); Ref category_bg = style_default->duplicate(); // Make Trees easier to distinguish from other controls by using a darker background color. category_bg->set_bg_color(prop_category_color); category_bg->set_border_color(prop_category_color); - theme->set_stylebox("prop_category_style", "Editor", category_bg); + theme->set_stylebox(SNAME("prop_category_style"), SNAME("Editor"), category_bg); // ItemList Ref style_itemlist_bg = style_default->duplicate(); @@ -987,47 +987,47 @@ Ref create_editor_theme(const Ref p_theme) { style_itemlist_cursor->set_draw_center(false); style_itemlist_cursor->set_border_width_all(border_width); style_itemlist_cursor->set_border_color(highlight_color); - theme->set_stylebox("cursor", "ItemList", style_itemlist_cursor); - theme->set_stylebox("cursor_unfocused", "ItemList", style_itemlist_cursor); - theme->set_stylebox("selected_focus", "ItemList", style_tree_focus); - theme->set_stylebox("selected", "ItemList", style_tree_selected); - theme->set_stylebox("bg_focus", "ItemList", style_widget_focus); - theme->set_stylebox("bg", "ItemList", style_itemlist_bg); - theme->set_color("font_color", "ItemList", font_color); - theme->set_color("font_selected_color", "ItemList", mono_color); - theme->set_color("guide_color", "ItemList", guide_color); - theme->set_constant("vseparation", "ItemList", widget_default_margin.y - EDSCALE); - theme->set_constant("hseparation", "ItemList", 6 * EDSCALE); - theme->set_constant("icon_margin", "ItemList", 6 * EDSCALE); - theme->set_constant("line_separation", "ItemList", 3 * EDSCALE); + theme->set_stylebox(SNAME("cursor"), SNAME("ItemList"), style_itemlist_cursor); + theme->set_stylebox(SNAME("cursor_unfocused"), SNAME("ItemList"), style_itemlist_cursor); + theme->set_stylebox(SNAME("selected_focus"), SNAME("ItemList"), style_tree_focus); + theme->set_stylebox(SNAME("selected"), SNAME("ItemList"), style_tree_selected); + theme->set_stylebox(SNAME("bg_focus"), SNAME("ItemList"), style_widget_focus); + theme->set_stylebox(SNAME("bg"), SNAME("ItemList"), style_itemlist_bg); + theme->set_color(SNAME("font_color"), SNAME("ItemList"), font_color); + theme->set_color(SNAME("font_selected_color"), SNAME("ItemList"), mono_color); + theme->set_color(SNAME("guide_color"), SNAME("ItemList"), guide_color); + theme->set_constant(SNAME("vseparation"), SNAME("ItemList"), widget_default_margin.y - EDSCALE); + theme->set_constant(SNAME("hseparation"), SNAME("ItemList"), 6 * EDSCALE); + theme->set_constant(SNAME("icon_margin"), SNAME("ItemList"), 6 * EDSCALE); + theme->set_constant(SNAME("line_separation"), SNAME("ItemList"), 3 * EDSCALE); // TabBar & TabContainer - theme->set_stylebox("tab_selected", "TabContainer", style_tab_selected); - theme->set_stylebox("tab_unselected", "TabContainer", style_tab_unselected); - theme->set_stylebox("tab_disabled", "TabContainer", style_tab_disabled); - theme->set_stylebox("tab_selected", "TabBar", style_tab_selected); - theme->set_stylebox("tab_unselected", "TabBar", style_tab_unselected); - theme->set_stylebox("tab_disabled", "TabBar", style_tab_disabled); - theme->set_color("font_selected_color", "TabContainer", font_color); - theme->set_color("font_unselected_color", "TabContainer", font_disabled_color); - theme->set_color("font_selected_color", "TabBar", font_color); - theme->set_color("font_unselected_color", "TabBar", font_disabled_color); - theme->set_icon("menu", "TabContainer", theme->get_icon(SNAME("GuiTabMenu"), SNAME("EditorIcons"))); - theme->set_icon("menu_highlight", "TabContainer", theme->get_icon(SNAME("GuiTabMenuHl"), SNAME("EditorIcons"))); - theme->set_stylebox("SceneTabFG", "EditorStyles", style_tab_selected); - theme->set_stylebox("SceneTabBG", "EditorStyles", style_tab_unselected); - theme->set_icon("close", "TabBar", theme->get_icon(SNAME("GuiClose"), SNAME("EditorIcons"))); - theme->set_stylebox("button_pressed", "TabBar", style_menu); - theme->set_stylebox("button_highlight", "TabBar", style_menu); - theme->set_icon("increment", "TabContainer", theme->get_icon(SNAME("GuiScrollArrowRight"), SNAME("EditorIcons"))); - theme->set_icon("decrement", "TabContainer", theme->get_icon(SNAME("GuiScrollArrowLeft"), SNAME("EditorIcons"))); - theme->set_icon("increment", "TabBar", theme->get_icon(SNAME("GuiScrollArrowRight"), SNAME("EditorIcons"))); - theme->set_icon("decrement", "TabBar", theme->get_icon(SNAME("GuiScrollArrowLeft"), SNAME("EditorIcons"))); - theme->set_icon("increment_highlight", "TabBar", theme->get_icon(SNAME("GuiScrollArrowRightHl"), SNAME("EditorIcons"))); - theme->set_icon("decrement_highlight", "TabBar", theme->get_icon(SNAME("GuiScrollArrowLeftHl"), SNAME("EditorIcons"))); - theme->set_icon("increment_highlight", "TabContainer", theme->get_icon(SNAME("GuiScrollArrowRightHl"), SNAME("EditorIcons"))); - theme->set_icon("decrement_highlight", "TabContainer", theme->get_icon(SNAME("GuiScrollArrowLeftHl"), SNAME("EditorIcons"))); - theme->set_constant("hseparation", "TabBar", 4 * EDSCALE); + theme->set_stylebox(SNAME("tab_selected"), SNAME("TabContainer"), style_tab_selected); + theme->set_stylebox(SNAME("tab_unselected"), SNAME("TabContainer"), style_tab_unselected); + theme->set_stylebox(SNAME("tab_disabled"), SNAME("TabContainer"), style_tab_disabled); + theme->set_stylebox(SNAME("tab_selected"), SNAME("TabBar"), style_tab_selected); + theme->set_stylebox(SNAME("tab_unselected"), SNAME("TabBar"), style_tab_unselected); + theme->set_stylebox(SNAME("tab_disabled"), SNAME("TabBar"), style_tab_disabled); + theme->set_color(SNAME("font_selected_color"), SNAME("TabContainer"), font_color); + theme->set_color(SNAME("font_unselected_color"), SNAME("TabContainer"), font_disabled_color); + theme->set_color(SNAME("font_selected_color"), SNAME("TabBar"), font_color); + theme->set_color(SNAME("font_unselected_color"), SNAME("TabBar"), font_disabled_color); + theme->set_icon(SNAME("menu"), SNAME("TabContainer"), theme->get_icon(SNAME("GuiTabMenu"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("menu_highlight"), SNAME("TabContainer"), theme->get_icon(SNAME("GuiTabMenuHl"), SNAME("EditorIcons"))); + theme->set_stylebox(SNAME("SceneTabFG"), SNAME("EditorStyles"), style_tab_selected); + theme->set_stylebox(SNAME("SceneTabBG"), SNAME("EditorStyles"), style_tab_unselected); + theme->set_icon(SNAME("close"), SNAME("TabBar"), theme->get_icon(SNAME("GuiClose"), SNAME("EditorIcons"))); + theme->set_stylebox(SNAME("button_pressed"), SNAME("TabBar"), style_menu); + theme->set_stylebox(SNAME("button_highlight"), SNAME("TabBar"), style_menu); + theme->set_icon(SNAME("increment"), SNAME("TabContainer"), theme->get_icon(SNAME("GuiScrollArrowRight"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("decrement"), SNAME("TabContainer"), theme->get_icon(SNAME("GuiScrollArrowLeft"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("increment"), SNAME("TabBar"), theme->get_icon(SNAME("GuiScrollArrowRight"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("decrement"), SNAME("TabBar"), theme->get_icon(SNAME("GuiScrollArrowLeft"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("increment_highlight"), SNAME("TabBar"), theme->get_icon(SNAME("GuiScrollArrowRightHl"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("decrement_highlight"), SNAME("TabBar"), theme->get_icon(SNAME("GuiScrollArrowLeftHl"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("increment_highlight"), SNAME("TabContainer"), theme->get_icon(SNAME("GuiScrollArrowRightHl"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("decrement_highlight"), SNAME("TabContainer"), theme->get_icon(SNAME("GuiScrollArrowLeftHl"), SNAME("EditorIcons"))); + theme->set_constant(SNAME("hseparation"), SNAME("TabBar"), 4 * EDSCALE); // Content of each tab Ref style_content_panel = style_default->duplicate(); @@ -1041,16 +1041,16 @@ Ref create_editor_theme(const Ref p_theme) { // Display border to visually split the body of the container from its possible backgrounds. style_content_panel->set_border_width(Side::SIDE_TOP, Math::round(2 * EDSCALE)); style_content_panel->set_border_color(dark_color_2); - theme->set_stylebox("panel", "TabContainer", style_content_panel); + theme->set_stylebox(SNAME("panel"), SNAME("TabContainer"), style_content_panel); // These styleboxes can be used on tabs against the base color background (e.g. nested tabs). Ref style_tab_selected_odd = style_tab_selected->duplicate(); style_tab_selected_odd->set_bg_color(disabled_bg_color); - theme->set_stylebox("tab_selected_odd", "TabContainer", style_tab_selected_odd); + theme->set_stylebox(SNAME("tab_selected_odd"), SNAME("TabContainer"), style_tab_selected_odd); Ref style_content_panel_odd = style_content_panel->duplicate(); style_content_panel_odd->set_bg_color(disabled_bg_color); - theme->set_stylebox("panel_odd", "TabContainer", style_content_panel_odd); + theme->set_stylebox(SNAME("panel_odd"), SNAME("TabContainer"), style_content_panel_odd); // This stylebox is used in 3d and 2d viewports (no borders). Ref style_content_panel_vp = style_content_panel->duplicate(); @@ -1058,31 +1058,31 @@ Ref create_editor_theme(const Ref p_theme) { style_content_panel_vp->set_default_margin(SIDE_TOP, default_margin_size * EDSCALE); style_content_panel_vp->set_default_margin(SIDE_RIGHT, border_width * 2); style_content_panel_vp->set_default_margin(SIDE_BOTTOM, border_width * 2); - theme->set_stylebox("Content", "EditorStyles", style_content_panel_vp); + theme->set_stylebox(SNAME("Content"), SNAME("EditorStyles"), style_content_panel_vp); // This stylebox is used by preview tabs in the Theme Editor. Ref style_theme_preview_tab = style_tab_selected_odd->duplicate(); style_theme_preview_tab->set_expand_margin_size(SIDE_BOTTOM, 5 * EDSCALE); - theme->set_stylebox("ThemeEditorPreviewFG", "EditorStyles", style_theme_preview_tab); + theme->set_stylebox(SNAME("ThemeEditorPreviewFG"), SNAME("EditorStyles"), style_theme_preview_tab); Ref style_theme_preview_bg_tab = style_tab_unselected->duplicate(); style_theme_preview_bg_tab->set_expand_margin_size(SIDE_BOTTOM, 2 * EDSCALE); - theme->set_stylebox("ThemeEditorPreviewBG", "EditorStyles", style_theme_preview_bg_tab); + theme->set_stylebox(SNAME("ThemeEditorPreviewBG"), SNAME("EditorStyles"), style_theme_preview_bg_tab); // Separators - theme->set_stylebox("separator", "HSeparator", make_line_stylebox(separator_color, MAX(Math::round(EDSCALE), border_width))); - theme->set_stylebox("separator", "VSeparator", make_line_stylebox(separator_color, MAX(Math::round(EDSCALE), border_width), 0, 0, true)); + theme->set_stylebox(SNAME("separator"), SNAME("HSeparator"), make_line_stylebox(separator_color, MAX(Math::round(EDSCALE), border_width))); + theme->set_stylebox(SNAME("separator"), SNAME("VSeparator"), make_line_stylebox(separator_color, MAX(Math::round(EDSCALE), border_width), 0, 0, true)); // Debugger Ref style_panel_debugger = style_content_panel->duplicate(); style_panel_debugger->set_border_width(SIDE_BOTTOM, 0); - theme->set_stylebox("DebuggerPanel", "EditorStyles", style_panel_debugger); + theme->set_stylebox(SNAME("DebuggerPanel"), SNAME("EditorStyles"), style_panel_debugger); Ref style_panel_invisible_top = style_content_panel->duplicate(); int stylebox_offset = theme->get_font(SNAME("tab_selected"), SNAME("TabContainer"))->get_height(theme->get_font_size(SNAME("tab_selected"), SNAME("TabContainer"))) + theme->get_stylebox(SNAME("tab_selected"), SNAME("TabContainer"))->get_minimum_size().height + theme->get_stylebox(SNAME("panel"), SNAME("TabContainer"))->get_default_margin(SIDE_TOP); style_panel_invisible_top->set_expand_margin_size(SIDE_TOP, -stylebox_offset); style_panel_invisible_top->set_default_margin(SIDE_TOP, 0); - theme->set_stylebox("BottomPanelDebuggerOverride", "EditorStyles", style_panel_invisible_top); + theme->set_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles"), style_panel_invisible_top); // LineEdit @@ -1102,74 +1102,74 @@ Ref create_editor_theme(const Ref p_theme) { style_line_edit_disabled->set_border_color(disabled_color); style_line_edit_disabled->set_bg_color(disabled_bg_color); - theme->set_stylebox("normal", "LineEdit", style_line_edit); - theme->set_stylebox("focus", "LineEdit", style_widget_focus); - theme->set_stylebox("read_only", "LineEdit", style_line_edit_disabled); - theme->set_icon("clear", "LineEdit", theme->get_icon(SNAME("GuiClose"), SNAME("EditorIcons"))); - theme->set_color("read_only", "LineEdit", font_disabled_color); - theme->set_color("font_color", "LineEdit", font_color); - theme->set_color("font_selected_color", "LineEdit", mono_color); - theme->set_color("font_uneditable_color", "LineEdit", font_readonly_color); - theme->set_color("font_placeholder_color", "LineEdit", font_placeholder_color); - theme->set_color("caret_color", "LineEdit", font_color); - theme->set_color("selection_color", "LineEdit", selection_color); - theme->set_color("clear_button_color", "LineEdit", font_color); - theme->set_color("clear_button_color_pressed", "LineEdit", accent_color); + theme->set_stylebox(SNAME("normal"), SNAME("LineEdit"), style_line_edit); + theme->set_stylebox(SNAME("focus"), SNAME("LineEdit"), style_widget_focus); + theme->set_stylebox(SNAME("read_only"), SNAME("LineEdit"), style_line_edit_disabled); + theme->set_icon(SNAME("clear"), SNAME("LineEdit"), theme->get_icon(SNAME("GuiClose"), SNAME("EditorIcons"))); + theme->set_color(SNAME("read_only"), SNAME("LineEdit"), font_disabled_color); + theme->set_color(SNAME("font_color"), SNAME("LineEdit"), font_color); + theme->set_color(SNAME("font_selected_color"), SNAME("LineEdit"), mono_color); + theme->set_color(SNAME("font_uneditable_color"), SNAME("LineEdit"), font_readonly_color); + theme->set_color(SNAME("font_placeholder_color"), SNAME("LineEdit"), font_placeholder_color); + theme->set_color(SNAME("caret_color"), SNAME("LineEdit"), font_color); + theme->set_color(SNAME("selection_color"), SNAME("LineEdit"), selection_color); + theme->set_color(SNAME("clear_button_color"), SNAME("LineEdit"), font_color); + theme->set_color(SNAME("clear_button_color_pressed"), SNAME("LineEdit"), accent_color); // TextEdit - theme->set_stylebox("normal", "TextEdit", style_line_edit); - theme->set_stylebox("focus", "TextEdit", style_widget_focus); - theme->set_stylebox("read_only", "TextEdit", style_line_edit_disabled); - theme->set_constant("side_margin", "TabContainer", 0); - theme->set_icon("tab", "TextEdit", theme->get_icon(SNAME("GuiTab"), SNAME("EditorIcons"))); - theme->set_icon("space", "TextEdit", theme->get_icon(SNAME("GuiSpace"), SNAME("EditorIcons"))); - theme->set_color("font_color", "TextEdit", font_color); - theme->set_color("font_readonly_color", "TextEdit", font_readonly_color); - theme->set_color("font_placeholder_color", "TextEdit", font_placeholder_color); - theme->set_color("caret_color", "TextEdit", font_color); - theme->set_color("selection_color", "TextEdit", selection_color); - theme->set_constant("line_spacing", "TextEdit", 4 * EDSCALE); + theme->set_stylebox(SNAME("normal"), SNAME("TextEdit"), style_line_edit); + theme->set_stylebox(SNAME("focus"), SNAME("TextEdit"), style_widget_focus); + theme->set_stylebox(SNAME("read_only"), SNAME("TextEdit"), style_line_edit_disabled); + theme->set_constant(SNAME("side_margin"), SNAME("TabContainer"), 0); + theme->set_icon(SNAME("tab"), SNAME("TextEdit"), theme->get_icon(SNAME("GuiTab"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("space"), SNAME("TextEdit"), theme->get_icon(SNAME("GuiSpace"), SNAME("EditorIcons"))); + theme->set_color(SNAME("font_color"), SNAME("TextEdit"), font_color); + theme->set_color(SNAME("font_readonly_color"), SNAME("TextEdit"), font_readonly_color); + theme->set_color(SNAME("font_placeholder_color"), SNAME("TextEdit"), font_placeholder_color); + theme->set_color(SNAME("caret_color"), SNAME("TextEdit"), font_color); + theme->set_color(SNAME("selection_color"), SNAME("TextEdit"), selection_color); + theme->set_constant(SNAME("line_spacing"), SNAME("TextEdit"), 4 * EDSCALE); // CodeEdit - theme->set_font("font", "CodeEdit", theme->get_font(SNAME("source"), SNAME("EditorFonts"))); - theme->set_font_size("font_size", "CodeEdit", theme->get_font_size(SNAME("source_size"), SNAME("EditorFonts"))); - theme->set_stylebox("normal", "CodeEdit", style_widget); - theme->set_stylebox("focus", "CodeEdit", style_widget_hover); - theme->set_stylebox("read_only", "CodeEdit", style_widget_disabled); - theme->set_icon("tab", "CodeEdit", theme->get_icon(SNAME("GuiTab"), SNAME("EditorIcons"))); - theme->set_icon("space", "CodeEdit", theme->get_icon(SNAME("GuiSpace"), SNAME("EditorIcons"))); - theme->set_icon("folded", "CodeEdit", theme->get_icon(SNAME("GuiTreeArrowRight"), SNAME("EditorIcons"))); - theme->set_icon("can_fold", "CodeEdit", theme->get_icon(SNAME("GuiTreeArrowDown"), SNAME("EditorIcons"))); - theme->set_icon("executing_line", "CodeEdit", theme->get_icon(SNAME("MainPlay"), SNAME("EditorIcons"))); - theme->set_icon("breakpoint", "CodeEdit", theme->get_icon(SNAME("Breakpoint"), SNAME("EditorIcons"))); - theme->set_constant("line_spacing", "CodeEdit", EDITOR_DEF("text_editor/appearance/whitespace/line_spacing", 6)); + theme->set_font(SNAME("font"), SNAME("CodeEdit"), theme->get_font(SNAME("source"), SNAME("EditorFonts"))); + theme->set_font_size(SNAME("font_size"), SNAME("CodeEdit"), theme->get_font_size(SNAME("source_size"), SNAME("EditorFonts"))); + theme->set_stylebox(SNAME("normal"), SNAME("CodeEdit"), style_widget); + theme->set_stylebox(SNAME("focus"), SNAME("CodeEdit"), style_widget_hover); + theme->set_stylebox(SNAME("read_only"), SNAME("CodeEdit"), style_widget_disabled); + theme->set_icon(SNAME("tab"), SNAME("CodeEdit"), theme->get_icon(SNAME("GuiTab"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("space"), SNAME("CodeEdit"), theme->get_icon(SNAME("GuiSpace"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("folded"), SNAME("CodeEdit"), theme->get_icon(SNAME("GuiTreeArrowRight"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("can_fold"), SNAME("CodeEdit"), theme->get_icon(SNAME("GuiTreeArrowDown"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("executing_line"), SNAME("CodeEdit"), theme->get_icon(SNAME("MainPlay"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("breakpoint"), SNAME("CodeEdit"), theme->get_icon(SNAME("Breakpoint"), SNAME("EditorIcons"))); + theme->set_constant(SNAME("line_spacing"), SNAME("CodeEdit"), EDITOR_DEF("text_editor/appearance/whitespace/line_spacing", 6)); // H/VSplitContainer - theme->set_stylebox("bg", "VSplitContainer", make_stylebox(theme->get_icon(SNAME("GuiVsplitBg"), SNAME("EditorIcons")), 1, 1, 1, 1)); - theme->set_stylebox("bg", "HSplitContainer", make_stylebox(theme->get_icon(SNAME("GuiHsplitBg"), SNAME("EditorIcons")), 1, 1, 1, 1)); + theme->set_stylebox(SNAME("bg"), SNAME("VSplitContainer"), make_stylebox(theme->get_icon(SNAME("GuiVsplitBg"), SNAME("EditorIcons")), 1, 1, 1, 1)); + theme->set_stylebox(SNAME("bg"), SNAME("HSplitContainer"), make_stylebox(theme->get_icon(SNAME("GuiHsplitBg"), SNAME("EditorIcons")), 1, 1, 1, 1)); - theme->set_icon("grabber", "VSplitContainer", theme->get_icon(SNAME("GuiVsplitter"), SNAME("EditorIcons"))); - theme->set_icon("grabber", "HSplitContainer", theme->get_icon(SNAME("GuiHsplitter"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("grabber"), SNAME("VSplitContainer"), theme->get_icon(SNAME("GuiVsplitter"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("grabber"), SNAME("HSplitContainer"), theme->get_icon(SNAME("GuiHsplitter"), SNAME("EditorIcons"))); - theme->set_constant("separation", "HSplitContainer", default_margin_size * 2 * EDSCALE); - theme->set_constant("separation", "VSplitContainer", default_margin_size * 2 * EDSCALE); + theme->set_constant(SNAME("separation"), SNAME("HSplitContainer"), default_margin_size * 2 * EDSCALE); + theme->set_constant(SNAME("separation"), SNAME("VSplitContainer"), default_margin_size * 2 * EDSCALE); // Containers - theme->set_constant("separation", "BoxContainer", default_margin_size * EDSCALE); - theme->set_constant("separation", "HBoxContainer", default_margin_size * EDSCALE); - theme->set_constant("separation", "VBoxContainer", default_margin_size * EDSCALE); - theme->set_constant("margin_left", "MarginContainer", 0); - theme->set_constant("margin_top", "MarginContainer", 0); - theme->set_constant("margin_right", "MarginContainer", 0); - theme->set_constant("margin_bottom", "MarginContainer", 0); - theme->set_constant("hseparation", "GridContainer", default_margin_size * EDSCALE); - theme->set_constant("vseparation", "GridContainer", default_margin_size * EDSCALE); - theme->set_constant("hseparation", "FlowContainer", default_margin_size * EDSCALE); - theme->set_constant("vseparation", "FlowContainer", default_margin_size * EDSCALE); - theme->set_constant("hseparation", "HFlowContainer", default_margin_size * EDSCALE); - theme->set_constant("vseparation", "HFlowContainer", default_margin_size * EDSCALE); - theme->set_constant("hseparation", "VFlowContainer", default_margin_size * EDSCALE); - theme->set_constant("vseparation", "VFlowContainer", default_margin_size * EDSCALE); + theme->set_constant(SNAME("separation"), SNAME("BoxContainer"), default_margin_size * EDSCALE); + theme->set_constant(SNAME("separation"), SNAME("HBoxContainer"), default_margin_size * EDSCALE); + theme->set_constant(SNAME("separation"), SNAME("VBoxContainer"), default_margin_size * EDSCALE); + theme->set_constant(SNAME("margin_left"), SNAME("MarginContainer"), 0); + theme->set_constant(SNAME("margin_top"), SNAME("MarginContainer"), 0); + theme->set_constant(SNAME("margin_right"), SNAME("MarginContainer"), 0); + theme->set_constant(SNAME("margin_bottom"), SNAME("MarginContainer"), 0); + theme->set_constant(SNAME("hseparation"), SNAME("GridContainer"), default_margin_size * EDSCALE); + theme->set_constant(SNAME("vseparation"), SNAME("GridContainer"), default_margin_size * EDSCALE); + theme->set_constant(SNAME("hseparation"), SNAME("FlowContainer"), default_margin_size * EDSCALE); + theme->set_constant(SNAME("vseparation"), SNAME("FlowContainer"), default_margin_size * EDSCALE); + theme->set_constant(SNAME("hseparation"), SNAME("HFlowContainer"), default_margin_size * EDSCALE); + theme->set_constant(SNAME("vseparation"), SNAME("HFlowContainer"), default_margin_size * EDSCALE); + theme->set_constant(SNAME("hseparation"), SNAME("VFlowContainer"), default_margin_size * EDSCALE); + theme->set_constant(SNAME("vseparation"), SNAME("VFlowContainer"), default_margin_size * EDSCALE); // Window @@ -1184,119 +1184,119 @@ Ref create_editor_theme(const Ref p_theme) { style_window->set_border_color(base_color); style_window->set_border_width(SIDE_TOP, 24 * EDSCALE); style_window->set_expand_margin_size(SIDE_TOP, 24 * EDSCALE); - theme->set_stylebox("embedded_border", "Window", style_window); - - theme->set_color("title_color", "Window", font_color); - theme->set_icon("close", "Window", theme->get_icon(SNAME("GuiClose"), SNAME("EditorIcons"))); - theme->set_icon("close_pressed", "Window", theme->get_icon(SNAME("GuiClose"), SNAME("EditorIcons"))); - theme->set_constant("close_h_ofs", "Window", 22 * EDSCALE); - theme->set_constant("close_v_ofs", "Window", 20 * EDSCALE); - theme->set_constant("title_height", "Window", 24 * EDSCALE); - theme->set_constant("resize_margin", "Window", 4 * EDSCALE); - theme->set_font("title_font", "Window", theme->get_font(SNAME("title"), SNAME("EditorFonts"))); - theme->set_font_size("title_font_size", "Window", theme->get_font_size(SNAME("title_size"), SNAME("EditorFonts"))); + theme->set_stylebox(SNAME("embedded_border"), SNAME("Window"), style_window); + + theme->set_color(SNAME("title_color"), SNAME("Window"), font_color); + theme->set_icon(SNAME("close"), SNAME("Window"), theme->get_icon(SNAME("GuiClose"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("close_pressed"), SNAME("Window"), theme->get_icon(SNAME("GuiClose"), SNAME("EditorIcons"))); + theme->set_constant(SNAME("close_h_ofs"), SNAME("Window"), 22 * EDSCALE); + theme->set_constant(SNAME("close_v_ofs"), SNAME("Window"), 20 * EDSCALE); + theme->set_constant(SNAME("title_height"), SNAME("Window"), 24 * EDSCALE); + theme->set_constant(SNAME("resize_margin"), SNAME("Window"), 4 * EDSCALE); + theme->set_font(SNAME("title_font"), SNAME("Window"), theme->get_font(SNAME("title"), SNAME("EditorFonts"))); + theme->set_font_size(SNAME("title_font_size"), SNAME("Window"), theme->get_font_size(SNAME("title_size"), SNAME("EditorFonts"))); // Complex window (currently only Editor Settings and Project Settings) Ref style_complex_window = style_window->duplicate(); style_complex_window->set_bg_color(dark_color_2); style_complex_window->set_border_color(dark_color_2); - theme->set_stylebox("panel", "EditorSettingsDialog", style_complex_window); - theme->set_stylebox("panel", "ProjectSettingsEditor", style_complex_window); - theme->set_stylebox("panel", "EditorAbout", style_complex_window); + theme->set_stylebox(SNAME("panel"), SNAME("EditorSettingsDialog"), style_complex_window); + theme->set_stylebox(SNAME("panel"), SNAME("ProjectSettingsEditor"), style_complex_window); + theme->set_stylebox(SNAME("panel"), SNAME("EditorAbout"), style_complex_window); // AcceptDialog - theme->set_stylebox("panel", "AcceptDialog", style_window_title); + theme->set_stylebox(SNAME("panel"), SNAME("AcceptDialog"), style_window_title); // HScrollBar Ref empty_icon = memnew(ImageTexture); - theme->set_stylebox("scroll", "HScrollBar", make_stylebox(theme->get_icon(SNAME("GuiScrollBg"), SNAME("EditorIcons")), 5, 5, 5, 5, 0, 0, 0, 0)); - theme->set_stylebox("scroll_focus", "HScrollBar", make_stylebox(theme->get_icon(SNAME("GuiScrollBg"), SNAME("EditorIcons")), 5, 5, 5, 5, 0, 0, 0, 0)); - theme->set_stylebox("grabber", "HScrollBar", make_stylebox(theme->get_icon(SNAME("GuiScrollGrabber"), SNAME("EditorIcons")), 6, 6, 6, 6, 2, 2, 2, 2)); - theme->set_stylebox("grabber_highlight", "HScrollBar", make_stylebox(theme->get_icon(SNAME("GuiScrollGrabberHl"), SNAME("EditorIcons")), 5, 5, 5, 5, 2, 2, 2, 2)); - theme->set_stylebox("grabber_pressed", "HScrollBar", make_stylebox(theme->get_icon(SNAME("GuiScrollGrabberPressed"), SNAME("EditorIcons")), 6, 6, 6, 6, 2, 2, 2, 2)); + theme->set_stylebox(SNAME("scroll"), SNAME("HScrollBar"), make_stylebox(theme->get_icon(SNAME("GuiScrollBg"), SNAME("EditorIcons")), 5, 5, 5, 5, 0, 0, 0, 0)); + theme->set_stylebox(SNAME("scroll_focus"), SNAME("HScrollBar"), make_stylebox(theme->get_icon(SNAME("GuiScrollBg"), SNAME("EditorIcons")), 5, 5, 5, 5, 0, 0, 0, 0)); + theme->set_stylebox(SNAME("grabber"), SNAME("HScrollBar"), make_stylebox(theme->get_icon(SNAME("GuiScrollGrabber"), SNAME("EditorIcons")), 6, 6, 6, 6, 2, 2, 2, 2)); + theme->set_stylebox(SNAME("grabber_highlight"), SNAME("HScrollBar"), make_stylebox(theme->get_icon(SNAME("GuiScrollGrabberHl"), SNAME("EditorIcons")), 5, 5, 5, 5, 2, 2, 2, 2)); + theme->set_stylebox(SNAME("grabber_pressed"), SNAME("HScrollBar"), make_stylebox(theme->get_icon(SNAME("GuiScrollGrabberPressed"), SNAME("EditorIcons")), 6, 6, 6, 6, 2, 2, 2, 2)); - theme->set_icon("increment", "HScrollBar", empty_icon); - theme->set_icon("increment_highlight", "HScrollBar", empty_icon); - theme->set_icon("increment_pressed", "HScrollBar", empty_icon); - theme->set_icon("decrement", "HScrollBar", empty_icon); - theme->set_icon("decrement_highlight", "HScrollBar", empty_icon); - theme->set_icon("decrement_pressed", "HScrollBar", empty_icon); + theme->set_icon(SNAME("increment"), SNAME("HScrollBar"), empty_icon); + theme->set_icon(SNAME("increment_highlight"), SNAME("HScrollBar"), empty_icon); + theme->set_icon(SNAME("increment_pressed"), SNAME("HScrollBar"), empty_icon); + theme->set_icon(SNAME("decrement"), SNAME("HScrollBar"), empty_icon); + theme->set_icon(SNAME("decrement_highlight"), SNAME("HScrollBar"), empty_icon); + theme->set_icon(SNAME("decrement_pressed"), SNAME("HScrollBar"), empty_icon); // VScrollBar - theme->set_stylebox("scroll", "VScrollBar", make_stylebox(theme->get_icon(SNAME("GuiScrollBg"), SNAME("EditorIcons")), 5, 5, 5, 5, 0, 0, 0, 0)); - theme->set_stylebox("scroll_focus", "VScrollBar", make_stylebox(theme->get_icon(SNAME("GuiScrollBg"), SNAME("EditorIcons")), 5, 5, 5, 5, 0, 0, 0, 0)); - theme->set_stylebox("grabber", "VScrollBar", make_stylebox(theme->get_icon(SNAME("GuiScrollGrabber"), SNAME("EditorIcons")), 6, 6, 6, 6, 2, 2, 2, 2)); - theme->set_stylebox("grabber_highlight", "VScrollBar", make_stylebox(theme->get_icon(SNAME("GuiScrollGrabberHl"), SNAME("EditorIcons")), 5, 5, 5, 5, 2, 2, 2, 2)); - theme->set_stylebox("grabber_pressed", "VScrollBar", make_stylebox(theme->get_icon(SNAME("GuiScrollGrabberPressed"), SNAME("EditorIcons")), 6, 6, 6, 6, 2, 2, 2, 2)); - - theme->set_icon("increment", "VScrollBar", empty_icon); - theme->set_icon("increment_highlight", "VScrollBar", empty_icon); - theme->set_icon("increment_pressed", "VScrollBar", empty_icon); - theme->set_icon("decrement", "VScrollBar", empty_icon); - theme->set_icon("decrement_highlight", "VScrollBar", empty_icon); - theme->set_icon("decrement_pressed", "VScrollBar", empty_icon); + theme->set_stylebox(SNAME("scroll"), SNAME("VScrollBar"), make_stylebox(theme->get_icon(SNAME("GuiScrollBg"), SNAME("EditorIcons")), 5, 5, 5, 5, 0, 0, 0, 0)); + theme->set_stylebox(SNAME("scroll_focus"), SNAME("VScrollBar"), make_stylebox(theme->get_icon(SNAME("GuiScrollBg"), SNAME("EditorIcons")), 5, 5, 5, 5, 0, 0, 0, 0)); + theme->set_stylebox(SNAME("grabber"), SNAME("VScrollBar"), make_stylebox(theme->get_icon(SNAME("GuiScrollGrabber"), SNAME("EditorIcons")), 6, 6, 6, 6, 2, 2, 2, 2)); + theme->set_stylebox(SNAME("grabber_highlight"), SNAME("VScrollBar"), make_stylebox(theme->get_icon(SNAME("GuiScrollGrabberHl"), SNAME("EditorIcons")), 5, 5, 5, 5, 2, 2, 2, 2)); + theme->set_stylebox(SNAME("grabber_pressed"), SNAME("VScrollBar"), make_stylebox(theme->get_icon(SNAME("GuiScrollGrabberPressed"), SNAME("EditorIcons")), 6, 6, 6, 6, 2, 2, 2, 2)); + + theme->set_icon(SNAME("increment"), SNAME("VScrollBar"), empty_icon); + theme->set_icon(SNAME("increment_highlight"), SNAME("VScrollBar"), empty_icon); + theme->set_icon(SNAME("increment_pressed"), SNAME("VScrollBar"), empty_icon); + theme->set_icon(SNAME("decrement"), SNAME("VScrollBar"), empty_icon); + theme->set_icon(SNAME("decrement_highlight"), SNAME("VScrollBar"), empty_icon); + theme->set_icon(SNAME("decrement_pressed"), SNAME("VScrollBar"), empty_icon); // HSlider - theme->set_icon("grabber_highlight", "HSlider", theme->get_icon(SNAME("GuiSliderGrabberHl"), SNAME("EditorIcons"))); - theme->set_icon("grabber", "HSlider", theme->get_icon(SNAME("GuiSliderGrabber"), SNAME("EditorIcons"))); - theme->set_stylebox("slider", "HSlider", make_flat_stylebox(dark_color_3, 0, default_margin_size / 2, 0, default_margin_size / 2, corner_width)); - theme->set_stylebox("grabber_area", "HSlider", make_flat_stylebox(contrast_color_1, 0, default_margin_size / 2, 0, default_margin_size / 2, corner_width)); - theme->set_stylebox("grabber_area_highlight", "HSlider", make_flat_stylebox(contrast_color_1, 0, default_margin_size / 2, 0, default_margin_size / 2)); + theme->set_icon(SNAME("grabber_highlight"), SNAME("HSlider"), theme->get_icon(SNAME("GuiSliderGrabberHl"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("grabber"), SNAME("HSlider"), theme->get_icon(SNAME("GuiSliderGrabber"), SNAME("EditorIcons"))); + theme->set_stylebox(SNAME("slider"), SNAME("HSlider"), make_flat_stylebox(dark_color_3, 0, default_margin_size / 2, 0, default_margin_size / 2, corner_width)); + theme->set_stylebox(SNAME("grabber_area"), SNAME("HSlider"), make_flat_stylebox(contrast_color_1, 0, default_margin_size / 2, 0, default_margin_size / 2, corner_width)); + theme->set_stylebox(SNAME("grabber_area_highlight"), SNAME("HSlider"), make_flat_stylebox(contrast_color_1, 0, default_margin_size / 2, 0, default_margin_size / 2)); // VSlider - theme->set_icon("grabber", "VSlider", theme->get_icon(SNAME("GuiSliderGrabber"), SNAME("EditorIcons"))); - theme->set_icon("grabber_highlight", "VSlider", theme->get_icon(SNAME("GuiSliderGrabberHl"), SNAME("EditorIcons"))); - theme->set_stylebox("slider", "VSlider", make_flat_stylebox(dark_color_3, default_margin_size / 2, 0, default_margin_size / 2, 0, corner_width)); - theme->set_stylebox("grabber_area", "VSlider", make_flat_stylebox(contrast_color_1, default_margin_size / 2, 0, default_margin_size / 2, 0, corner_width)); - theme->set_stylebox("grabber_area_highlight", "VSlider", make_flat_stylebox(contrast_color_1, default_margin_size / 2, 0, default_margin_size / 2, 0)); + theme->set_icon(SNAME("grabber"), SNAME("VSlider"), theme->get_icon(SNAME("GuiSliderGrabber"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("grabber_highlight"), SNAME("VSlider"), theme->get_icon(SNAME("GuiSliderGrabberHl"), SNAME("EditorIcons"))); + theme->set_stylebox(SNAME("slider"), SNAME("VSlider"), make_flat_stylebox(dark_color_3, default_margin_size / 2, 0, default_margin_size / 2, 0, corner_width)); + theme->set_stylebox(SNAME("grabber_area"), SNAME("VSlider"), make_flat_stylebox(contrast_color_1, default_margin_size / 2, 0, default_margin_size / 2, 0, corner_width)); + theme->set_stylebox(SNAME("grabber_area_highlight"), SNAME("VSlider"), make_flat_stylebox(contrast_color_1, default_margin_size / 2, 0, default_margin_size / 2, 0)); // RichTextLabel - theme->set_color("default_color", "RichTextLabel", font_color); - theme->set_color("font_shadow_color", "RichTextLabel", Color(0, 0, 0, 0)); - theme->set_constant("shadow_offset_x", "RichTextLabel", 1 * EDSCALE); - theme->set_constant("shadow_offset_y", "RichTextLabel", 1 * EDSCALE); - theme->set_constant("shadow_outline_size", "RichTextLabel", 1 * EDSCALE); - theme->set_stylebox("focus", "RichTextLabel", make_empty_stylebox()); - theme->set_stylebox("normal", "RichTextLabel", style_tree_bg); + theme->set_color(SNAME("default_color"), SNAME("RichTextLabel"), font_color); + theme->set_color(SNAME("font_shadow_color"), SNAME("RichTextLabel"), Color(0, 0, 0, 0)); + theme->set_constant(SNAME("shadow_offset_x"), SNAME("RichTextLabel"), 1 * EDSCALE); + theme->set_constant(SNAME("shadow_offset_y"), SNAME("RichTextLabel"), 1 * EDSCALE); + theme->set_constant(SNAME("shadow_outline_size"), SNAME("RichTextLabel"), 1 * EDSCALE); + theme->set_stylebox(SNAME("focus"), SNAME("RichTextLabel"), make_empty_stylebox()); + theme->set_stylebox(SNAME("normal"), SNAME("RichTextLabel"), style_tree_bg); // Editor help. - theme->set_color("title_color", "EditorHelp", accent_color); - theme->set_color("headline_color", "EditorHelp", mono_color); - theme->set_color("text_color", "EditorHelp", font_color); - theme->set_color("comment_color", "EditorHelp", font_color * Color(1, 1, 1, 0.6)); - theme->set_color("symbol_color", "EditorHelp", font_color * Color(1, 1, 1, 0.6)); - theme->set_color("value_color", "EditorHelp", font_color * Color(1, 1, 1, 0.6)); - theme->set_color("qualifier_color", "EditorHelp", font_color * Color(1, 1, 1, 0.8)); - theme->set_color("type_color", "EditorHelp", accent_color.lerp(font_color, 0.5)); - theme->set_color("selection_color", "EditorHelp", accent_color * Color(1, 1, 1, 0.4)); - theme->set_color("link_color", "EditorHelp", accent_color.lerp(mono_color, 0.8)); - theme->set_color("code_color", "EditorHelp", accent_color.lerp(mono_color, 0.6)); - theme->set_color("kbd_color", "EditorHelp", accent_color.lerp(property_color, 0.6)); - theme->set_constant("line_separation", "EditorHelp", Math::round(6 * EDSCALE)); - theme->set_constant("table_hseparation", "EditorHelp", 16 * EDSCALE); - theme->set_constant("table_vseparation", "EditorHelp", 6 * EDSCALE); + theme->set_color(SNAME("title_color"), SNAME("EditorHelp"), accent_color); + theme->set_color(SNAME("headline_color"), SNAME("EditorHelp"), mono_color); + theme->set_color(SNAME("text_color"), SNAME("EditorHelp"), font_color); + theme->set_color(SNAME("comment_color"), SNAME("EditorHelp"), font_color * Color(1, 1, 1, 0.6)); + theme->set_color(SNAME("symbol_color"), SNAME("EditorHelp"), font_color * Color(1, 1, 1, 0.6)); + theme->set_color(SNAME("value_color"), SNAME("EditorHelp"), font_color * Color(1, 1, 1, 0.6)); + theme->set_color(SNAME("qualifier_color"), SNAME("EditorHelp"), font_color * Color(1, 1, 1, 0.8)); + theme->set_color(SNAME("type_color"), SNAME("EditorHelp"), accent_color.lerp(font_color, 0.5)); + theme->set_color(SNAME("selection_color"), SNAME("EditorHelp"), accent_color * Color(1, 1, 1, 0.4)); + theme->set_color(SNAME("link_color"), SNAME("EditorHelp"), accent_color.lerp(mono_color, 0.8)); + theme->set_color(SNAME("code_color"), SNAME("EditorHelp"), accent_color.lerp(mono_color, 0.6)); + theme->set_color(SNAME("kbd_color"), SNAME("EditorHelp"), accent_color.lerp(property_color, 0.6)); + theme->set_constant(SNAME("line_separation"), SNAME("EditorHelp"), Math::round(6 * EDSCALE)); + theme->set_constant(SNAME("table_hseparation"), SNAME("EditorHelp"), 16 * EDSCALE); + theme->set_constant(SNAME("table_vseparation"), SNAME("EditorHelp"), 6 * EDSCALE); // Panel - theme->set_stylebox("panel", "Panel", make_flat_stylebox(dark_color_1, 6, 4, 6, 4, corner_width)); - theme->set_stylebox("panel_fg", "Panel", style_default); + theme->set_stylebox(SNAME("panel"), SNAME("Panel"), make_flat_stylebox(dark_color_1, 6, 4, 6, 4, corner_width)); + theme->set_stylebox(SNAME("panel_fg"), SNAME("Panel"), style_default); // Label - theme->set_stylebox("normal", "Label", style_empty); - theme->set_color("font_color", "Label", font_color); - theme->set_color("font_shadow_color", "Label", Color(0, 0, 0, 0)); - theme->set_constant("shadow_offset_x", "Label", 1 * EDSCALE); - theme->set_constant("shadow_offset_y", "Label", 1 * EDSCALE); - theme->set_constant("shadow_outline_size", "Label", 1 * EDSCALE); - theme->set_constant("line_spacing", "Label", 3 * EDSCALE); + theme->set_stylebox(SNAME("normal"), SNAME("Label"), style_empty); + theme->set_color(SNAME("font_color"), SNAME("Label"), font_color); + theme->set_color(SNAME("font_shadow_color"), SNAME("Label"), Color(0, 0, 0, 0)); + theme->set_constant(SNAME("shadow_offset_x"), SNAME("Label"), 1 * EDSCALE); + theme->set_constant(SNAME("shadow_offset_y"), SNAME("Label"), 1 * EDSCALE); + theme->set_constant(SNAME("shadow_outline_size"), SNAME("Label"), 1 * EDSCALE); + theme->set_constant(SNAME("line_spacing"), SNAME("Label"), 3 * EDSCALE); // LinkButton - theme->set_stylebox("focus", "LinkButton", style_empty); - theme->set_color("font_color", "LinkButton", font_color); - theme->set_color("font_hover_color", "LinkButton", font_hover_color); - theme->set_color("font_focus_color", "LinkButton", font_focus_color); - theme->set_color("font_pressed_color", "LinkButton", accent_color); - theme->set_color("font_disabled_color", "LinkButton", font_disabled_color); + theme->set_stylebox(SNAME("focus"), SNAME("LinkButton"), style_empty); + theme->set_color(SNAME("font_color"), SNAME("LinkButton"), font_color); + theme->set_color(SNAME("font_hover_color"), SNAME("LinkButton"), font_hover_color); + theme->set_color(SNAME("font_focus_color"), SNAME("LinkButton"), font_focus_color); + theme->set_color(SNAME("font_pressed_color"), SNAME("LinkButton"), accent_color); + theme->set_color(SNAME("font_disabled_color"), SNAME("LinkButton"), font_disabled_color); // TooltipPanel Ref style_tooltip = style_popup->duplicate(); @@ -1307,48 +1307,48 @@ Ref create_editor_theme(const Ref p_theme) { style_tooltip->set_default_margin(SIDE_BOTTOM, default_margin_size * EDSCALE * 0.5); style_tooltip->set_bg_color(dark_color_3 * Color(0.8, 0.8, 0.8, 0.9)); style_tooltip->set_border_width_all(0); - theme->set_color("font_color", "TooltipLabel", font_hover_color); - theme->set_color("font_color_shadow", "TooltipLabel", Color(0, 0, 0, 0)); - theme->set_stylebox("panel", "TooltipPanel", style_tooltip); + theme->set_color(SNAME("font_color"), SNAME("TooltipLabel"), font_hover_color); + theme->set_color(SNAME("font_color_shadow"), SNAME("TooltipLabel"), Color(0, 0, 0, 0)); + theme->set_stylebox(SNAME("panel"), SNAME("TooltipPanel"), style_tooltip); // PopupPanel - theme->set_stylebox("panel", "PopupPanel", style_popup); + theme->set_stylebox(SNAME("panel"), SNAME("PopupPanel"), style_popup); // SpinBox - theme->set_icon("updown", "SpinBox", theme->get_icon(SNAME("GuiSpinboxUpdown"), SNAME("EditorIcons"))); - theme->set_icon("updown_disabled", "SpinBox", theme->get_icon(SNAME("GuiSpinboxUpdownDisabled"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("updown"), SNAME("SpinBox"), theme->get_icon(SNAME("GuiSpinboxUpdown"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("updown_disabled"), SNAME("SpinBox"), theme->get_icon(SNAME("GuiSpinboxUpdownDisabled"), SNAME("EditorIcons"))); // ProgressBar - theme->set_stylebox("bg", "ProgressBar", make_stylebox(theme->get_icon(SNAME("GuiProgressBar"), SNAME("EditorIcons")), 4, 4, 4, 4, 0, 0, 0, 0)); - theme->set_stylebox("fg", "ProgressBar", make_stylebox(theme->get_icon(SNAME("GuiProgressFill"), SNAME("EditorIcons")), 6, 6, 6, 6, 2, 1, 2, 1)); - theme->set_color("font_color", "ProgressBar", font_color); + theme->set_stylebox(SNAME("bg"), SNAME("ProgressBar"), make_stylebox(theme->get_icon(SNAME("GuiProgressBar"), SNAME("EditorIcons")), 4, 4, 4, 4, 0, 0, 0, 0)); + theme->set_stylebox(SNAME("fg"), SNAME("ProgressBar"), make_stylebox(theme->get_icon(SNAME("GuiProgressFill"), SNAME("EditorIcons")), 6, 6, 6, 6, 2, 1, 2, 1)); + theme->set_color(SNAME("font_color"), SNAME("ProgressBar"), font_color); // GraphEdit - theme->set_stylebox("bg", "GraphEdit", style_tree_bg); + theme->set_stylebox(SNAME("bg"), "GraphEdit", style_tree_bg); if (dark_theme) { - theme->set_color("grid_major", "GraphEdit", Color(1.0, 1.0, 1.0, 0.15)); - theme->set_color("grid_minor", "GraphEdit", Color(1.0, 1.0, 1.0, 0.07)); + theme->set_color(SNAME("grid_major"), SNAME("GraphEdit"), Color(1.0, 1.0, 1.0, 0.15)); + theme->set_color(SNAME("grid_minor"), SNAME("GraphEdit"), Color(1.0, 1.0, 1.0, 0.07)); } else { - theme->set_color("grid_major", "GraphEdit", Color(0.0, 0.0, 0.0, 0.15)); - theme->set_color("grid_minor", "GraphEdit", Color(0.0, 0.0, 0.0, 0.07)); + theme->set_color(SNAME("grid_major"), SNAME("GraphEdit"), Color(0.0, 0.0, 0.0, 0.15)); + theme->set_color(SNAME("grid_minor"), SNAME("GraphEdit"), Color(0.0, 0.0, 0.0, 0.07)); } - theme->set_color("selection_fill", "GraphEdit", theme->get_color(SNAME("box_selection_fill_color"), SNAME("Editor"))); - theme->set_color("selection_stroke", "GraphEdit", theme->get_color(SNAME("box_selection_stroke_color"), SNAME("Editor"))); - theme->set_color("activity", "GraphEdit", accent_color); - theme->set_icon("minus", "GraphEdit", theme->get_icon(SNAME("ZoomLess"), SNAME("EditorIcons"))); - theme->set_icon("more", "GraphEdit", theme->get_icon(SNAME("ZoomMore"), SNAME("EditorIcons"))); - theme->set_icon("reset", "GraphEdit", theme->get_icon(SNAME("ZoomReset"), SNAME("EditorIcons"))); - theme->set_icon("snap", "GraphEdit", theme->get_icon(SNAME("SnapGrid"), SNAME("EditorIcons"))); - theme->set_icon("minimap", "GraphEdit", theme->get_icon(SNAME("GridMinimap"), SNAME("EditorIcons"))); - theme->set_icon("layout", "GraphEdit", theme->get_icon(SNAME("GridLayout"), SNAME("EditorIcons"))); - theme->set_constant("bezier_len_pos", "GraphEdit", 80 * EDSCALE); - theme->set_constant("bezier_len_neg", "GraphEdit", 160 * EDSCALE); + theme->set_color(SNAME("selection_fill"), SNAME("GraphEdit"), theme->get_color(SNAME("box_selection_fill_color"), SNAME("Editor"))); + theme->set_color(SNAME("selection_stroke"), SNAME("GraphEdit"), theme->get_color(SNAME("box_selection_stroke_color"), SNAME("Editor"))); + theme->set_color(SNAME("activity"), SNAME("GraphEdit"), accent_color); + theme->set_icon(SNAME("minus"), SNAME("GraphEdit"), theme->get_icon(SNAME("ZoomLess"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("more"), SNAME("GraphEdit"), theme->get_icon(SNAME("ZoomMore"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("reset"), SNAME("GraphEdit"), theme->get_icon(SNAME("ZoomReset"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("snap"), SNAME("GraphEdit"), theme->get_icon(SNAME("SnapGrid"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("minimap"), SNAME("GraphEdit"), theme->get_icon(SNAME("GridMinimap"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("layout"), SNAME("GraphEdit"), theme->get_icon(SNAME("GridLayout"), SNAME("EditorIcons"))); + theme->set_constant(SNAME("bezier_len_pos"), SNAME("GraphEdit"), 80 * EDSCALE); + theme->set_constant(SNAME("bezier_len_neg"), SNAME("GraphEdit"), 160 * EDSCALE); // GraphEditMinimap Ref style_minimap_bg = make_flat_stylebox(dark_color_1, 0, 0, 0, 0); style_minimap_bg->set_border_color(dark_color_3); style_minimap_bg->set_border_width_all(1); - theme->set_stylebox("bg", "GraphEditMinimap", style_minimap_bg); + theme->set_stylebox(SNAME("bg"), SNAME("GraphEditMinimap"), style_minimap_bg); Ref style_minimap_camera; Ref style_minimap_node; @@ -1363,8 +1363,8 @@ Ref create_editor_theme(const Ref p_theme) { } style_minimap_camera->set_border_width_all(1); style_minimap_node->set_corner_radius_all(1); - theme->set_stylebox("camera", "GraphEditMinimap", style_minimap_camera); - theme->set_stylebox("node", "GraphEditMinimap", style_minimap_node); + theme->set_stylebox(SNAME("camera"), SNAME("GraphEditMinimap"), style_minimap_camera); + theme->set_stylebox(SNAME("node"), SNAME("GraphEditMinimap"), style_minimap_node); Ref minimap_resizer_icon = theme->get_icon(SNAME("GuiResizer"), SNAME("EditorIcons")); Color minimap_resizer_color; @@ -1373,8 +1373,8 @@ Ref create_editor_theme(const Ref p_theme) { } else { minimap_resizer_color = Color(0, 0, 0, 0.65); } - theme->set_icon("resizer", "GraphEditMinimap", flip_icon(minimap_resizer_icon, true, true)); - theme->set_color("resizer_color", "GraphEditMinimap", minimap_resizer_color); + theme->set_icon(SNAME("resizer"), SNAME("GraphEditMinimap"), flip_icon(minimap_resizer_icon, true, true)); + theme->set_color(SNAME("resizer_color"), SNAME("GraphEditMinimap"), minimap_resizer_color); // GraphNode const int gn_margin_side = 28; @@ -1413,93 +1413,93 @@ Ref create_editor_theme(const Ref p_theme) { graphsbcomment->set_border_width(SIDE_TOP, 24 * EDSCALE); graphsbcommentselected->set_border_width(SIDE_TOP, 24 * EDSCALE); - theme->set_stylebox("frame", "GraphNode", graphsb); - theme->set_stylebox("selectedframe", "GraphNode", graphsbselected); - theme->set_stylebox("comment", "GraphNode", graphsbcomment); - theme->set_stylebox("commentfocus", "GraphNode", graphsbcommentselected); - theme->set_stylebox("breakpoint", "GraphNode", graphsbbreakpoint); - theme->set_stylebox("position", "GraphNode", graphsbposition); - theme->set_stylebox("state_machine_frame", "GraphNode", smgraphsb); - theme->set_stylebox("state_machine_selectedframe", "GraphNode", smgraphsbselected); + theme->set_stylebox(SNAME("frame"), SNAME("GraphNode"), graphsb); + theme->set_stylebox(SNAME("selectedframe"), SNAME("GraphNode"), graphsbselected); + theme->set_stylebox(SNAME("comment"), SNAME("GraphNode"), graphsbcomment); + theme->set_stylebox(SNAME("commentfocus"), SNAME("GraphNode"), graphsbcommentselected); + theme->set_stylebox(SNAME("breakpoint"), SNAME("GraphNode"), graphsbbreakpoint); + theme->set_stylebox(SNAME("position"), SNAME("GraphNode"), graphsbposition); + theme->set_stylebox(SNAME("state_machine_frame"), SNAME("GraphNode"), smgraphsb); + theme->set_stylebox(SNAME("state_machine_selectedframe"), SNAME("GraphNode"), smgraphsbselected); Color default_node_color = dark_color_1.inverted(); - theme->set_color("title_color", "GraphNode", default_node_color); + theme->set_color(SNAME("title_color"), SNAME("GraphNode"), default_node_color); default_node_color.a = 0.7; - theme->set_color("close_color", "GraphNode", default_node_color); - theme->set_color("resizer_color", "GraphNode", default_node_color); + theme->set_color(SNAME("close_color"), SNAME("GraphNode"), default_node_color); + theme->set_color(SNAME("resizer_color"), SNAME("GraphNode"), default_node_color); - theme->set_constant("port_offset", "GraphNode", 14 * EDSCALE); - theme->set_constant("title_h_offset", "GraphNode", -16 * EDSCALE); - theme->set_constant("title_offset", "GraphNode", 20 * EDSCALE); - theme->set_constant("close_h_offset", "GraphNode", 20 * EDSCALE); - theme->set_constant("close_offset", "GraphNode", 20 * EDSCALE); - theme->set_constant("separation", "GraphNode", 1 * EDSCALE); + theme->set_constant(SNAME("port_offset"), SNAME("GraphNode"), 14 * EDSCALE); + theme->set_constant(SNAME("title_h_offset"), SNAME("GraphNode"), -16 * EDSCALE); + theme->set_constant(SNAME("title_offset"), SNAME("GraphNode"), 20 * EDSCALE); + theme->set_constant(SNAME("close_h_offset"), SNAME("GraphNode"), 20 * EDSCALE); + theme->set_constant(SNAME("close_offset"), SNAME("GraphNode"), 20 * EDSCALE); + theme->set_constant(SNAME("separation"), SNAME("GraphNode"), 1 * EDSCALE); - theme->set_icon("close", "GraphNode", theme->get_icon(SNAME("GuiCloseCustomizable"), SNAME("EditorIcons"))); - theme->set_icon("resizer", "GraphNode", theme->get_icon(SNAME("GuiResizer"), SNAME("EditorIcons"))); - theme->set_icon("port", "GraphNode", theme->get_icon(SNAME("GuiGraphNodePort"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("close"), SNAME("GraphNode"), theme->get_icon(SNAME("GuiCloseCustomizable"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("resizer"), SNAME("GraphNode"), theme->get_icon(SNAME("GuiResizer"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("port"), SNAME("GraphNode"), theme->get_icon(SNAME("GuiGraphNodePort"), SNAME("EditorIcons"))); // GridContainer - theme->set_constant("vseparation", "GridContainer", Math::round(widget_default_margin.y - 2 * EDSCALE)); + theme->set_constant(SNAME("vseparation"), SNAME("GridContainer"), Math::round(widget_default_margin.y - 2 * EDSCALE)); // FileDialog - theme->set_icon("folder", "FileDialog", theme->get_icon(SNAME("Folder"), SNAME("EditorIcons"))); - theme->set_icon("parent_folder", "FileDialog", theme->get_icon(SNAME("ArrowUp"), SNAME("EditorIcons"))); - theme->set_icon("back_folder", "FileDialog", theme->get_icon(SNAME("Back"), SNAME("EditorIcons"))); - theme->set_icon("forward_folder", "FileDialog", theme->get_icon(SNAME("Forward"), SNAME("EditorIcons"))); - theme->set_icon("reload", "FileDialog", theme->get_icon(SNAME("Reload"), SNAME("EditorIcons"))); - theme->set_icon("toggle_hidden", "FileDialog", theme->get_icon(SNAME("GuiVisibilityVisible"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("folder"), SNAME("FileDialog"), theme->get_icon(SNAME("Folder"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("parent_folder"), SNAME("FileDialog"), theme->get_icon(SNAME("ArrowUp"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("back_folder"), SNAME("FileDialog"), theme->get_icon(SNAME("Back"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("forward_folder"), SNAME("FileDialog"), theme->get_icon(SNAME("Forward"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("reload"), SNAME("FileDialog"), theme->get_icon(SNAME("Reload"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("toggle_hidden"), SNAME("FileDialog"), theme->get_icon(SNAME("GuiVisibilityVisible"), SNAME("EditorIcons"))); // Use a different color for folder icons to make them easier to distinguish from files. // On a light theme, the icon will be dark, so we need to lighten it before blending it with the accent color. - theme->set_color("folder_icon_modulate", "FileDialog", (dark_theme ? Color(1, 1, 1) : Color(4.25, 4.25, 4.25)).lerp(accent_color, 0.7)); - theme->set_color("files_disabled", "FileDialog", font_disabled_color); + theme->set_color(SNAME("folder_icon_modulate"), SNAME("FileDialog"), (dark_theme ? Color(1, 1, 1) : Color(4.25, 4.25, 4.25)).lerp(accent_color, 0.7)); + theme->set_color(SNAME("files_disabled"), SNAME("FileDialog"), font_disabled_color); // ColorPicker - theme->set_constant("margin", "ColorPicker", popup_margin_size); - theme->set_constant("sv_width", "ColorPicker", 256 * EDSCALE); - theme->set_constant("sv_height", "ColorPicker", 256 * EDSCALE); - theme->set_constant("h_width", "ColorPicker", 30 * EDSCALE); - theme->set_constant("label_width", "ColorPicker", 10 * EDSCALE); - theme->set_icon("screen_picker", "ColorPicker", theme->get_icon(SNAME("ColorPick"), SNAME("EditorIcons"))); - theme->set_icon("add_preset", "ColorPicker", theme->get_icon(SNAME("Add"), SNAME("EditorIcons"))); - theme->set_icon("sample_bg", "ColorPicker", theme->get_icon(SNAME("GuiMiniCheckerboard"), SNAME("EditorIcons"))); - theme->set_icon("overbright_indicator", "ColorPicker", theme->get_icon(SNAME("OverbrightIndicator"), SNAME("EditorIcons"))); - theme->set_icon("bar_arrow", "ColorPicker", theme->get_icon(SNAME("ColorPickerBarArrow"), SNAME("EditorIcons"))); - theme->set_icon("picker_cursor", "ColorPicker", theme->get_icon(SNAME("PickerCursor"), SNAME("EditorIcons"))); + theme->set_constant(SNAME("margin"), SNAME("ColorPicker"), popup_margin_size); + theme->set_constant(SNAME("sv_width"), SNAME("ColorPicker"), 256 * EDSCALE); + theme->set_constant(SNAME("sv_height"), SNAME("ColorPicker"), 256 * EDSCALE); + theme->set_constant(SNAME("h_width"), SNAME("ColorPicker"), 30 * EDSCALE); + theme->set_constant(SNAME("label_width"), SNAME("ColorPicker"), 10 * EDSCALE); + theme->set_icon(SNAME("screen_picker"), SNAME("ColorPicker"), theme->get_icon(SNAME("ColorPick"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("add_preset"), SNAME("ColorPicker"), theme->get_icon(SNAME("Add"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("sample_bg"), SNAME("ColorPicker"), theme->get_icon(SNAME("GuiMiniCheckerboard"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("overbright_indicator"), SNAME("ColorPicker"), theme->get_icon(SNAME("OverbrightIndicator"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("bar_arrow"), SNAME("ColorPicker"), theme->get_icon(SNAME("ColorPickerBarArrow"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("picker_cursor"), SNAME("ColorPicker"), theme->get_icon(SNAME("PickerCursor"), SNAME("EditorIcons"))); // ColorPickerButton - theme->set_icon("bg", "ColorPickerButton", theme->get_icon(SNAME("GuiMiniCheckerboard"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("bg"), SNAME("ColorPickerButton"), theme->get_icon(SNAME("GuiMiniCheckerboard"), SNAME("EditorIcons"))); // ColorPresetButton Ref preset_sb = make_flat_stylebox(Color(1, 1, 1), 2, 2, 2, 2, 2); preset_sb->set_anti_aliased(false); - theme->set_stylebox("preset_fg", "ColorPresetButton", preset_sb); - theme->set_icon("preset_bg", "ColorPresetButton", theme->get_icon(SNAME("GuiMiniCheckerboard"), SNAME("EditorIcons"))); - theme->set_icon("overbright_indicator", "ColorPresetButton", theme->get_icon(SNAME("OverbrightIndicator"), SNAME("EditorIcons"))); + theme->set_stylebox(SNAME("preset_fg"), SNAME("ColorPresetButton"), preset_sb); + theme->set_icon(SNAME("preset_bg"), SNAME("ColorPresetButton"), theme->get_icon(SNAME("GuiMiniCheckerboard"), SNAME("EditorIcons"))); + theme->set_icon(SNAME("overbright_indicator"), SNAME("ColorPresetButton"), theme->get_icon(SNAME("OverbrightIndicator"), SNAME("EditorIcons"))); // Information on 3D viewport Ref style_info_3d_viewport = style_default->duplicate(); style_info_3d_viewport->set_bg_color(style_info_3d_viewport->get_bg_color() * Color(1, 1, 1, 0.5)); style_info_3d_viewport->set_border_width_all(0); - theme->set_stylebox("Information3dViewport", "EditorStyles", style_info_3d_viewport); + theme->set_stylebox(SNAME("Information3dViewport"), SNAME("EditorStyles"), style_info_3d_viewport); // Asset Library. - theme->set_stylebox("panel", "AssetLib", style_content_panel); - theme->set_color("status_color", "AssetLib", Color(0.5, 0.5, 0.5)); - theme->set_icon("dismiss", "AssetLib", theme->get_icon(SNAME("Close"), SNAME("EditorIcons"))); + theme->set_stylebox(SNAME("panel"), SNAME("AssetLib"), style_content_panel); + theme->set_color(SNAME("status_color"), SNAME("AssetLib"), Color(0.5, 0.5, 0.5)); + theme->set_icon(SNAME("dismiss"), SNAME("AssetLib"), theme->get_icon(SNAME("Close"), SNAME("EditorIcons"))); // Theme editor. - theme->set_color("preview_picker_overlay_color", "ThemeEditor", Color(0.1, 0.1, 0.1, 0.25)); + theme->set_color(SNAME("preview_picker_overlay_color"), SNAME("ThemeEditor"), Color(0.1, 0.1, 0.1, 0.25)); Color theme_preview_picker_bg_color = accent_color; theme_preview_picker_bg_color.a = 0.2; Ref theme_preview_picker_sb = make_flat_stylebox(theme_preview_picker_bg_color, 0, 0, 0, 0); theme_preview_picker_sb->set_border_color(accent_color); theme_preview_picker_sb->set_border_width_all(1.0 * EDSCALE); - theme->set_stylebox("preview_picker_overlay", "ThemeEditor", theme_preview_picker_sb); + theme->set_stylebox(SNAME("preview_picker_overlay"), SNAME("ThemeEditor"), theme_preview_picker_sb); Color theme_preview_picker_label_bg_color = accent_color; theme_preview_picker_label_bg_color.set_v(0.5); Ref theme_preview_picker_label_sb = make_flat_stylebox(theme_preview_picker_label_bg_color, 4.0, 1.0, 4.0, 3.0); - theme->set_stylebox("preview_picker_label", "ThemeEditor", theme_preview_picker_label_sb); + theme->set_stylebox(SNAME("preview_picker_label"), SNAME("ThemeEditor"), theme_preview_picker_label_sb); // adaptive script theme constants // for comments and elements with lower relevance @@ -1593,27 +1593,27 @@ Ref create_editor_theme(const Ref p_theme) { } // Now theme is loaded, apply it to CodeEdit. - theme->set_color("background_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/background_color")); - theme->set_color("completion_background_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/completion_background_color")); - theme->set_color("completion_selected_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/completion_selected_color")); - theme->set_color("completion_existing_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/completion_existing_color")); - theme->set_color("completion_scroll_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/completion_scroll_color")); - theme->set_color("completion_font_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/completion_font_color")); - theme->set_color("font_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/text_color")); - theme->set_color("line_number_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/line_number_color")); - theme->set_color("caret_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/caret_color")); - theme->set_color("font_selected_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/text_selected_color")); - theme->set_color("selection_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/selection_color")); - theme->set_color("brace_mismatch_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/brace_mismatch_color")); - theme->set_color("current_line_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/current_line_color")); - theme->set_color("line_length_guideline_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/line_length_guideline_color")); - theme->set_color("word_highlighted_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/word_highlighted_color")); - theme->set_color("bookmark_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/bookmark_color")); - theme->set_color("breakpoint_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/breakpoint_color")); - theme->set_color("executing_line_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/executing_line_color")); - theme->set_color("code_folding_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/code_folding_color")); - theme->set_color("search_result_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/search_result_color")); - theme->set_color("search_result_border_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/search_result_border_color")); + theme->set_color(SNAME("background_color"), SNAME("CodeEdit"), EDITOR_GET("text_editor/theme/highlighting/background_color")); + theme->set_color(SNAME("completion_background_color"), SNAME("CodeEdit"), EDITOR_GET("text_editor/theme/highlighting/completion_background_color")); + theme->set_color(SNAME("completion_selected_color"), SNAME("CodeEdit"), EDITOR_GET("text_editor/theme/highlighting/completion_selected_color")); + theme->set_color(SNAME("completion_existing_color"), SNAME("CodeEdit"), EDITOR_GET("text_editor/theme/highlighting/completion_existing_color")); + theme->set_color(SNAME("completion_scroll_color"), SNAME("CodeEdit"), EDITOR_GET("text_editor/theme/highlighting/completion_scroll_color")); + theme->set_color(SNAME("completion_font_color"), SNAME("CodeEdit"), EDITOR_GET("text_editor/theme/highlighting/completion_font_color")); + theme->set_color(SNAME("font_color"), SNAME("CodeEdit"), EDITOR_GET("text_editor/theme/highlighting/text_color")); + theme->set_color(SNAME("line_number_color"), SNAME("CodeEdit"), EDITOR_GET("text_editor/theme/highlighting/line_number_color")); + theme->set_color(SNAME("caret_color"), SNAME("CodeEdit"), EDITOR_GET("text_editor/theme/highlighting/caret_color")); + theme->set_color(SNAME("font_selected_color"), SNAME("CodeEdit"), EDITOR_GET("text_editor/theme/highlighting/text_selected_color")); + theme->set_color(SNAME("selection_color"), SNAME("CodeEdit"), EDITOR_GET("text_editor/theme/highlighting/selection_color")); + theme->set_color(SNAME("brace_mismatch_color"), SNAME("CodeEdit"), EDITOR_GET("text_editor/theme/highlighting/brace_mismatch_color")); + theme->set_color(SNAME("current_line_color"), SNAME("CodeEdit"), EDITOR_GET("text_editor/theme/highlighting/current_line_color")); + theme->set_color(SNAME("line_length_guideline_color"), SNAME("CodeEdit"), EDITOR_GET("text_editor/theme/highlighting/line_length_guideline_color")); + theme->set_color(SNAME("word_highlighted_color"), SNAME("CodeEdit"), EDITOR_GET("text_editor/theme/highlighting/word_highlighted_color")); + theme->set_color(SNAME("bookmark_color"), SNAME("CodeEdit"), EDITOR_GET("text_editor/theme/highlighting/bookmark_color")); + theme->set_color(SNAME("breakpoint_color"), SNAME("CodeEdit"), EDITOR_GET("text_editor/theme/highlighting/breakpoint_color")); + theme->set_color(SNAME("executing_line_color"), SNAME("CodeEdit"), EDITOR_GET("text_editor/theme/highlighting/executing_line_color")); + theme->set_color(SNAME("code_folding_color"), SNAME("CodeEdit"), EDITOR_GET("text_editor/theme/highlighting/code_folding_color")); + theme->set_color(SNAME("search_result_color"), SNAME("CodeEdit"), EDITOR_GET("text_editor/theme/highlighting/search_result_color")); + theme->set_color(SNAME("search_result_border_color"), SNAME("CodeEdit"), EDITOR_GET("text_editor/theme/highlighting/search_result_border_color")); return theme; } diff --git a/editor/editor_toaster.cpp b/editor/editor_toaster.cpp index 6c9e4ab0fcdb..f326c9fc3776 100644 --- a/editor/editor_toaster.cpp +++ b/editor/editor_toaster.cpp @@ -113,22 +113,22 @@ void EditorToaster::_notification(int p_what) { disable_notifications_button->set_icon(get_theme_icon(SNAME("NotificationDisabled"), SNAME("EditorIcons"))); // Styleboxes background. - info_panel_style_background->set_bg_color(get_theme_color("base_color", "Editor")); + info_panel_style_background->set_bg_color(get_theme_color(SNAME("base_color"), SNAME("Editor"))); - warning_panel_style_background->set_bg_color(get_theme_color("base_color", "Editor")); - warning_panel_style_background->set_border_color(get_theme_color("warning_color", "Editor")); + warning_panel_style_background->set_bg_color(get_theme_color(SNAME("base_color"), SNAME("Editor"))); + warning_panel_style_background->set_border_color(get_theme_color(SNAME("warning_color"), SNAME("Editor"))); - error_panel_style_background->set_bg_color(get_theme_color("base_color", "Editor")); - error_panel_style_background->set_border_color(get_theme_color("error_color", "Editor")); + error_panel_style_background->set_bg_color(get_theme_color(SNAME("base_color"), SNAME("Editor"))); + error_panel_style_background->set_border_color(get_theme_color(SNAME("error_color"), SNAME("Editor"))); // Styleboxes progress. - info_panel_style_progress->set_bg_color(get_theme_color("base_color", "Editor").lightened(0.03)); + info_panel_style_progress->set_bg_color(get_theme_color(SNAME("base_color"), SNAME("Editor")).lightened(0.03)); - warning_panel_style_progress->set_bg_color(get_theme_color("base_color", "Editor").lightened(0.03)); - warning_panel_style_progress->set_border_color(get_theme_color("warning_color", "Editor")); + warning_panel_style_progress->set_bg_color(get_theme_color(SNAME("base_color"), SNAME("Editor")).lightened(0.03)); + warning_panel_style_progress->set_border_color(get_theme_color(SNAME("warning_color"), SNAME("Editor"))); - error_panel_style_progress->set_bg_color(get_theme_color("base_color", "Editor").lightened(0.03)); - error_panel_style_progress->set_border_color(get_theme_color("error_color", "Editor")); + error_panel_style_progress->set_bg_color(get_theme_color(SNAME("base_color"), SNAME("Editor")).lightened(0.03)); + error_panel_style_progress->set_border_color(get_theme_color(SNAME("error_color"), SNAME("Editor"))); main_button->update(); disable_notifications_button->update(); @@ -256,13 +256,13 @@ void EditorToaster::_draw_button() { real_t button_radius = main_button->get_size().x / 8; switch (highest_severity) { case SEVERITY_INFO: - color = get_theme_color("accent_color", "Editor"); + color = get_theme_color(SNAME("accent_color"), SNAME("Editor")); break; case SEVERITY_WARNING: - color = get_theme_color("warning_color", "Editor"); + color = get_theme_color(SNAME("warning_color"), SNAME("Editor")); break; case SEVERITY_ERROR: - color = get_theme_color("error_color", "Editor"); + color = get_theme_color(SNAME("error_color"), SNAME("Editor")); break; default: break; @@ -333,13 +333,13 @@ Control *EditorToaster::popup(Control *p_control, Severity p_severity, double p_ panel->set_tooltip(p_tooltip); switch (p_severity) { case SEVERITY_INFO: - panel->add_theme_style_override("panel", info_panel_style_background); + panel->add_theme_style_override(SNAME("panel"), info_panel_style_background); break; case SEVERITY_WARNING: - panel->add_theme_style_override("panel", warning_panel_style_background); + panel->add_theme_style_override(SNAME("panel"), warning_panel_style_background); break; case SEVERITY_ERROR: - panel->add_theme_style_override("panel", error_panel_style_background); + panel->add_theme_style_override(SNAME("panel"), error_panel_style_background); break; default: break; @@ -360,7 +360,7 @@ Control *EditorToaster::popup(Control *p_control, Severity p_severity, double p_ if (p_time > 0.0) { Button *close_button = memnew(Button); close_button->set_flat(true); - close_button->set_icon(get_theme_icon("Close", "EditorIcons")); + close_button->set_icon(get_theme_icon(SNAME("Close"), SNAME("EditorIcons"))); close_button->connect("pressed", callable_bind(callable_mp(this, &EditorToaster::close), panel)); close_button->connect("theme_changed", callable_bind(callable_mp(this, &EditorToaster::_close_button_theme_changed), close_button)); hbox_container->add_child(close_button); @@ -442,7 +442,7 @@ void EditorToaster::close(Control *p_control) { void EditorToaster::_close_button_theme_changed(Control *p_close_button) { Button *close_button = Object::cast_to