Merge pull request #91950 from AThousandShips/panel_sname

[Scene] Add `SceneStringNames::panel`
This commit is contained in:
Rémi Verschelde 2024-05-31 14:16:02 +02:00
commit b201c087ab
No known key found for this signature in database
GPG key ID: C3336907360768E1
55 changed files with 149 additions and 145 deletions

View file

@ -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")));

View file

@ -75,7 +75,7 @@ EditorDebuggerNode::EditorDebuggerNode() {
Ref<StyleBoxEmpty> 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();

View file

@ -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")));

View file

@ -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: {

View file

@ -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")) {

View file

@ -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);

View file

@ -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;
}

View file

@ -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: {

View file

@ -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)));
}

View file

@ -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: {

View file

@ -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);

View file

@ -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)));
}
}

View file

@ -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")));

View file

@ -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);

View file

@ -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);

View file

@ -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")));

View file

@ -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")));

View file

@ -265,7 +265,7 @@ void AnimationNodeBlendTreeEditor::update_graph() {
}
// TODO: Avoid using strings, expose a method on GraphNode instead.
Ref<StyleBoxFlat> sb = node->get_theme_stylebox(SNAME("panel"));
Ref<StyleBoxFlat> 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()) {

View file

@ -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;

View file

@ -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);

View file

@ -127,7 +127,7 @@ EditorAssetLibraryItem::EditorAssetLibraryItem(bool p_clickable) {
Ref<StyleBoxEmpty> 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);

View file

@ -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"));

View file

@ -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() {

View file

@ -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);

View file

@ -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) {

View file

@ -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: {

View file

@ -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)));
}
}

View file

@ -738,7 +738,7 @@ ShaderEditorPlugin::ShaderEditorPlugin() {
main_split->add_child(shader_tabs);
Ref<StyleBoxEmpty> 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));

View file

@ -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;

View file

@ -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);

View file

@ -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")));

View file

@ -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;

View file

@ -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;

View file

@ -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<StyleBoxFlat> graph_node_stylebox = graph->get_theme_stylebox("panel", "GraphNode");
Ref<StyleBoxFlat> 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)));

View file

@ -130,7 +130,7 @@ void ProgressDialog::_popup() {
Size2 ms = main->get_combined_minimum_size();
ms.width = MAX(500 * EDSCALE, ms.width);
Ref<StyleBox> style = main->get_theme_stylebox(SNAME("panel"), SNAME("PopupMenu"));
Ref<StyleBox> style = main->get_theme_stylebox(SceneStringName(panel), SNAME("PopupMenu"));
ms += style->get_minimum_size();
main->set_offset(SIDE_LEFT, style->get_margin(SIDE_LEFT));

View file

@ -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));
}
}
}

View file

@ -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)));

View file

@ -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)));

View file

@ -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

View file

@ -675,10 +675,10 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &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<EditorTheme> &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<EditorTheme> &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<EditorTheme> &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<EditorTheme> &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<EditorTheme> &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<EditorTheme> &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<EditorTheme> &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<StyleBoxFlat> 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<EditorTheme> &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<EditorTheme> &p_the
Ref<StyleBoxFlat> 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<StyleBoxFlat> style_minimap_camera;
Ref<StyleBoxFlat> style_minimap_node;
@ -1590,7 +1590,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &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<EditorTheme> &p_the
Ref<StyleBoxEmpty> 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<EditorTheme> &p_the
Ref<StyleBoxFlat> 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<EditorTheme> &p_the
Ref<StyleBox> vs_reroute_panel_style = make_empty_stylebox();
Ref<StyleBox> 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<EditorTheme> &p_theme
Ref<StyleBoxFlat> 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<EditorTheme> &p_theme
Ref<StyleBoxFlat> 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<EditorTheme> &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<EditorTheme> &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<EditorTheme> &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<StyleBoxFlat> invisible_top_panel_style = p_config.content_panel_style->duplicate();
@ -2308,7 +2308,7 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &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<EditorTheme> &
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<StyleBoxFlat> gn_panel_style = p_theme->get_stylebox("panel", "GraphNode");
Ref<StyleBoxFlat> 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);

View file

@ -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));

View file

@ -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;

View file

@ -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<Control>(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;

View file

@ -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;
}
}

View file

@ -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<Control>(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")));
}
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -1560,7 +1560,7 @@ void ColorPicker::_pick_button_pressed_legacy() {
picker_preview_style_box = (Ref<StyleBoxFlat>)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;

View file

@ -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()) {

View file

@ -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<StyleBoxFlat> sb_minimap = minimap->theme_cache.node_style->duplicate();
// Override default values with colors provided by the GraphNode's stylebox, if possible.
Ref<StyleBoxFlat> sb_frame = graph_frame->get_theme_stylebox(graph_frame->is_selected() ? SNAME("panel_selected") : SNAME("panel"));
Ref<StyleBoxFlat> 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()) {

View file

@ -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;

View file

@ -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]];
}

View file

@ -129,4 +129,6 @@ SceneStringNames::SceneStringNames() {
pressed = StaticCString::create("pressed");
id_pressed = StaticCString::create("id_pressed");
panel = StaticCString::create("panel");
}

View file

@ -142,6 +142,8 @@ public:
StringName pressed;
StringName id_pressed;
StringName panel;
};
#define SceneStringName(m_name) SceneStringNames::get_singleton()->m_name

View file

@ -147,7 +147,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &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> &theme, const Ref<Font> &default_font, const
Ref<StyleBoxEmpty> 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> &theme, const Ref<Font> &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> &theme, const Ref<Font> &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> &theme, const Ref<Font> &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> &theme, const Ref<Font> &default_font, const
graphn_sb_titlebar_selected->set_bg_color(Color(1.0, 0.625, 0.625, 0.6));
Ref<StyleBoxEmpty> 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> &theme, const Ref<Font> &default_font, const
Ref<StyleBoxFlat> 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> &theme, const Ref<Font> &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> &theme, const Ref<Font> &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> &theme, const Ref<Font> &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> &theme, const Ref<Font> &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> &theme, const Ref<Font> &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> &theme, const Ref<Font> &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<StyleBoxFlat> 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> &theme, const Ref<Font> &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<StyleBoxFlat> 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);