From 926afccbd88c8550964daa73ab3de2c5ab30aa80 Mon Sep 17 00:00:00 2001 From: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> Date: Tue, 14 May 2024 15:50:53 +0200 Subject: [PATCH] [Scene] Add `SceneStringNames::panel` --- editor/animation_track_editor.cpp | 2 +- editor/debugger/editor_debugger_node.cpp | 6 +-- editor/debugger/script_editor_debugger.cpp | 4 +- editor/editor_audio_buses.cpp | 8 +-- editor/editor_inspector.cpp | 10 ++-- editor/editor_node.cpp | 10 ++-- editor/editor_properties_array_dict.cpp | 4 +- editor/editor_resource_picker.cpp | 2 +- editor/editor_settings_dialog.cpp | 2 +- editor/filesystem_dock.cpp | 2 +- editor/gui/editor_bottom_panel.cpp | 6 +-- editor/gui/editor_run_bar.cpp | 16 +++--- editor/gui/editor_scene_tabs.cpp | 2 +- editor/gui/editor_toaster.cpp | 8 +-- .../import/dynamic_font_import_settings.cpp | 4 +- .../animation_blend_space_1d_editor.cpp | 4 +- .../animation_blend_space_2d_editor.cpp | 4 +- .../animation_blend_tree_editor_plugin.cpp | 4 +- .../animation_player_editor_plugin.cpp | 4 +- .../animation_state_machine_editor.cpp | 4 +- .../plugins/asset_library_editor_plugin.cpp | 14 ++--- editor/plugins/canvas_item_editor_plugin.cpp | 2 +- editor/plugins/control_editor_plugin.cpp | 2 +- editor/plugins/curve_editor_plugin.cpp | 2 +- editor/plugins/node_3d_editor_plugin.cpp | 4 +- editor/plugins/polygon_2d_editor_plugin.cpp | 4 +- editor/plugins/script_editor_plugin.cpp | 8 +-- editor/plugins/shader_editor_plugin.cpp | 2 +- .../plugins/sprite_frames_editor_plugin.cpp | 2 +- editor/plugins/text_shader_editor.cpp | 2 +- .../plugins/texture_region_editor_plugin.cpp | 4 +- editor/plugins/theme_editor_plugin.cpp | 2 +- editor/plugins/tiles/tile_set_editor.cpp | 2 +- .../plugins/visual_shader_editor_plugin.cpp | 4 +- editor/progress_dialog.cpp | 2 +- editor/project_manager.cpp | 8 +-- .../project_manager/quick_settings_dialog.cpp | 2 +- editor/project_settings_editor.cpp | 2 +- editor/renames_map_3_to_4.cpp | 2 +- editor/themes/editor_theme_manager.cpp | 52 +++++++++---------- editor/window_wrapper.cpp | 4 +- .../multiplayer/editor/replication_editor.cpp | 2 +- .../editor/openxr_action_map_editor.cpp | 4 +- .../editor/openxr_action_set_editor.cpp | 2 +- .../openxr_interaction_profile_editor.cpp | 4 +- .../editor/openxr_select_action_dialog.cpp | 2 +- ...enxr_select_interaction_profile_dialog.cpp | 2 +- scene/gui/color_picker.cpp | 2 +- scene/gui/dialogs.cpp | 2 +- scene/gui/graph_edit.cpp | 4 +- scene/gui/popup.cpp | 2 +- scene/gui/popup_menu.cpp | 2 +- scene/scene_string_names.cpp | 2 + scene/scene_string_names.h | 2 + scene/theme/default_theme.cpp | 30 +++++------ 55 files changed, 149 insertions(+), 145 deletions(-) diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 69dbb267499..2d497a281f6 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -4850,7 +4850,7 @@ void AnimationTrackEditor::_notification(int p_what) { imported_anim_warning->set_icon(get_editor_theme_icon(SNAME("NodeWarning"))); dummy_player_warning->set_icon(get_editor_theme_icon(SNAME("NodeWarning"))); inactive_player_warning->set_icon(get_editor_theme_icon(SNAME("NodeWarning"))); - main_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("Tree"))); + main_panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("Tree"))); edit->get_popup()->set_item_icon(edit->get_popup()->get_item_index(EDIT_APPLY_RESET), get_editor_theme_icon(SNAME("Reload"))); auto_fit->set_icon(get_editor_theme_icon(SNAME("AnimationAutoFit"))); auto_fit_bezier->set_icon(get_editor_theme_icon(SNAME("AnimationAutoFitBezier"))); diff --git a/editor/debugger/editor_debugger_node.cpp b/editor/debugger/editor_debugger_node.cpp index e52c9c914cb..3f8df5e3134 100644 --- a/editor/debugger/editor_debugger_node.cpp +++ b/editor/debugger/editor_debugger_node.cpp @@ -75,7 +75,7 @@ EditorDebuggerNode::EditorDebuggerNode() { Ref empty; empty.instantiate(); - tabs->add_theme_style_override("panel", empty); + tabs->add_theme_style_override(SceneStringName(panel), empty); auto_switch_remote_scene_tree = EDITOR_GET("debugger/auto_switch_to_remote_scene_tree"); _add_debugger(); @@ -123,7 +123,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_editor_theme()->get_stylebox(SNAME("DebuggerPanel"), EditorStringName(EditorStyles))); + tabs->add_theme_style_override(SceneStringName(panel), EditorNode::get_singleton()->get_editor_theme()->get_stylebox(SNAME("DebuggerPanel"), EditorStringName(EditorStyles))); } if (!debugger_plugins.is_empty()) { @@ -318,7 +318,7 @@ void EditorDebuggerNode::_notification(int p_what) { add_theme_constant_override("margin_left", -EditorNode::get_singleton()->get_editor_theme()->get_stylebox(SNAME("BottomPanelDebuggerOverride"), EditorStringName(EditorStyles))->get_margin(SIDE_LEFT)); add_theme_constant_override("margin_right", -EditorNode::get_singleton()->get_editor_theme()->get_stylebox(SNAME("BottomPanelDebuggerOverride"), EditorStringName(EditorStyles))->get_margin(SIDE_RIGHT)); - tabs->add_theme_style_override("panel", EditorNode::get_singleton()->get_editor_theme()->get_stylebox(SNAME("DebuggerPanel"), EditorStringName(EditorStyles))); + tabs->add_theme_style_override(SceneStringName(panel), EditorNode::get_singleton()->get_editor_theme()->get_stylebox(SNAME("DebuggerPanel"), EditorStringName(EditorStyles))); } remote_scene_tree->update_icon_max_width(); diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp index 2c1eced3e08..e35ca590b30 100644 --- a/editor/debugger/script_editor_debugger.cpp +++ b/editor/debugger/script_editor_debugger.cpp @@ -154,7 +154,7 @@ void ScriptEditorDebugger::update_tabs() { } void ScriptEditorDebugger::clear_style() { - tabs->remove_theme_style_override("panel"); + tabs->remove_theme_style_override(SceneStringName(panel)); } void ScriptEditorDebugger::save_node(ObjectID p_id, const String &p_file) { @@ -857,7 +857,7 @@ void ScriptEditorDebugger::_notification(int p_what) { [[fallthrough]]; } case NOTIFICATION_THEME_CHANGED: { - tabs->add_theme_style_override("panel", get_theme_stylebox(SNAME("DebuggerPanel"), EditorStringName(EditorStyles))); + tabs->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SNAME("DebuggerPanel"), EditorStringName(EditorStyles))); skip_breakpoints->set_icon(get_editor_theme_icon(skip_breakpoints_value ? SNAME("DebugSkipBreakpointsOn") : SNAME("DebugSkipBreakpointsOff"))); copy->set_icon(get_editor_theme_icon(SNAME("ActionCopy"))); diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index 0b5122fce2f..3e505b6cd0c 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -107,7 +107,7 @@ void EditorAudioBus::_notification(int p_what) { 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_box->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("TooltipPanel"))); for (int i = 0; i < effect_options->get_item_count(); i++) { String class_name = effect_options->get_item_metadata(i); @@ -127,7 +127,7 @@ void EditorAudioBus::_notification(int p_what) { } else if (has_focus()) { draw_style_box(get_theme_stylebox(SNAME("focus"), SNAME("Button")), Rect2(Vector2(), get_size())); } else { - draw_style_box(get_theme_stylebox(SNAME("panel"), SNAME("TabContainer")), Rect2(Vector2(), get_size())); + draw_style_box(get_theme_stylebox(SceneStringName(panel), SNAME("TabContainer")), Rect2(Vector2(), get_size())); } if (get_index() != 0 && hovering_drop) { @@ -608,7 +608,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(SceneStringName(panel), get_theme_stylebox(SNAME("focus"), SNAME("Button"))); p->set_size(get_size()); p->set_position(-p_point); set_drag_preview(c); @@ -1062,7 +1062,7 @@ void EditorAudioBuses::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: case NOTIFICATION_THEME_CHANGED: { - bus_scroll->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("Tree"))); + bus_scroll->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("Tree"))); } break; case NOTIFICATION_READY: { diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 0ea944a05fe..c1ee2ef0e02 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -517,9 +517,9 @@ void EditorProperty::_update_property_bg() { add_theme_style_override("bg_selected", get_theme_stylebox("sub_inspector_property_bg" + itos(count_subinspectors), EditorStringName(EditorStyles))); add_theme_style_override("bg", get_theme_stylebox("sub_inspector_property_bg" + itos(count_subinspectors), EditorStringName(EditorStyles))); add_theme_color_override("property_color", get_theme_color(SNAME("sub_inspector_property_color"), EditorStringName(EditorStyles))); - bottom_editor->add_theme_style_override("panel", get_theme_stylebox("sub_inspector_bg" + itos(count_subinspectors), EditorStringName(EditorStyles))); + bottom_editor->add_theme_style_override(SceneStringName(panel), get_theme_stylebox("sub_inspector_bg" + itos(count_subinspectors), EditorStringName(EditorStyles))); } else { - bottom_editor->add_theme_style_override("panel", get_theme_stylebox("sub_inspector_bg_no_border", EditorStringName(EditorStyles))); + bottom_editor->add_theme_style_override(SceneStringName(panel), get_theme_stylebox("sub_inspector_bg_no_border", EditorStringName(EditorStyles))); } } else { remove_theme_style_override("bg_selected"); @@ -2174,7 +2174,7 @@ void EditorInspectorArray::_setup() { ae.panel->connect(SceneStringName(focus_exited), callable_mp((CanvasItem *)ae.panel, &PanelContainer::queue_redraw)); ae.panel->connect(SceneStringName(draw), callable_mp(this, &EditorInspectorArray::_panel_draw).bind(i)); ae.panel->connect(SceneStringName(gui_input), callable_mp(this, &EditorInspectorArray::_panel_gui_input).bind(i)); - ae.panel->add_theme_style_override(SNAME("panel"), i % 2 ? odd_style : even_style); + ae.panel->add_theme_style_override(SceneStringName(panel), i % 2 ? odd_style : even_style); elements_vbox->add_child(ae.panel); ae.margin = memnew(MarginContainer); @@ -4053,7 +4053,7 @@ void EditorInspector::_notification(int p_what) { case NOTIFICATION_READY: { EditorFeatureProfileManager::get_singleton()->connect("current_feature_profile_changed", callable_mp(this, &EditorInspector::_feature_profile_changed)); set_process(is_visible_in_tree()); - add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("Tree"))); + add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("Tree"))); if (!sub_inspector) { get_tree()->connect("node_removed", callable_mp(this, &EditorInspector::_node_removed)); } @@ -4120,7 +4120,7 @@ void EditorInspector::_notification(int p_what) { case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { bool needs_update = false; if (EditorThemeManager::is_generated_theme_outdated() && !sub_inspector) { - add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("Tree"))); + add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("Tree"))); } if (use_settings_name_style && EditorSettings::get_singleton()->check_changed_settings_in_group("interface/editor/localize_settings")) { diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index a6031219388..f62891781fb 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -514,12 +514,12 @@ void EditorNode::_update_theme(bool p_skip_creation) { // Update styles. { - gui_base->add_theme_style_override("panel", theme->get_stylebox(SNAME("Background"), EditorStringName(EditorStyles))); + gui_base->add_theme_style_override(SceneStringName(panel), theme->get_stylebox(SNAME("Background"), EditorStringName(EditorStyles))); main_vbox->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT, Control::PRESET_MODE_MINSIZE, theme->get_constant(SNAME("window_border_margin"), EditorStringName(Editor))); main_vbox->add_theme_constant_override("separation", theme->get_constant(SNAME("top_bar_separation"), EditorStringName(Editor))); - scene_root_parent->add_theme_style_override("panel", theme->get_stylebox(SNAME("Content"), EditorStringName(EditorStyles))); - bottom_panel->add_theme_style_override("panel", theme->get_stylebox(SNAME("BottomPanel"), EditorStringName(EditorStyles))); + scene_root_parent->add_theme_style_override(SceneStringName(panel), theme->get_stylebox(SNAME("Content"), EditorStringName(EditorStyles))); + bottom_panel->add_theme_style_override(SceneStringName(panel), theme->get_stylebox(SNAME("BottomPanel"), EditorStringName(EditorStyles))); distraction_free->set_icon(theme->get_icon(SNAME("DistractionFree"), EditorStringName(EditorIcons))); distraction_free->add_theme_style_override(SceneStringName(pressed), theme->get_stylebox("normal", "FlatMenuButton")); @@ -529,7 +529,7 @@ void EditorNode::_update_theme(bool p_skip_creation) { help_menu->set_item_icon(help_menu->get_item_index(HELP_SUPPORT_GODOT_DEVELOPMENT), theme->get_icon(SNAME("Heart"), EditorStringName(EditorIcons))); if (EditorDebuggerNode::get_singleton()->is_visible()) { - bottom_panel->add_theme_style_override("panel", theme->get_stylebox(SNAME("BottomPanelDebuggerOverride"), EditorStringName(EditorStyles))); + bottom_panel->add_theme_style_override(SceneStringName(panel), theme->get_stylebox(SNAME("BottomPanelDebuggerOverride"), EditorStringName(EditorStyles))); } for (int i = 0; i < main_editor_buttons.size(); i++) { @@ -6792,7 +6792,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", theme->get_stylebox(SNAME("Content"), EditorStringName(EditorStyles))); + scene_root_parent->add_theme_style_override(SceneStringName(panel), theme->get_stylebox(SNAME("Content"), EditorStringName(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); diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp index 8f2936705e5..555165c156a 100644 --- a/editor/editor_properties_array_dict.cpp +++ b/editor/editor_properties_array_dict.cpp @@ -1005,7 +1005,7 @@ void EditorPropertyDictionary::update_property() { add_panel = memnew(PanelContainer); property_vbox->add_child(add_panel); - add_panel->add_theme_style_override(SNAME("panel"), get_theme_stylebox(SNAME("DictionaryAddItem"))); + add_panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SNAME("DictionaryAddItem"))); VBoxContainer *add_vbox = memnew(VBoxContainer); add_panel->add_child(add_vbox); @@ -1101,7 +1101,7 @@ void EditorPropertyDictionary::_notification(int p_what) { if (button_add_item) { button_add_item->set_icon(get_editor_theme_icon(SNAME("Add"))); - add_panel->add_theme_style_override(SNAME("panel"), get_theme_stylebox(SNAME("DictionaryAddItem"))); + add_panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SNAME("DictionaryAddItem"))); } } break; } diff --git a/editor/editor_resource_picker.cpp b/editor/editor_resource_picker.cpp index 7e367c753d3..fbd9d84e267 100644 --- a/editor/editor_resource_picker.cpp +++ b/editor/editor_resource_picker.cpp @@ -811,7 +811,7 @@ void EditorResourcePicker::_notification(int p_what) { } break; case NOTIFICATION_DRAW: { - draw_style_box(get_theme_stylebox(SNAME("panel"), SNAME("Tree")), Rect2(Point2(), get_size())); + draw_style_box(get_theme_stylebox(SceneStringName(panel), SNAME("Tree")), Rect2(Point2(), get_size())); } break; case NOTIFICATION_DRAG_BEGIN: { diff --git a/editor/editor_settings_dialog.cpp b/editor/editor_settings_dialog.cpp index b1f3875175a..7f9310f715b 100644 --- a/editor/editor_settings_dialog.cpp +++ b/editor/editor_settings_dialog.cpp @@ -211,7 +211,7 @@ void EditorSettingsDialog::_update_icons() { shortcut_search_box->set_clear_button_enabled(true); restart_close_button->set_icon(shortcuts->get_editor_theme_icon(SNAME("Close"))); - restart_container->add_theme_style_override("panel", shortcuts->get_theme_stylebox(SNAME("panel"), SNAME("Tree"))); + restart_container->add_theme_style_override(SceneStringName(panel), shortcuts->get_theme_stylebox(SceneStringName(panel), SNAME("Tree"))); restart_icon->set_texture(shortcuts->get_editor_theme_icon(SNAME("StatusWarning"))); restart_label->add_theme_color_override("font_color", shortcuts->get_theme_color(SNAME("warning_color"), EditorStringName(Editor))); } diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index f8401b5ec12..f91e9702835 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -646,7 +646,7 @@ void FileSystemDock::_notification(int p_what) { button_hist_prev->set_icon(get_editor_theme_icon(SNAME("Back"))); } - overwrite_dialog_scroll->add_theme_style_override("panel", get_theme_stylebox("panel", "Tree")); + overwrite_dialog_scroll->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), "Tree")); } break; case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { diff --git a/editor/gui/editor_bottom_panel.cpp b/editor/gui/editor_bottom_panel.cpp index 3dbefa5cbcd..f2c4a13e057 100644 --- a/editor/gui/editor_bottom_panel.cpp +++ b/editor/gui/editor_bottom_panel.cpp @@ -81,9 +81,9 @@ void EditorBottomPanel::_switch_to_item(bool p_visible, int p_idx) { } if (EditorDebuggerNode::get_singleton() == items[p_idx].control) { // This is the debug panel which uses tabs, so the top section should be smaller. - add_theme_style_override("panel", get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), EditorStringName(EditorStyles))); + add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), EditorStringName(EditorStyles))); } else { - add_theme_style_override("panel", get_theme_stylebox(SNAME("BottomPanel"), EditorStringName(EditorStyles))); + add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SNAME("BottomPanel"), EditorStringName(EditorStyles))); } center_split->set_dragger_visibility(SplitContainer::DRAGGER_VISIBLE); center_split->set_collapsed(false); @@ -92,7 +92,7 @@ void EditorBottomPanel::_switch_to_item(bool p_visible, int p_idx) { } expand_button->show(); } else { - add_theme_style_override("panel", get_theme_stylebox(SNAME("BottomPanel"), EditorStringName(EditorStyles))); + add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SNAME("BottomPanel"), EditorStringName(EditorStyles))); items[p_idx].button->set_pressed_no_signal(false); items[p_idx].control->set_visible(false); center_split->set_dragger_visibility(SplitContainer::DRAGGER_HIDDEN); diff --git a/editor/gui/editor_run_bar.cpp b/editor/gui/editor_run_bar.cpp index 31331126b2f..af044cbfce0 100644 --- a/editor/gui/editor_run_bar.cpp +++ b/editor/gui/editor_run_bar.cpp @@ -56,11 +56,11 @@ void EditorRunBar::_notification(int p_what) { stop_button->set_icon(get_editor_theme_icon(SNAME("Stop"))); if (is_movie_maker_enabled()) { - main_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("LaunchPadMovieMode"), EditorStringName(EditorStyles))); - write_movie_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("MovieWriterButtonPressed"), EditorStringName(EditorStyles))); + main_panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SNAME("LaunchPadMovieMode"), EditorStringName(EditorStyles))); + write_movie_panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SNAME("MovieWriterButtonPressed"), EditorStringName(EditorStyles))); } else { - main_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("LaunchPadNormal"), EditorStringName(EditorStyles))); - write_movie_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("MovieWriterButtonNormal"), EditorStringName(EditorStyles))); + main_panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SNAME("LaunchPadNormal"), EditorStringName(EditorStyles))); + write_movie_panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SNAME("MovieWriterButtonNormal"), EditorStringName(EditorStyles))); } write_movie_button->set_icon(get_editor_theme_icon(SNAME("MainMovieWrite"))); @@ -112,11 +112,11 @@ void EditorRunBar::_update_play_buttons() { void EditorRunBar::_write_movie_toggled(bool p_enabled) { if (p_enabled) { - add_theme_style_override("panel", get_theme_stylebox(SNAME("LaunchPadMovieMode"), EditorStringName(EditorStyles))); - write_movie_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("MovieWriterButtonPressed"), EditorStringName(EditorStyles))); + add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SNAME("LaunchPadMovieMode"), EditorStringName(EditorStyles))); + write_movie_panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SNAME("MovieWriterButtonPressed"), EditorStringName(EditorStyles))); } else { - add_theme_style_override("panel", get_theme_stylebox(SNAME("LaunchPadNormal"), EditorStringName(EditorStyles))); - write_movie_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("MovieWriterButtonNormal"), EditorStringName(EditorStyles))); + add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SNAME("LaunchPadNormal"), EditorStringName(EditorStyles))); + write_movie_panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SNAME("MovieWriterButtonNormal"), EditorStringName(EditorStyles))); } } diff --git a/editor/gui/editor_scene_tabs.cpp b/editor/gui/editor_scene_tabs.cpp index 791c51fba2b..2622645d7c4 100644 --- a/editor/gui/editor_scene_tabs.cpp +++ b/editor/gui/editor_scene_tabs.cpp @@ -50,7 +50,7 @@ EditorSceneTabs *EditorSceneTabs::singleton = nullptr; void EditorSceneTabs::_notification(int p_what) { switch (p_what) { case NOTIFICATION_THEME_CHANGED: { - tabbar_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("tabbar_background"), SNAME("TabContainer"))); + tabbar_panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SNAME("tabbar_background"), SNAME("TabContainer"))); scene_tabs->add_theme_constant_override("icon_max_width", get_theme_constant(SNAME("class_icon_size"), EditorStringName(Editor))); scene_tab_add->set_icon(get_editor_theme_icon(SNAME("Add"))); diff --git a/editor/gui/editor_toaster.cpp b/editor/gui/editor_toaster.cpp index df6c494392d..9be58326acf 100644 --- a/editor/gui/editor_toaster.cpp +++ b/editor/gui/editor_toaster.cpp @@ -348,13 +348,13 @@ Control *EditorToaster::popup(Control *p_control, Severity p_severity, double p_ panel->set_tooltip_text(p_tooltip); switch (p_severity) { case SEVERITY_INFO: - panel->add_theme_style_override("panel", info_panel_style_background); + panel->add_theme_style_override(SceneStringName(panel), info_panel_style_background); break; case SEVERITY_WARNING: - panel->add_theme_style_override("panel", warning_panel_style_background); + panel->add_theme_style_override(SceneStringName(panel), warning_panel_style_background); break; case SEVERITY_ERROR: - panel->add_theme_style_override("panel", error_panel_style_background); + panel->add_theme_style_override(SceneStringName(panel), error_panel_style_background); break; default: break; @@ -552,7 +552,7 @@ EditorToaster::EditorToaster() { // Disable notification button. disable_notifications_panel = memnew(PanelContainer); disable_notifications_panel->set_as_top_level(true); - disable_notifications_panel->add_theme_style_override("panel", info_panel_style_background); + disable_notifications_panel->add_theme_style_override(SceneStringName(panel), info_panel_style_background); add_child(disable_notifications_panel); disable_notifications_button = memnew(Button); diff --git a/editor/import/dynamic_font_import_settings.cpp b/editor/import/dynamic_font_import_settings.cpp index aad7302ec52..9b6a7b9a93a 100644 --- a/editor/import/dynamic_font_import_settings.cpp +++ b/editor/import/dynamic_font_import_settings.cpp @@ -1515,8 +1515,8 @@ DynamicFontImportSettingsDialog::DynamicFontImportSettingsDialog() { for (int i = 0; i < 16; i++) { glyph_table->set_column_title(i + 1, String::num_int64(i, 16)); } - glyph_table->add_theme_style_override("selected", glyph_table->get_theme_stylebox(SNAME("panel"))); - glyph_table->add_theme_style_override("selected_focus", glyph_table->get_theme_stylebox(SNAME("panel"))); + glyph_table->add_theme_style_override("selected", glyph_table->get_theme_stylebox(SceneStringName(panel))); + glyph_table->add_theme_style_override("selected_focus", glyph_table->get_theme_stylebox(SceneStringName(panel))); glyph_table->add_theme_constant_override("h_separation", 0); glyph_table->set_h_size_flags(Control::SIZE_EXPAND_FILL); glyph_table->set_v_size_flags(Control::SIZE_EXPAND_FILL); diff --git a/editor/plugins/animation_blend_space_1d_editor.cpp b/editor/plugins/animation_blend_space_1d_editor.cpp index 2eed2b4775b..52ea7ff0baa 100644 --- a/editor/plugins/animation_blend_space_1d_editor.cpp +++ b/editor/plugins/animation_blend_space_1d_editor.cpp @@ -573,9 +573,9 @@ void AnimationNodeBlendSpace1DEditor::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: case NOTIFICATION_THEME_CHANGED: { - error_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("Tree"))); + error_panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("Tree"))); error_label->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), EditorStringName(Editor))); - panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("Tree"))); + panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("Tree"))); tool_blend->set_icon(get_editor_theme_icon(SNAME("EditPivot"))); tool_select->set_icon(get_editor_theme_icon(SNAME("ToolSelect"))); tool_create->set_icon(get_editor_theme_icon(SNAME("EditKey"))); diff --git a/editor/plugins/animation_blend_space_2d_editor.cpp b/editor/plugins/animation_blend_space_2d_editor.cpp index 1caec005861..ef61a95ee75 100644 --- a/editor/plugins/animation_blend_space_2d_editor.cpp +++ b/editor/plugins/animation_blend_space_2d_editor.cpp @@ -795,9 +795,9 @@ void AnimationNodeBlendSpace2DEditor::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: case NOTIFICATION_THEME_CHANGED: { - error_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("Tree"))); + error_panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("Tree"))); error_label->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), EditorStringName(Editor))); - panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("Tree"))); + panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("Tree"))); tool_blend->set_icon(get_editor_theme_icon(SNAME("EditPivot"))); tool_select->set_icon(get_editor_theme_icon(SNAME("ToolSelect"))); tool_create->set_icon(get_editor_theme_icon(SNAME("EditKey"))); diff --git a/editor/plugins/animation_blend_tree_editor_plugin.cpp b/editor/plugins/animation_blend_tree_editor_plugin.cpp index 9f2959e9d93..28e1eeccc4b 100644 --- a/editor/plugins/animation_blend_tree_editor_plugin.cpp +++ b/editor/plugins/animation_blend_tree_editor_plugin.cpp @@ -265,7 +265,7 @@ void AnimationNodeBlendTreeEditor::update_graph() { } // TODO: Avoid using strings, expose a method on GraphNode instead. - Ref sb = node->get_theme_stylebox(SNAME("panel")); + Ref sb = node->get_theme_stylebox(SceneStringName(panel)); Color c = sb->get_border_color(); Color mono_color = ((c.r + c.g + c.b) / 3) < 0.7 ? Color(1.0, 1.0, 1.0) : Color(0.0, 0.0, 0.0); mono_color.a = 0.85; @@ -942,7 +942,7 @@ void AnimationNodeBlendTreeEditor::_notification(int p_what) { } break; case NOTIFICATION_THEME_CHANGED: { - error_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("Tree"))); + error_panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("Tree"))); error_label->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), EditorStringName(Editor))); if (is_visible_in_tree()) { diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp index 37db0741427..cc8e21643c7 100644 --- a/editor/plugins/animation_player_editor_plugin.cpp +++ b/editor/plugins/animation_player_editor_plugin.cpp @@ -129,12 +129,12 @@ void AnimationPlayerEditor::_notification(int p_what) { get_tree()->connect(SNAME("node_removed"), callable_mp(this, &AnimationPlayerEditor::_node_removed)); - add_theme_style_override("panel", EditorNode::get_singleton()->get_editor_theme()->get_stylebox(SNAME("panel"), SNAME("Panel"))); + add_theme_style_override(SceneStringName(panel), EditorNode::get_singleton()->get_editor_theme()->get_stylebox(SceneStringName(panel), SNAME("Panel"))); } break; case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { if (EditorThemeManager::is_generated_theme_outdated()) { - add_theme_style_override("panel", EditorNode::get_singleton()->get_editor_theme()->get_stylebox(SNAME("panel"), SNAME("Panel"))); + add_theme_style_override(SceneStringName(panel), EditorNode::get_singleton()->get_editor_theme()->get_stylebox(SceneStringName(panel), SNAME("Panel"))); } } break; diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp index 8aec827aadb..8be010c00bc 100644 --- a/editor/plugins/animation_state_machine_editor.cpp +++ b/editor/plugins/animation_state_machine_editor.cpp @@ -1267,8 +1267,8 @@ void AnimationNodeStateMachineEditor::_update_graph() { void AnimationNodeStateMachineEditor::_notification(int p_what) { switch (p_what) { case NOTIFICATION_THEME_CHANGED: { - panel->add_theme_style_override("panel", theme_cache.panel_style); - error_panel->add_theme_style_override("panel", theme_cache.error_panel_style); + panel->add_theme_style_override(SceneStringName(panel), theme_cache.panel_style); + error_panel->add_theme_style_override(SceneStringName(panel), theme_cache.error_panel_style); error_label->add_theme_color_override("font_color", theme_cache.error_color); tool_select->set_icon(theme_cache.tool_icon_select); diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index 2ce4fa77880..12496aa8564 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -127,7 +127,7 @@ EditorAssetLibraryItem::EditorAssetLibraryItem(bool p_clickable) { Ref border; border.instantiate(); border->set_content_margin_all(5 * EDSCALE); - add_theme_style_override("panel", border); + add_theme_style_override(SceneStringName(panel), border); HBoxContainer *hb = memnew(HBoxContainer); // Add some spacing to visually separate the icon from the asset details. @@ -240,7 +240,7 @@ void EditorAssetLibraryItemDescription::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: case NOTIFICATION_THEME_CHANGED: { - previews_bg->add_theme_style_override("panel", previews->get_theme_stylebox(CoreStringName(normal), SNAME("TextEdit"))); + previews_bg->add_theme_style_override(SceneStringName(panel), previews->get_theme_stylebox(CoreStringName(normal), SNAME("TextEdit"))); } break; } } @@ -456,7 +456,7 @@ void EditorAssetLibraryItemDownload::configure(const String &p_title, int p_asse void EditorAssetLibraryItemDownload::_notification(int p_what) { switch (p_what) { case NOTIFICATION_THEME_CHANGED: { - panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("AssetLib"))); + panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("AssetLib"))); status->add_theme_color_override("font_color", get_theme_color(SNAME("status_color"), SNAME("AssetLib"))); dismiss_button->set_texture_normal(get_theme_icon(SNAME("dismiss"), SNAME("AssetLib"))); } break; @@ -631,7 +631,7 @@ EditorAssetLibraryItemDownload::EditorAssetLibraryItemDownload() { void EditorAssetLibrary::_notification(int p_what) { switch (p_what) { case NOTIFICATION_READY: { - add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("AssetLib"))); + add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SNAME("bg"), SNAME("AssetLib"))); error_label->move_to_front(); } break; @@ -639,8 +639,8 @@ void EditorAssetLibrary::_notification(int p_what) { case NOTIFICATION_THEME_CHANGED: { error_tr->set_texture(get_editor_theme_icon(SNAME("Error"))); filter->set_right_icon(get_editor_theme_icon(SNAME("Search"))); - library_scroll_bg->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("Tree"))); - downloads_scroll->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("Tree"))); + library_scroll_bg->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("Tree"))); + downloads_scroll->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("Tree"))); error_label->add_theme_color_override("color", get_theme_color(SNAME("error_color"), EditorStringName(Editor))); } break; @@ -1698,7 +1698,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { PanelContainer *library_vb_border = memnew(PanelContainer); library_scroll->add_child(library_vb_border); - library_vb_border->add_theme_style_override("panel", border2); + library_vb_border->add_theme_style_override(SceneStringName(panel), border2); library_vb_border->set_h_size_flags(Control::SIZE_EXPAND_FILL); library_vb = memnew(VBoxContainer); diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 645565bb7e9..5c7d02dcfa7 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -3952,7 +3952,7 @@ void CanvasItemEditor::_update_editor_settings() { key_auto_insert_button->add_theme_color_override("icon_pressed_color", key_auto_color.lerp(Color(1, 0, 0), 0.55)); animation_menu->set_icon(get_editor_theme_icon(SNAME("GuiTabMenuHl"))); - context_toolbar_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("ContextualToolbar"), EditorStringName(EditorStyles))); + context_toolbar_panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SNAME("ContextualToolbar"), EditorStringName(EditorStyles))); panner->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/2d_editor_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EDITOR_GET("editors/panning/simple_panning"))); panner->set_scroll_speed(EDITOR_GET("editors/panning/2d_editor_pan_speed")); diff --git a/editor/plugins/control_editor_plugin.cpp b/editor/plugins/control_editor_plugin.cpp index 1d5b0a832a4..a3804eff005 100644 --- a/editor/plugins/control_editor_plugin.cpp +++ b/editor/plugins/control_editor_plugin.cpp @@ -65,7 +65,7 @@ void ControlPositioningWarning::_update_warning() { hint_label->set_text(TTR("Use anchors and the rectangle for positioning.")); } - bg_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg_group_note"), SNAME("EditorProperty"))); + bg_panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SNAME("bg_group_note"), SNAME("EditorProperty"))); } void ControlPositioningWarning::_update_toggler() { diff --git a/editor/plugins/curve_editor_plugin.cpp b/editor/plugins/curve_editor_plugin.cpp index eb9442fdee1..278543dc36f 100644 --- a/editor/plugins/curve_editor_plugin.cpp +++ b/editor/plugins/curve_editor_plugin.cpp @@ -788,7 +788,7 @@ void CurveEdit::_redraw() { // Draw background. Vector2 view_size = get_rect().size; - draw_style_box(get_theme_stylebox(SNAME("panel"), SNAME("Tree")), Rect2(Point2(), view_size)); + draw_style_box(get_theme_stylebox(SceneStringName(panel), SNAME("Tree")), Rect2(Point2(), view_size)); // Draw snapping grid, then primary grid. draw_set_transform_matrix(_world_to_view); diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 9c7740a1e27..682fbb5da51 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -3065,7 +3065,7 @@ void Node3DEditorViewport::_notification(int p_what) { info_label->add_theme_style_override("normal", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles))); - frame_time_panel->add_theme_style_override("panel", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles))); + frame_time_panel->add_theme_style_override(SceneStringName(panel), gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles))); // Set a minimum width to prevent the width from changing all the time // when numbers vary rapidly. This minimum width is set based on a // GPU time of 999.99 ms in the current editor language. @@ -7809,7 +7809,7 @@ void Node3DEditor::_update_theme() { environ_sky_color->set_custom_minimum_size(Size2(0, get_theme_constant(SNAME("color_picker_button_height"), EditorStringName(Editor)))); environ_ground_color->set_custom_minimum_size(Size2(0, get_theme_constant(SNAME("color_picker_button_height"), EditorStringName(Editor)))); - context_toolbar_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("ContextualToolbar"), EditorStringName(EditorStyles))); + context_toolbar_panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SNAME("ContextualToolbar"), EditorStringName(EditorStyles))); } void Node3DEditor::_notification(int p_what) { diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp index c0529ca3bc9..61bd21db671 100644 --- a/editor/plugins/polygon_2d_editor_plugin.cpp +++ b/editor/plugins/polygon_2d_editor_plugin.cpp @@ -113,8 +113,8 @@ void Polygon2DEditor::_notification(int p_what) { [[fallthrough]]; } case NOTIFICATION_THEME_CHANGED: { - uv_edit_draw->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("Tree"))); - bone_scroll->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("Tree"))); + uv_edit_draw->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("Tree"))); + bone_scroll->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("Tree"))); } break; case NOTIFICATION_VISIBILITY_CHANGED: { diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index de9b6ae15f8..d3003376b45 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -1719,7 +1719,7 @@ void ScriptEditor::_notification(int p_what) { case NOTIFICATION_TRANSLATION_CHANGED: case NOTIFICATION_LAYOUT_DIRECTION_CHANGED: case NOTIFICATION_THEME_CHANGED: { - tab_container->add_theme_style_override("panel", get_theme_stylebox(SNAME("ScriptEditor"), EditorStringName(EditorStyles))); + tab_container->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SNAME("ScriptEditor"), EditorStringName(EditorStyles))); help_search->set_icon(get_editor_theme_icon(SNAME("HelpSearch"))); site_search->set_icon(get_editor_theme_icon(SNAME("ExternalLink"))); @@ -1748,7 +1748,7 @@ void ScriptEditor::_notification(int p_what) { case NOTIFICATION_READY: { // Can't set own styles in NOTIFICATION_THEME_CHANGED, so for now this will do. - add_theme_style_override("panel", get_theme_stylebox(SNAME("ScriptEditorPanel"), EditorStringName(EditorStyles))); + add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SNAME("ScriptEditorPanel"), EditorStringName(EditorStyles))); get_tree()->connect("tree_changed", callable_mp(this, &ScriptEditor::_tree_changed)); InspectorDock::get_singleton()->connect("request_help", callable_mp(this, &ScriptEditor::_help_class_open)); @@ -4356,9 +4356,9 @@ void ScriptEditorPlugin::_save_last_editor(const String &p_editor) { void ScriptEditorPlugin::_window_visibility_changed(bool p_visible) { _focus_another_editor(); if (p_visible) { - script_editor->add_theme_style_override("panel", script_editor->get_theme_stylebox("ScriptEditorPanelFloating", EditorStringName(EditorStyles))); + script_editor->add_theme_style_override(SceneStringName(panel), script_editor->get_theme_stylebox("ScriptEditorPanelFloating", EditorStringName(EditorStyles))); } else { - script_editor->add_theme_style_override("panel", script_editor->get_theme_stylebox("ScriptEditorPanel", EditorStringName(EditorStyles))); + script_editor->add_theme_style_override(SceneStringName(panel), script_editor->get_theme_stylebox("ScriptEditorPanel", EditorStringName(EditorStyles))); } } diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp index 4c848a463c7..8dc398138ce 100644 --- a/editor/plugins/shader_editor_plugin.cpp +++ b/editor/plugins/shader_editor_plugin.cpp @@ -738,7 +738,7 @@ ShaderEditorPlugin::ShaderEditorPlugin() { main_split->add_child(shader_tabs); Ref empty; empty.instantiate(); - shader_tabs->add_theme_style_override("panel", empty); + shader_tabs->add_theme_style_override(SceneStringName(panel), empty); button = EditorNode::get_bottom_panel()->add_item(TTR("Shader Editor"), window_wrapper, ED_SHORTCUT_AND_COMMAND("bottom_panels/toggle_shader_editor_bottom_panel", TTR("Toggle Shader Editor Bottom Panel"), KeyModifierMask::ALT | Key::S)); diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp index c14336418c9..ae6ec0f7022 100644 --- a/editor/plugins/sprite_frames_editor_plugin.cpp +++ b/editor/plugins/sprite_frames_editor_plugin.cpp @@ -587,7 +587,7 @@ void SpriteFramesEditor::_notification(int p_what) { split_sheet_zoom_out->set_icon(get_editor_theme_icon(SNAME("ZoomLess"))); split_sheet_zoom_reset->set_icon(get_editor_theme_icon(SNAME("ZoomReset"))); split_sheet_zoom_in->set_icon(get_editor_theme_icon(SNAME("ZoomMore"))); - split_sheet_scroll->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("Tree"))); + split_sheet_scroll->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("Tree"))); _update_show_settings(); } break; diff --git a/editor/plugins/text_shader_editor.cpp b/editor/plugins/text_shader_editor.cpp index fb7515f98e5..6c47f3aadba 100644 --- a/editor/plugins/text_shader_editor.cpp +++ b/editor/plugins/text_shader_editor.cpp @@ -1209,7 +1209,7 @@ TextShaderEditor::TextShaderEditor() { hbc->add_child(edit_menu); hbc->add_child(goto_menu); hbc->add_child(help_menu); - hbc->add_theme_style_override("panel", EditorNode::get_singleton()->get_editor_theme()->get_stylebox(SNAME("ScriptEditorPanel"), EditorStringName(EditorStyles))); + hbc->add_theme_style_override(SceneStringName(panel), EditorNode::get_singleton()->get_editor_theme()->get_stylebox(SNAME("ScriptEditorPanel"), EditorStringName(EditorStyles))); VSplitContainer *editor_box = memnew(VSplitContainer); main_container->add_child(editor_box); diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp index 6b90ea79b21..799d7c757d0 100644 --- a/editor/plugins/texture_region_editor_plugin.cpp +++ b/editor/plugins/texture_region_editor_plugin.cpp @@ -842,8 +842,8 @@ void TextureRegionEditor::_notification(int p_what) { } break; case NOTIFICATION_THEME_CHANGED: { - texture_preview->add_theme_style_override("panel", get_theme_stylebox(SNAME("TextureRegionPreviewBG"), EditorStringName(EditorStyles))); - texture_overlay->add_theme_style_override("panel", get_theme_stylebox(SNAME("TextureRegionPreviewFG"), EditorStringName(EditorStyles))); + texture_preview->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SNAME("TextureRegionPreviewBG"), EditorStringName(EditorStyles))); + texture_overlay->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SNAME("TextureRegionPreviewFG"), EditorStringName(EditorStyles))); zoom_out->set_icon(get_editor_theme_icon(SNAME("ZoomLess"))); zoom_reset->set_icon(get_editor_theme_icon(SNAME("ZoomReset"))); diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp index 84895741947..b307832ff6e 100644 --- a/editor/plugins/theme_editor_plugin.cpp +++ b/editor/plugins/theme_editor_plugin.cpp @@ -3670,7 +3670,7 @@ void ThemeEditor::_notification(int p_what) { case NOTIFICATION_THEME_CHANGED: { preview_tabs->add_theme_style_override("tab_selected", get_theme_stylebox(SNAME("ThemeEditorPreviewFG"), EditorStringName(EditorStyles))); preview_tabs->add_theme_style_override("tab_unselected", get_theme_stylebox(SNAME("ThemeEditorPreviewBG"), EditorStringName(EditorStyles))); - preview_tabs_content->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("TabContainerOdd"))); + preview_tabs_content->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("TabContainerOdd"))); add_preview_button->set_icon(get_editor_theme_icon(SNAME("Add"))); } break; diff --git a/editor/plugins/tiles/tile_set_editor.cpp b/editor/plugins/tiles/tile_set_editor.cpp index aca6669f119..a20bd513281 100644 --- a/editor/plugins/tiles/tile_set_editor.cpp +++ b/editor/plugins/tiles/tile_set_editor.cpp @@ -371,7 +371,7 @@ void TileSetEditor::_notification(int p_what) { source_sort_button->set_icon(get_editor_theme_icon(SNAME("Sort"))); sources_advanced_menu_button->set_icon(get_editor_theme_icon(SNAME("GuiTabMenuHl"))); missing_texture_texture = get_editor_theme_icon(SNAME("TileSet")); - expanded_area->add_theme_style_override("panel", get_theme_stylebox("panel", "Tree")); + expanded_area->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), "Tree")); _update_sources_list(); } break; diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index b50b992ffdd..09cf217b93a 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -789,7 +789,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id, bool } // Set the minimum width of a node based on the preview size to avoid a resize when toggling the preview. - Ref graph_node_stylebox = graph->get_theme_stylebox("panel", "GraphNode"); + Ref graph_node_stylebox = graph->get_theme_stylebox(SceneStringName(panel), "GraphNode"); int port_preview_size = EDITOR_GET("editors/visual_editors/visual_shader/port_preview_size"); if (!is_frame && !is_reroute) { node->set_custom_minimum_size(Size2((Math::ceil(graph_node_stylebox->get_minimum_size().width) + port_preview_size) * EDSCALE, 0)); @@ -4929,7 +4929,7 @@ void VisualShaderEditor::_notification(int p_what) { preview_text->add_comment_delimiter("/*", "*/", false); preview_text->add_comment_delimiter("//", "", true); - error_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("Panel"))); + error_panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("Panel"))); error_label->begin_bulk_theme_override(); error_label->add_theme_font_override("font", get_theme_font(SNAME("status_source"), EditorStringName(EditorFonts))); error_label->add_theme_font_size_override("font_size", get_theme_font_size(SNAME("status_source_size"), EditorStringName(EditorFonts))); diff --git a/editor/progress_dialog.cpp b/editor/progress_dialog.cpp index 746b244bed4..406425e9fd2 100644 --- a/editor/progress_dialog.cpp +++ b/editor/progress_dialog.cpp @@ -130,7 +130,7 @@ void ProgressDialog::_popup() { Size2 ms = main->get_combined_minimum_size(); ms.width = MAX(500 * EDSCALE, ms.width); - Ref style = main->get_theme_stylebox(SNAME("panel"), SNAME("PopupMenu")); + Ref style = main->get_theme_stylebox(SceneStringName(panel), SNAME("PopupMenu")); ms += style->get_minimum_size(); main->set_offset(SIDE_LEFT, style->get_margin(SIDE_LEFT)); diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 00aa78f3421..4f22d650310 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -220,8 +220,8 @@ void ProjectManager::_update_theme(bool p_skip_creation) { root_container->add_theme_constant_override("margin_right", top_bar_separation); main_vbox->add_theme_constant_override("separation", top_bar_separation); - background_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("Background"), EditorStringName(EditorStyles))); - main_view_container->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("TabContainer"))); + background_panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SNAME("Background"), EditorStringName(EditorStyles))); + main_view_container->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("TabContainer"))); title_bar_logo->set_icon(get_editor_theme_icon(SNAME("TitleBarLogo"))); @@ -231,7 +231,7 @@ void ProjectManager::_update_theme(bool p_skip_creation) { // Project list. { loading_label->add_theme_font_override("font", get_theme_font(SNAME("bold"), EditorStringName(EditorFonts))); - project_list_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("project_list"), SNAME("ProjectManager"))); + project_list_panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SNAME("project_list"), SNAME("ProjectManager"))); empty_list_create_project->set_icon(get_editor_theme_icon(SNAME("Add"))); empty_list_import_project->set_icon(get_editor_theme_icon(SNAME("Load"))); @@ -273,7 +273,7 @@ void ProjectManager::_update_theme(bool p_skip_creation) { // Asset library popup. if (asset_library) { // Removes extra border margins. - asset_library->add_theme_style_override("panel", memnew(StyleBoxEmpty)); + asset_library->add_theme_style_override(SceneStringName(panel), memnew(StyleBoxEmpty)); } } } diff --git a/editor/project_manager/quick_settings_dialog.cpp b/editor/project_manager/quick_settings_dialog.cpp index 63fe423b1f4..c9a43f863e2 100644 --- a/editor/project_manager/quick_settings_dialog.cpp +++ b/editor/project_manager/quick_settings_dialog.cpp @@ -181,7 +181,7 @@ void QuickSettingsDialog::update_size_limits(const Size2 &p_max_popup_size) { void QuickSettingsDialog::_notification(int p_what) { switch (p_what) { case NOTIFICATION_THEME_CHANGED: { - settings_list_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("Background"), EditorStringName(EditorStyles))); + settings_list_panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SNAME("Background"), EditorStringName(EditorStyles))); restart_required_label->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), EditorStringName(Editor))); custom_theme_label->add_theme_color_override("font_color", get_theme_color(SNAME("font_placeholder_color"), EditorStringName(Editor))); diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index dc9d1df4e83..cf1ad36adca 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -587,7 +587,7 @@ void ProjectSettingsEditor::_update_theme() { del_button->set_icon(get_editor_theme_icon(SNAME("Remove"))); search_box->set_right_icon(get_editor_theme_icon(SNAME("Search"))); restart_close_button->set_icon(get_editor_theme_icon(SNAME("Close"))); - restart_container->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("Tree"))); + restart_container->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("Tree"))); restart_icon->set_texture(get_editor_theme_icon(SNAME("StatusWarning"))); restart_label->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), EditorStringName(Editor))); diff --git a/editor/renames_map_3_to_4.cpp b/editor/renames_map_3_to_4.cpp index c1d19fdd381..8eab3fbea96 100644 --- a/editor/renames_map_3_to_4.cpp +++ b/editor/renames_map_3_to_4.cpp @@ -1046,7 +1046,7 @@ const char *RenamesMap3To4::gdscript_properties_renames[][2] = { // make sure to add it to the C# rename map too. // Too common words, users may use these names for variables or in comments. - // { "bg", "panel" }, // Theme + // { "bg", SceneStringName(panel) }, // Theme // { "alt", "alt_pressed" }, // InputEventWithModifiers // { "command", "command_pressed" }, // InputEventWithModifiers // { "control", "ctrl_pressed" }, // InputEventWithModifiers diff --git a/editor/themes/editor_theme_manager.cpp b/editor/themes/editor_theme_manager.cpp index d56094b0f37..bff5981ced6 100644 --- a/editor/themes/editor_theme_manager.cpp +++ b/editor/themes/editor_theme_manager.cpp @@ -675,10 +675,10 @@ void EditorThemeManager::_populate_standard_styles(const Ref &p_the // Panels. { // Panel. - p_theme->set_stylebox("panel", "Panel", make_flat_stylebox(p_config.dark_color_1, 6, 4, 6, 4, p_config.corner_radius)); + p_theme->set_stylebox(SceneStringName(panel), "Panel", make_flat_stylebox(p_config.dark_color_1, 6, 4, 6, 4, p_config.corner_radius)); // PanelContainer. - p_theme->set_stylebox("panel", "PanelContainer", p_config.panel_container_style); + p_theme->set_stylebox(SceneStringName(panel), "PanelContainer", p_config.panel_container_style); // TooltipPanel & TooltipLabel. { @@ -693,11 +693,11 @@ void EditorThemeManager::_populate_standard_styles(const Ref &p_the style_tooltip->set_content_margin_all(p_config.base_margin * EDSCALE * 0.5); style_tooltip->set_bg_color(p_config.dark_color_3 * Color(0.8, 0.8, 0.8, 0.9)); style_tooltip->set_border_width_all(0); - p_theme->set_stylebox("panel", "TooltipPanel", style_tooltip); + p_theme->set_stylebox(SceneStringName(panel), "TooltipPanel", style_tooltip); } // PopupPanel - p_theme->set_stylebox("panel", "PopupPanel", p_config.popup_style); + p_theme->set_stylebox(SceneStringName(panel), "PopupPanel", p_config.popup_style); } // Buttons. @@ -926,7 +926,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref &p_the p_theme->set_icon("updown", "Tree", p_theme->get_icon(SNAME("GuiTreeUpdown"), EditorStringName(EditorIcons))); p_theme->set_icon("select_arrow", "Tree", p_theme->get_icon(SNAME("GuiDropdown"), EditorStringName(EditorIcons))); - p_theme->set_stylebox("panel", "Tree", p_config.tree_panel_style); + p_theme->set_stylebox(SceneStringName(panel), "Tree", p_config.tree_panel_style); p_theme->set_stylebox("focus", "Tree", p_config.button_style_focus); p_theme->set_stylebox("custom_button", "Tree", make_empty_stylebox()); p_theme->set_stylebox("custom_button_pressed", "Tree", make_empty_stylebox()); @@ -1029,7 +1029,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref &p_the style_itemlist_hover->set_bg_color(p_config.highlight_color * Color(1, 1, 1, 0.3)); style_itemlist_hover->set_border_width_all(0); - p_theme->set_stylebox("panel", "ItemList", style_itemlist_bg); + p_theme->set_stylebox(SceneStringName(panel), "ItemList", style_itemlist_bg); p_theme->set_stylebox("focus", "ItemList", p_config.button_style_focus); p_theme->set_stylebox("cursor", "ItemList", style_itemlist_cursor); p_theme->set_stylebox("cursor_unfocused", "ItemList", style_itemlist_cursor); @@ -1100,7 +1100,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref &p_the style_tabbar_background->set_corner_radius(CORNER_BOTTOM_LEFT, 0); style_tabbar_background->set_corner_radius(CORNER_BOTTOM_RIGHT, 0); p_theme->set_stylebox("tabbar_background", "TabContainer", style_tabbar_background); - p_theme->set_stylebox("panel", "TabContainer", p_config.content_panel_style); + p_theme->set_stylebox(SceneStringName(panel), "TabContainer", p_config.content_panel_style); p_theme->set_stylebox("tab_selected", "TabContainer", style_tab_selected); p_theme->set_stylebox("tab_hovered", "TabContainer", style_tab_hovered); @@ -1274,7 +1274,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref &p_the p_theme->set_font_size("title_font_size", "Window", p_theme->get_font_size(SNAME("title_size"), EditorStringName(EditorFonts))); // AcceptDialog. - p_theme->set_stylebox("panel", "AcceptDialog", p_config.dialog_style); + p_theme->set_stylebox(SceneStringName(panel), "AcceptDialog", p_config.dialog_style); p_theme->set_constant("buttons_separation", "AcceptDialog", 8 * EDSCALE); // Make buttons with short texts such as "OK" easier to click/tap. p_theme->set_constant("buttons_min_width", "AcceptDialog", p_config.dialogs_buttons_min_size.x * EDSCALE); @@ -1294,7 +1294,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref &p_the p_theme->set_color("file_disabled_color", "FileDialog", p_config.font_disabled_color); // PopupDialog. - p_theme->set_stylebox("panel", "PopupDialog", p_config.popup_style); + p_theme->set_stylebox(SceneStringName(panel), "PopupDialog", p_config.popup_style); // PopupMenu. { @@ -1310,7 +1310,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref &p_the } else { style_popup_menu->set_border_color(p_config.dark_color_2); } - p_theme->set_stylebox("panel", "PopupMenu", style_popup_menu); + p_theme->set_stylebox(SceneStringName(panel), "PopupMenu", style_popup_menu); Ref style_menu_hover = p_config.button_style_hover->duplicate(); // Don't use rounded corners for hover highlights since the StyleBox touches the PopupMenu's edges. @@ -1473,7 +1473,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref &p_the { // GraphEdit. - p_theme->set_stylebox("panel", "GraphEdit", p_config.tree_panel_style); + p_theme->set_stylebox(SceneStringName(panel), "GraphEdit", p_config.tree_panel_style); p_theme->set_stylebox("menu_panel", "GraphEdit", make_flat_stylebox(p_config.dark_color_1 * Color(1, 1, 1, 0.6), 4, 2, 4, 2, 3)); float grid_base_brightness = p_config.dark_theme ? 1.0 : 0.0; @@ -1513,7 +1513,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref &p_the Ref style_minimap_bg = make_flat_stylebox(p_config.dark_color_1, 0, 0, 0, 0); style_minimap_bg->set_border_color(p_config.dark_color_3); style_minimap_bg->set_border_width_all(1); - p_theme->set_stylebox("panel", "GraphEditMinimap", style_minimap_bg); + p_theme->set_stylebox(SceneStringName(panel), "GraphEditMinimap", style_minimap_bg); Ref style_minimap_camera; Ref style_minimap_node; @@ -1590,7 +1590,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref &p_the // GraphElement. - p_theme->set_stylebox("panel", "GraphElement", gn_panel_style); + p_theme->set_stylebox(SceneStringName(panel), "GraphElement", gn_panel_style); p_theme->set_stylebox("panel_selected", "GraphElement", gn_panel_selected_style); p_theme->set_stylebox("titlebar", "GraphElement", gn_titlebar_style); p_theme->set_stylebox("titlebar_selected", "GraphElement", gn_titlebar_selected_style); @@ -1602,7 +1602,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref &p_the Ref gn_slot_style = make_empty_stylebox(12, 0, 12, 0); - p_theme->set_stylebox("panel", "GraphNode", gn_panel_style); + p_theme->set_stylebox(SceneStringName(panel), "GraphNode", gn_panel_style); p_theme->set_stylebox("panel_selected", "GraphNode", gn_panel_selected_style); p_theme->set_stylebox("titlebar", "GraphNode", gn_titlebar_style); p_theme->set_stylebox("titlebar_selected", "GraphNode", gn_titlebar_selected_style); @@ -1644,7 +1644,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref &p_the Ref graphframe_sb_selected = graphframe_sb->duplicate(); graphframe_sb_selected->set_border_color(gn_selected_border_color); - p_theme->set_stylebox("panel", "GraphFrame", graphframe_sb); + p_theme->set_stylebox(SceneStringName(panel), "GraphFrame", graphframe_sb); p_theme->set_stylebox("panel_selected", "GraphFrame", graphframe_sb_selected); p_theme->set_stylebox("titlebar", "GraphFrame", make_empty_stylebox(4, 4, 4, 4)); p_theme->set_stylebox("titlebar_selected", "GraphFrame", make_empty_stylebox(4, 4, 4, 4)); @@ -1669,7 +1669,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref &p_the Ref vs_reroute_panel_style = make_empty_stylebox(); Ref vs_reroute_titlebar_style = vs_reroute_panel_style->duplicate(); vs_reroute_titlebar_style->set_content_margin_all(16); - p_theme->set_stylebox("panel", "VSRerouteNode", vs_reroute_panel_style); + p_theme->set_stylebox(SceneStringName(panel), "VSRerouteNode", vs_reroute_panel_style); p_theme->set_stylebox("panel_selected", "VSRerouteNode", vs_reroute_panel_style); p_theme->set_stylebox("titlebar", "VSRerouteNode", vs_reroute_titlebar_style); p_theme->set_stylebox("titlebar_selected", "VSRerouteNode", vs_reroute_titlebar_style); @@ -1969,9 +1969,9 @@ void EditorThemeManager::_populate_editor_styles(const Ref &p_theme Ref style_complex_window = p_config.window_style->duplicate(); style_complex_window->set_bg_color(p_config.dark_color_2); style_complex_window->set_border_color(p_config.dark_color_2); - p_theme->set_stylebox("panel", "EditorSettingsDialog", style_complex_window); - p_theme->set_stylebox("panel", "ProjectSettingsEditor", style_complex_window); - p_theme->set_stylebox("panel", "EditorAbout", style_complex_window); + p_theme->set_stylebox(SceneStringName(panel), "EditorSettingsDialog", style_complex_window); + p_theme->set_stylebox(SceneStringName(panel), "ProjectSettingsEditor", style_complex_window); + p_theme->set_stylebox(SceneStringName(panel), "EditorAbout", style_complex_window); } // InspectorActionButton. @@ -2033,11 +2033,11 @@ void EditorThemeManager::_populate_editor_styles(const Ref &p_theme Ref style_content_panel_odd = p_config.content_panel_style->duplicate(); style_content_panel_odd->set_bg_color(p_config.disabled_bg_color); - p_theme->set_stylebox("panel", "TabContainerOdd", style_content_panel_odd); + p_theme->set_stylebox(SceneStringName(panel), "TabContainerOdd", style_content_panel_odd); } // EditorValidationPanel. - p_theme->set_stylebox("panel", "EditorValidationPanel", p_config.tree_panel_style); + p_theme->set_stylebox(SceneStringName(panel), "EditorValidationPanel", p_config.tree_panel_style); // ControlEditor. { @@ -2051,7 +2051,7 @@ void EditorThemeManager::_populate_editor_styles(const Ref &p_theme control_editor_popup_style->set_content_margin(SIDE_BOTTOM, p_config.base_margin * EDSCALE); control_editor_popup_style->set_border_width_all(0); - p_theme->set_stylebox("panel", "ControlEditorPopupPanel", control_editor_popup_style); + p_theme->set_stylebox(SceneStringName(panel), "ControlEditorPopupPanel", control_editor_popup_style); } } @@ -2247,7 +2247,7 @@ void EditorThemeManager::_populate_editor_styles(const Ref &p_theme // Asset Library. p_theme->set_stylebox("bg", "AssetLib", p_config.base_empty_style); - p_theme->set_stylebox("panel", "AssetLib", p_config.content_panel_style); + p_theme->set_stylebox(SceneStringName(panel), "AssetLib", p_config.content_panel_style); p_theme->set_color("status_color", "AssetLib", Color(0.5, 0.5, 0.5)); // FIXME: Use a defined color instead. p_theme->set_icon("dismiss", "AssetLib", p_theme->get_icon(SNAME("Close"), EditorStringName(EditorIcons))); @@ -2261,7 +2261,7 @@ void EditorThemeManager::_populate_editor_styles(const Ref &p_theme // FIXME: Introduce Theme::get_font_height() / Control::get_theme_font_height() / Window::get_theme_font_height(). const int offset_i1 = p_theme->get_font(SNAME("tab_selected"), SNAME("TabContainer"))->get_height(p_theme->get_font_size(SNAME("tab_selected"), SNAME("TabContainer"))); const int offset_i2 = p_theme->get_stylebox(SNAME("tab_selected"), SNAME("TabContainer"))->get_minimum_size().height; - const int offset_i3 = p_theme->get_stylebox(SNAME("panel"), SNAME("TabContainer"))->get_content_margin(SIDE_TOP); + const int offset_i3 = p_theme->get_stylebox(SceneStringName(panel), SNAME("TabContainer"))->get_content_margin(SIDE_TOP); const int invisible_top_offset = offset_i1 + offset_i2 + offset_i3; Ref invisible_top_panel_style = p_config.content_panel_style->duplicate(); @@ -2308,7 +2308,7 @@ void EditorThemeManager::_populate_editor_styles(const Ref &p_theme // StateMachine graph. { - p_theme->set_stylebox("panel", "GraphStateMachine", p_config.tree_panel_style); + p_theme->set_stylebox(SceneStringName(panel), "GraphStateMachine", p_config.tree_panel_style); p_theme->set_stylebox("error_panel", "GraphStateMachine", p_config.tree_panel_style); p_theme->set_color("error_color", "GraphStateMachine", p_config.error_color); @@ -2554,7 +2554,7 @@ void EditorThemeManager::_populate_visual_shader_styles(const Ref & ed_settings->set_initial_value("editors/visual_editors/connection_colors/sampler_color", Color(1.0, 1.0, 0.0), true); // Node category colors (used for the node headers) - Ref gn_panel_style = p_theme->get_stylebox("panel", "GraphNode"); + Ref gn_panel_style = p_theme->get_stylebox(SceneStringName(panel), "GraphNode"); Color gn_bg_color = gn_panel_style->get_bg_color(); ed_settings->set_initial_value("editors/visual_editors/category_colors/output_color", gn_bg_color, true); ed_settings->set_initial_value("editors/visual_editors/category_colors/color_color", gn_bg_color, true); diff --git a/editor/window_wrapper.cpp b/editor/window_wrapper.cpp index b964a072859..b75d6415093 100644 --- a/editor/window_wrapper.cpp +++ b/editor/window_wrapper.cpp @@ -152,7 +152,7 @@ void WindowWrapper::_notification(int p_what) { set_process_shortcut_input(true); } break; case NOTIFICATION_THEME_CHANGED: { - window_background->add_theme_style_override("panel", get_theme_stylebox("PanelForeground", EditorStringName(EditorStyles))); + window_background->add_theme_style_override(SceneStringName(panel), get_theme_stylebox("PanelForeground", EditorStringName(EditorStyles))); } break; } } @@ -391,7 +391,7 @@ void ScreenSelect::_notification(int p_what) { } break; case NOTIFICATION_THEME_CHANGED: { set_icon(get_editor_theme_icon("MakeFloating")); - popup_background->add_theme_style_override("panel", get_theme_stylebox("PanelForeground", EditorStringName(EditorStyles))); + popup_background->add_theme_style_override(SceneStringName(panel), get_theme_stylebox("PanelForeground", EditorStringName(EditorStyles))); const real_t popup_height = real_t(get_theme_font_size("font_size")) * 2.0; popup->set_min_size(Size2(0, popup_height * 3)); diff --git a/modules/multiplayer/editor/replication_editor.cpp b/modules/multiplayer/editor/replication_editor.cpp index 3cc0a5ae53e..b28572cf72d 100644 --- a/modules/multiplayer/editor/replication_editor.cpp +++ b/modules/multiplayer/editor/replication_editor.cpp @@ -372,7 +372,7 @@ void ReplicationEditor::_notification(int p_what) { [[fallthrough]]; } case NOTIFICATION_ENTER_TREE: { - add_theme_style_override("panel", EditorNode::get_singleton()->get_editor_theme()->get_stylebox(SNAME("panel"), SNAME("Panel"))); + add_theme_style_override(SceneStringName(panel), EditorNode::get_singleton()->get_editor_theme()->get_stylebox(SceneStringName(panel), SNAME("Panel"))); add_pick_button->set_icon(get_theme_icon(SNAME("Add"), EditorStringName(EditorIcons))); pin->set_icon(get_theme_icon(SNAME("Pin"), EditorStringName(EditorIcons))); } break; diff --git a/modules/openxr/editor/openxr_action_map_editor.cpp b/modules/openxr/editor/openxr_action_map_editor.cpp index 62b4a427b91..937973f3887 100644 --- a/modules/openxr/editor/openxr_action_map_editor.cpp +++ b/modules/openxr/editor/openxr_action_map_editor.cpp @@ -59,7 +59,7 @@ void OpenXRActionMapEditor::_notification(int p_what) { for (int i = 0; i < tabs->get_child_count(); i++) { Control *tab = Object::cast_to(tabs->get_child(i)); if (tab) { - tab->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("Tree"))); + tab->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("Tree"))); } } } break; @@ -110,7 +110,7 @@ OpenXRInteractionProfileEditorBase *OpenXRActionMapEditor::_add_interaction_prof // now add it in.. ERR_FAIL_NULL_V(new_profile_editor, nullptr); tabs->add_child(new_profile_editor); - new_profile_editor->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("Tree"))); + new_profile_editor->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("Tree"))); tabs->set_tab_button_icon(tabs->get_tab_count() - 1, get_theme_icon(SNAME("close"), SNAME("TabBar"))); return new_profile_editor; diff --git a/modules/openxr/editor/openxr_action_set_editor.cpp b/modules/openxr/editor/openxr_action_set_editor.cpp index 5d9a3155fb5..e2a843a051e 100644 --- a/modules/openxr/editor/openxr_action_set_editor.cpp +++ b/modules/openxr/editor/openxr_action_set_editor.cpp @@ -63,7 +63,7 @@ void OpenXRActionSetEditor::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: case NOTIFICATION_THEME_CHANGED: { _theme_changed(); - panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("TabContainer"))); + panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("TabContainer"))); } break; } } diff --git a/modules/openxr/editor/openxr_interaction_profile_editor.cpp b/modules/openxr/editor/openxr_interaction_profile_editor.cpp index ab36c0744e9..651171358cb 100644 --- a/modules/openxr/editor/openxr_interaction_profile_editor.cpp +++ b/modules/openxr/editor/openxr_interaction_profile_editor.cpp @@ -285,7 +285,7 @@ void OpenXRInteractionProfileEditor::_update_interaction_profile() { PanelContainer *panel = memnew(PanelContainer); panel->set_v_size_flags(Control::SIZE_EXPAND_FILL); main_hb->add_child(panel); - panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("TabContainer"))); + panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("TabContainer"))); VBoxContainer *container = memnew(VBoxContainer); panel->add_child(container); @@ -310,7 +310,7 @@ void OpenXRInteractionProfileEditor::_theme_changed() { for (int i = 0; i < main_hb->get_child_count(); i++) { Control *panel = Object::cast_to(main_hb->get_child(i)); if (panel) { - panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("TabContainer"))); + panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("TabContainer"))); } } } diff --git a/modules/openxr/editor/openxr_select_action_dialog.cpp b/modules/openxr/editor/openxr_select_action_dialog.cpp index de0ab40f9eb..a4ccc98408a 100644 --- a/modules/openxr/editor/openxr_select_action_dialog.cpp +++ b/modules/openxr/editor/openxr_select_action_dialog.cpp @@ -38,7 +38,7 @@ void OpenXRSelectActionDialog::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: case NOTIFICATION_THEME_CHANGED: { - scroll->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("Tree"))); + scroll->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("Tree"))); } break; } } diff --git a/modules/openxr/editor/openxr_select_interaction_profile_dialog.cpp b/modules/openxr/editor/openxr_select_interaction_profile_dialog.cpp index e6705d5c822..53b8cbd4016 100644 --- a/modules/openxr/editor/openxr_select_interaction_profile_dialog.cpp +++ b/modules/openxr/editor/openxr_select_interaction_profile_dialog.cpp @@ -38,7 +38,7 @@ void OpenXRSelectInteractionProfileDialog::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: case NOTIFICATION_THEME_CHANGED: { - scroll->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("Tree"))); + scroll->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("Tree"))); } break; } } diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index 622ab79155b..89136506890 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -1560,7 +1560,7 @@ void ColorPicker::_pick_button_pressed_legacy() { picker_preview_style_box = (Ref)memnew(StyleBoxFlat); picker_preview_style_box->set_bg_color(Color(1.0, 1.0, 1.0)); - picker_preview->add_theme_style_override("panel", picker_preview_style_box); + picker_preview->add_theme_style_override(SceneStringName(panel), picker_preview_style_box); } Rect2i screen_rect; diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp index 3d8be38fbd2..088c8fca26c 100644 --- a/scene/gui/dialogs.cpp +++ b/scene/gui/dialogs.cpp @@ -88,7 +88,7 @@ void AcceptDialog::_notification(int p_what) { } break; case NOTIFICATION_THEME_CHANGED: { - bg_panel->add_theme_style_override("panel", theme_cache.panel_style); + bg_panel->add_theme_style_override(SceneStringName(panel), theme_cache.panel_style); child_controls_changed(); if (is_visible()) { diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index 6c2a61d2553..e725bb5ba5c 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -717,7 +717,7 @@ void GraphEdit::_notification(int p_what) { zoom_label->set_custom_minimum_size(Size2(48, 0) * theme_cache.base_scale); - menu_panel->add_theme_style_override("panel", theme_cache.menu_panel); + menu_panel->add_theme_style_override(SceneStringName(panel), theme_cache.menu_panel); } break; case NOTIFICATION_READY: { Size2 hmin = h_scrollbar->get_combined_minimum_size(); @@ -1536,7 +1536,7 @@ void GraphEdit::_minimap_draw() { Ref sb_minimap = minimap->theme_cache.node_style->duplicate(); // Override default values with colors provided by the GraphNode's stylebox, if possible. - Ref sb_frame = graph_frame->get_theme_stylebox(graph_frame->is_selected() ? SNAME("panel_selected") : SNAME("panel")); + Ref sb_frame = graph_frame->get_theme_stylebox(graph_frame->is_selected() ? SNAME("panel_selected") : SceneStringName(panel)); if (sb_frame.is_valid()) { Color node_color = sb_frame->get_bg_color(); if (graph_frame->is_tint_color_enabled()) { diff --git a/scene/gui/popup.cpp b/scene/gui/popup.cpp index 38204af6d59..10fadeeba1e 100644 --- a/scene/gui/popup.cpp +++ b/scene/gui/popup.cpp @@ -271,7 +271,7 @@ void PopupPanel::_notification(int p_what) { switch (p_what) { case NOTIFICATION_READY: case NOTIFICATION_THEME_CHANGED: { - panel->add_theme_style_override("panel", theme_cache.panel_style); + panel->add_theme_style_override(SceneStringName(panel), theme_cache.panel_style); _update_child_rects(); } break; diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index 207cf3df893..4f07fdb87b9 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -1026,7 +1026,7 @@ void PopupMenu::_notification(int p_what) { } break; case NOTIFICATION_THEME_CHANGED: { - scroll_container->add_theme_style_override("panel", theme_cache.panel_style); + scroll_container->add_theme_style_override(SceneStringName(panel), theme_cache.panel_style); [[fallthrough]]; } diff --git a/scene/scene_string_names.cpp b/scene/scene_string_names.cpp index 7ce60028934..c6a2151de56 100644 --- a/scene/scene_string_names.cpp +++ b/scene/scene_string_names.cpp @@ -129,4 +129,6 @@ SceneStringNames::SceneStringNames() { pressed = StaticCString::create("pressed"); id_pressed = StaticCString::create("id_pressed"); + + panel = StaticCString::create("panel"); } diff --git a/scene/scene_string_names.h b/scene/scene_string_names.h index d76d69e12f2..9af54223911 100644 --- a/scene/scene_string_names.h +++ b/scene/scene_string_names.h @@ -142,6 +142,8 @@ public: StringName pressed; StringName id_pressed; + + StringName panel; }; #define SceneStringName(m_name) SceneStringNames::get_singleton()->m_name diff --git a/scene/theme/default_theme.cpp b/scene/theme/default_theme.cpp index aa4d6692386..630a6a43e07 100644 --- a/scene/theme/default_theme.cpp +++ b/scene/theme/default_theme.cpp @@ -147,7 +147,7 @@ void fill_default_theme(Ref &theme, const Ref &default_font, const } // Panel - theme->set_stylebox("panel", "Panel", make_flat_stylebox(style_normal_color, 0, 0, 0, 0)); + theme->set_stylebox(SceneStringName(panel), "Panel", make_flat_stylebox(style_normal_color, 0, 0, 0, 0)); // Button @@ -617,7 +617,7 @@ void fill_default_theme(Ref &theme, const Ref &default_font, const Ref empty; empty.instantiate(); - theme->set_stylebox("panel", "ScrollContainer", empty); + theme->set_stylebox(SceneStringName(panel), "ScrollContainer", empty); // Window @@ -640,7 +640,7 @@ void fill_default_theme(Ref &theme, const Ref &default_font, const // Dialogs // AcceptDialog is currently the base dialog, so this defines styles for all extending nodes. - theme->set_stylebox("panel", "AcceptDialog", make_flat_stylebox(style_popup_color, Math::round(8 * scale), Math::round(8 * scale), Math::round(8 * scale), Math::round(8 * scale), 0)); + theme->set_stylebox(SceneStringName(panel), "AcceptDialog", make_flat_stylebox(style_popup_color, Math::round(8 * scale), Math::round(8 * scale), Math::round(8 * scale), Math::round(8 * scale), 0)); theme->set_constant("buttons_separation", "AcceptDialog", Math::round(10 * scale)); // File Dialog @@ -659,11 +659,11 @@ void fill_default_theme(Ref &theme, const Ref &default_font, const // Popup - theme->set_stylebox("panel", "PopupPanel", make_flat_stylebox(style_normal_color)); + theme->set_stylebox(SceneStringName(panel), "PopupPanel", make_flat_stylebox(style_normal_color)); // PopupDialog - theme->set_stylebox("panel", "PopupDialog", make_flat_stylebox(style_normal_color)); + theme->set_stylebox(SceneStringName(panel), "PopupDialog", make_flat_stylebox(style_normal_color)); // PopupMenu @@ -680,7 +680,7 @@ void fill_default_theme(Ref &theme, const Ref &default_font, const style_popup_panel->set_border_width_all(2); style_popup_panel->set_border_color(style_popup_border_color); - theme->set_stylebox("panel", "PopupMenu", style_popup_panel); + theme->set_stylebox(SceneStringName(panel), "PopupMenu", style_popup_panel); theme->set_stylebox("hover", "PopupMenu", make_flat_stylebox(style_popup_hover_color)); theme->set_stylebox("separator", "PopupMenu", separator_horizontal); theme->set_stylebox("labeled_separator_left", "PopupMenu", separator_horizontal); @@ -731,7 +731,7 @@ void fill_default_theme(Ref &theme, const Ref &default_font, const graphn_sb_titlebar_selected->set_bg_color(Color(1.0, 0.625, 0.625, 0.6)); Ref graphnode_slot = make_empty_stylebox(0, 0, 0, 0); - theme->set_stylebox("panel", "GraphNode", graphnode_normal); + theme->set_stylebox(SceneStringName(panel), "GraphNode", graphnode_normal); theme->set_stylebox("panel_selected", "GraphNode", graphnode_selected); theme->set_stylebox("titlebar", "GraphNode", graphn_sb_titlebar); theme->set_stylebox("titlebar_selected", "GraphNode", graphn_sb_titlebar_selected); @@ -766,7 +766,7 @@ void fill_default_theme(Ref &theme, const Ref &default_font, const Ref graphframe_sb_selected = graphframe_sb->duplicate(); graphframe_sb_selected->set_border_color(style_hover_color); - theme->set_stylebox("panel", "GraphFrame", graphframe_sb); + theme->set_stylebox(SceneStringName(panel), "GraphFrame", graphframe_sb); theme->set_stylebox("panel_selected", "GraphFrame", graphframe_sb_selected); theme->set_stylebox("titlebar", "GraphFrame", make_empty_stylebox(4, 4, 4, 4)); theme->set_stylebox("titlebar_selected", "GraphFrame", make_empty_stylebox(4, 4, 4, 4)); @@ -790,7 +790,7 @@ void fill_default_theme(Ref &theme, const Ref &default_font, const // Tree - theme->set_stylebox("panel", "Tree", make_flat_stylebox(style_normal_color, 4, 4, 4, 5)); + theme->set_stylebox(SceneStringName(panel), "Tree", make_flat_stylebox(style_normal_color, 4, 4, 4, 5)); theme->set_stylebox("focus", "Tree", focus); theme->set_stylebox("selected", "Tree", make_flat_stylebox(style_selected_color)); theme->set_stylebox("selected_focus", "Tree", make_flat_stylebox(style_selected_color)); @@ -860,7 +860,7 @@ void fill_default_theme(Ref &theme, const Ref &default_font, const // ItemList - theme->set_stylebox("panel", "ItemList", make_flat_stylebox(style_normal_color)); + theme->set_stylebox(SceneStringName(panel), "ItemList", make_flat_stylebox(style_normal_color)); theme->set_stylebox("focus", "ItemList", focus); theme->set_constant("h_separation", "ItemList", Math::round(4 * scale)); theme->set_constant("v_separation", "ItemList", Math::round(4 * scale)); @@ -904,7 +904,7 @@ void fill_default_theme(Ref &theme, const Ref &default_font, const theme->set_stylebox("tab_unselected", "TabContainer", style_tab_unselected); theme->set_stylebox("tab_disabled", "TabContainer", style_tab_disabled); theme->set_stylebox("tab_focus", "TabContainer", style_tab_focus); - theme->set_stylebox("panel", "TabContainer", make_flat_stylebox(style_normal_color, 0, 0, 0, 0)); + theme->set_stylebox(SceneStringName(panel), "TabContainer", make_flat_stylebox(style_normal_color, 0, 0, 0, 0)); theme->set_stylebox("tabbar_background", "TabContainer", make_empty_stylebox(0, 0, 0, 0)); theme->set_icon("increment", "TabContainer", icons["scroll_button_right"]); @@ -1083,7 +1083,7 @@ void fill_default_theme(Ref &theme, const Ref &default_font, const // TooltipPanel + TooltipLabel theme->set_type_variation("TooltipPanel", "PopupPanel"); - theme->set_stylebox("panel", "TooltipPanel", + theme->set_stylebox(SceneStringName(panel), "TooltipPanel", make_flat_stylebox(Color(0, 0, 0, 0.5), 2 * default_margin, 0.5 * default_margin, 2 * default_margin, 0.5 * default_margin)); theme->set_type_variation("TooltipLabel", "Label"); @@ -1171,7 +1171,7 @@ void fill_default_theme(Ref &theme, const Ref &default_font, const theme->set_constant("h_separation", "VFlowContainer", Math::round(4 * scale)); theme->set_constant("v_separation", "VFlowContainer", Math::round(4 * scale)); - theme->set_stylebox("panel", "PanelContainer", make_flat_stylebox(style_normal_color, 0, 0, 0, 0)); + theme->set_stylebox(SceneStringName(panel), "PanelContainer", make_flat_stylebox(style_normal_color, 0, 0, 0, 0)); theme->set_icon("zoom_out", "GraphEdit", icons["zoom_less"]); theme->set_icon("zoom_in", "GraphEdit", icons["zoom_more"]); @@ -1181,7 +1181,7 @@ void fill_default_theme(Ref &theme, const Ref &default_font, const theme->set_icon("snapping_toggle", "GraphEdit", icons["grid_snap"]); theme->set_icon("layout", "GraphEdit", icons["grid_layout"]); - theme->set_stylebox("panel", "GraphEdit", make_flat_stylebox(style_normal_color, 4, 4, 4, 5)); + theme->set_stylebox(SceneStringName(panel), "GraphEdit", make_flat_stylebox(style_normal_color, 4, 4, 4, 5)); Ref graph_toolbar_style = make_flat_stylebox(Color(0.24, 0.24, 0.24, 0.6), 4, 2, 4, 2); theme->set_stylebox("menu_panel", "GraphEdit", graph_toolbar_style); @@ -1200,7 +1200,7 @@ void fill_default_theme(Ref &theme, const Ref &default_font, const theme->set_constant("port_hotzone_inner_extent", "GraphEdit", 22 * scale); theme->set_constant("port_hotzone_outer_extent", "GraphEdit", 26 * scale); - theme->set_stylebox("panel", "GraphEditMinimap", make_flat_stylebox(Color(0.24, 0.24, 0.24), 0, 0, 0, 0)); + theme->set_stylebox(SceneStringName(panel), "GraphEditMinimap", make_flat_stylebox(Color(0.24, 0.24, 0.24), 0, 0, 0, 0)); Ref style_minimap_camera = make_flat_stylebox(Color(0.65, 0.65, 0.65, 0.2), 0, 0, 0, 0, 0); style_minimap_camera->set_border_color(Color(0.65, 0.65, 0.65, 0.45)); style_minimap_camera->set_border_width_all(1);