1
0
mirror of https://github.com/godotengine/godot synced 2024-07-08 17:30:45 +00:00

Use CoreStringNames::normal in more places

This commit is contained in:
A Thousand Ships 2024-05-14 14:41:39 +02:00
parent 505da68b26
commit cade5b88d9
No known key found for this signature in database
GPG Key ID: 2033189A662F8BD7
19 changed files with 69 additions and 69 deletions

View File

@ -465,10 +465,10 @@ void ConnectDialog::_notification(int p_what) {
type_list->set_item_icon(i, get_editor_theme_icon(type_name));
}
Ref<StyleBox> style = get_theme_stylebox("normal", "LineEdit")->duplicate();
Ref<StyleBox> style = get_theme_stylebox(CoreStringName(normal), "LineEdit")->duplicate();
if (style.is_valid()) {
style->set_content_margin(SIDE_TOP, style->get_content_margin(SIDE_TOP) + 1.0);
from_signal->add_theme_style_override("normal", style);
from_signal->add_theme_style_override(CoreStringName(normal), style);
}
method_search->set_right_icon(get_editor_theme_icon("Search"));
open_method_tree->set_icon(get_editor_theme_icon("Edit"));

View File

@ -837,7 +837,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) {
for (int i = 0; i < hbc->get_child_count(); i++) {
Control *child = Object::cast_to<Control>(hbc->get_child(i));
child->begin_bulk_theme_override();
child->add_theme_style_override("normal", sbempty);
child->add_theme_style_override(CoreStringName(normal), sbempty);
child->add_theme_style_override("hover", sbempty);
child->add_theme_style_override("focus", sbempty);

View File

@ -1010,7 +1010,7 @@ EditorFeatureProfileManager::EditorFeatureProfileManager() {
// Add some spacing above the help label.
Ref<StyleBoxEmpty> sb = memnew(StyleBoxEmpty);
sb->set_content_margin(SIDE_TOP, 20 * EDSCALE);
no_profile_selected_help->add_theme_style_override("normal", sb);
no_profile_selected_help->add_theme_style_override(CoreStringName(normal), sb);
no_profile_selected_help->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
no_profile_selected_help->set_v_size_flags(Control::SIZE_EXPAND_FILL);
h_split->add_child(no_profile_selected_help);

View File

@ -345,7 +345,7 @@ void EditorHelp::_class_desc_resized(bool p_force_update_theme) {
Ref<StyleBox> class_desc_stylebox = theme_cache.background_style->duplicate();
class_desc_stylebox->set_content_margin(SIDE_LEFT, display_margin);
class_desc_stylebox->set_content_margin(SIDE_RIGHT, display_margin);
class_desc->add_theme_style_override("normal", class_desc_stylebox);
class_desc->add_theme_style_override(CoreStringName(normal), class_desc_stylebox);
class_desc->add_theme_style_override("focused", class_desc_stylebox);
}
}
@ -3723,7 +3723,7 @@ void EditorHelpBit::set_content_height_limits(float p_min, float p_max) {
void EditorHelpBit::update_content_height() {
float content_height = content->get_content_height();
const Ref<StyleBox> style = content->get_theme_stylebox("normal");
const Ref<StyleBox> style = content->get_theme_stylebox(CoreStringName(normal));
if (style.is_valid()) {
content_height += style->get_content_margin(SIDE_TOP) + style->get_content_margin(SIDE_BOTTOM);
}

View File

@ -521,7 +521,7 @@ void EditorNode::_update_theme(bool p_skip_creation) {
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)));
distraction_free->set_icon(theme->get_icon(SNAME("DistractionFree"), EditorStringName(EditorIcons)));
distraction_free->add_theme_style_override(SceneStringName(pressed), theme->get_stylebox("normal", "FlatMenuButton"));
distraction_free->add_theme_style_override(SceneStringName(pressed), theme->get_stylebox(CoreStringName(normal), "FlatMenuButton"));
help_menu->set_item_icon(help_menu->get_item_index(HELP_SEARCH), theme->get_icon(SNAME("HelpSearch"), EditorStringName(EditorIcons)));
help_menu->set_item_icon(help_menu->get_item_index(HELP_COPY_SYSTEM_INFO), theme->get_icon(SNAME("ActionCopy"), EditorStringName(EditorIcons)));

View File

@ -300,7 +300,7 @@ void EditorSpinSlider::_update_value_input_stylebox() {
stylebox->set_content_margin(SIDE_LEFT, (!get_label().is_empty() ? 23 : 16) * EDSCALE);
}
value_input->add_theme_style_override("normal", stylebox);
value_input->add_theme_style_override(CoreStringName(normal), stylebox);
}
void EditorSpinSlider::_draw_spin_slider() {

View File

@ -205,7 +205,7 @@ EditorZoomWidget::EditorZoomWidget() {
zoom_reset->set_flat(true);
Ref<StyleBoxEmpty> empty_stylebox = memnew(StyleBoxEmpty);
zoom_reset->add_theme_style_override("normal", empty_stylebox);
zoom_reset->add_theme_style_override(CoreStringName(normal), empty_stylebox);
zoom_reset->add_theme_style_override("hover", empty_stylebox);
zoom_reset->add_theme_style_override("focus", empty_stylebox);
zoom_reset->add_theme_style_override(SceneStringName(pressed), empty_stylebox);

View File

@ -1261,7 +1261,7 @@ void SceneImportSettingsDialog::_notification(int p_what) {
case NOTIFICATION_THEME_CHANGED: {
action_menu->begin_bulk_theme_override();
action_menu->add_theme_style_override("normal", get_theme_stylebox("normal", "Button"));
action_menu->add_theme_style_override(CoreStringName(normal), get_theme_stylebox(CoreStringName(normal), "Button"));
action_menu->add_theme_style_override("hover", get_theme_stylebox("hover", "Button"));
action_menu->add_theme_style_override(SceneStringName(pressed), get_theme_stylebox(SceneStringName(pressed), "Button"));
action_menu->end_bulk_theme_override();

View File

@ -718,7 +718,7 @@ void ImportDock::_notification(int p_what) {
switch (p_what) {
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
if (EditorThemeManager::is_generated_theme_outdated()) {
imported->add_theme_style_override("normal", get_theme_stylebox(CoreStringName(normal), SNAME("LineEdit")));
imported->add_theme_style_override(CoreStringName(normal), get_theme_stylebox(CoreStringName(normal), SNAME("LineEdit")));
}
} break;
@ -775,7 +775,7 @@ ImportDock::ImportDock() {
content->hide();
imported = memnew(Label);
imported->add_theme_style_override("normal", EditorNode::get_singleton()->get_editor_theme()->get_stylebox(CoreStringName(normal), SNAME("LineEdit")));
imported->add_theme_style_override(CoreStringName(normal), EditorNode::get_singleton()->get_editor_theme()->get_stylebox(CoreStringName(normal), SNAME("LineEdit")));
imported->set_clip_text(true);
content->add_child(imported);
HBoxContainer *hb = memnew(HBoxContainer);

View File

@ -172,8 +172,8 @@ void AnimationPlayerEditor::_notification(int p_what) {
pin->set_icon(get_editor_theme_icon(SNAME("Pin")));
tool_anim->add_theme_style_override("normal", get_theme_stylebox(CoreStringName(normal), SNAME("Button")));
track_editor->get_edit_menu()->add_theme_style_override("normal", get_theme_stylebox(CoreStringName(normal), SNAME("Button")));
tool_anim->add_theme_style_override(CoreStringName(normal), get_theme_stylebox(CoreStringName(normal), SNAME("Button")));
track_editor->get_edit_menu()->add_theme_style_override(CoreStringName(normal), get_theme_stylebox(CoreStringName(normal), SNAME("Button")));
#define ITEM_ICON(m_item, m_icon) tool_anim->get_popup()->set_item_icon(tool_anim->get_popup()->get_item_index(m_item), get_editor_theme_icon(SNAME(m_icon)))

View File

@ -181,7 +181,7 @@ EditorAssetLibraryItem::EditorAssetLibraryItem(bool p_clickable) {
label_margin->set_content_margin_all(0);
price = memnew(Label);
price->add_theme_style_override("normal", label_margin);
price->add_theme_style_override(CoreStringName(normal), label_margin);
price->set_tooltip_text(TTR("License"));
price->set_mouse_filter(MOUSE_FILTER_PASS);

View File

@ -55,7 +55,7 @@ BitMapEditor::BitMapEditor() {
Ref<StyleBoxEmpty> stylebox;
stylebox.instantiate();
stylebox->set_content_margin(SIDE_RIGHT, 4 * EDSCALE);
size_label->add_theme_style_override("normal", stylebox);
size_label->add_theme_style_override(CoreStringName(normal), stylebox);
}
///////////////////////

View File

@ -3044,7 +3044,7 @@ void Node3DEditorViewport::_notification(int p_what) {
Control *gui_base = EditorNode::get_singleton()->get_gui_base();
view_menu->begin_bulk_theme_override();
view_menu->add_theme_style_override("normal", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
view_menu->add_theme_style_override(CoreStringName(normal), gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
view_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
view_menu->add_theme_style_override(SceneStringName(pressed), gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
view_menu->add_theme_style_override("focus", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
@ -3052,7 +3052,7 @@ void Node3DEditorViewport::_notification(int p_what) {
view_menu->end_bulk_theme_override();
preview_camera->begin_bulk_theme_override();
preview_camera->add_theme_style_override("normal", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
preview_camera->add_theme_style_override(CoreStringName(normal), gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
preview_camera->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
preview_camera->add_theme_style_override(SceneStringName(pressed), gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
preview_camera->add_theme_style_override("focus", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
@ -3063,7 +3063,7 @@ void Node3DEditorViewport::_notification(int p_what) {
frame_time_gradient->set_color(1, get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
frame_time_gradient->set_color(2, get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
info_label->add_theme_style_override("normal", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
info_label->add_theme_style_override(CoreStringName(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)));
// Set a minimum width to prevent the width from changing all the time
@ -3073,8 +3073,8 @@ void Node3DEditorViewport::_notification(int p_what) {
frame_time_panel->set_custom_minimum_size(Size2(min_width, 0) * EDSCALE);
frame_time_vbox->add_theme_constant_override("separation", Math::round(-1 * EDSCALE));
cinema_label->add_theme_style_override("normal", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
locked_label->add_theme_style_override("normal", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
cinema_label->add_theme_style_override(CoreStringName(normal), gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
locked_label->add_theme_style_override(CoreStringName(normal), gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
} break;
case NOTIFICATION_DRAG_END: {

View File

@ -1737,7 +1737,7 @@ void ScriptEditor::_notification(int p_what) {
filter_scripts->set_right_icon(get_editor_theme_icon(SNAME("Search")));
filter_methods->set_right_icon(get_editor_theme_icon(SNAME("Search")));
filename->add_theme_style_override("normal", get_theme_stylebox(CoreStringName(normal), SNAME("LineEdit")));
filename->add_theme_style_override(CoreStringName(normal), get_theme_stylebox(CoreStringName(normal), SNAME("LineEdit")));
recent_scripts->reset_size();
@ -4052,7 +4052,7 @@ ScriptEditor::ScriptEditor(WindowWrapper *p_wrapper) {
filename = memnew(Label);
filename->set_clip_text(true);
filename->set_h_size_flags(SIZE_EXPAND_FILL);
filename->add_theme_style_override("normal", EditorNode::get_singleton()->get_editor_theme()->get_stylebox(CoreStringName(normal), SNAME("LineEdit")));
filename->add_theme_style_override(CoreStringName(normal), EditorNode::get_singleton()->get_editor_theme()->get_stylebox(CoreStringName(normal), SNAME("LineEdit")));
buttons_hbox->add_child(filename);
members_overview_alphabeta_sort_button = memnew(Button);

View File

@ -997,7 +997,7 @@ void TileSetAtlasSourceEditor::_update_atlas_view() {
Button *button = memnew(Button);
button->set_flat(true);
button->set_icon(get_editor_theme_icon(SNAME("Add")));
button->add_theme_style_override("normal", memnew(StyleBoxEmpty));
button->add_theme_style_override(CoreStringName(normal), memnew(StyleBoxEmpty));
button->add_theme_style_override("hover", memnew(StyleBoxEmpty));
button->add_theme_style_override("focus", memnew(StyleBoxEmpty));
button->add_theme_style_override(SceneStringName(pressed), memnew(StyleBoxEmpty));

View File

@ -1138,14 +1138,14 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id, bool
Label *label = memnew(Label);
label->set_auto_translate_mode(Node::AUTO_TRANSLATE_MODE_DISABLED); // TODO: Implement proper translation switch.
label->set_text(name_left);
label->add_theme_style_override("normal", editor->get_theme_stylebox(SNAME("label_style"), SNAME("VShaderEditor"))); //more compact
label->add_theme_style_override(CoreStringName(normal), editor->get_theme_stylebox(SNAME("label_style"), SNAME("VShaderEditor"))); //more compact
hb->add_child(label);
if (vsnode->is_input_port_default(j, mode) && !port_left_used) {
Label *hint_label = memnew(Label);
hint_label->set_text(TTR("[default]"));
hint_label->add_theme_color_override("font_color", editor->get_theme_color(SNAME("font_readonly_color"), SNAME("TextEdit")));
hint_label->add_theme_style_override("normal", editor->get_theme_stylebox(SNAME("label_style"), SNAME("VShaderEditor")));
hint_label->add_theme_style_override(CoreStringName(normal), editor->get_theme_stylebox(SNAME("label_style"), SNAME("VShaderEditor")));
hb->add_child(hint_label);
}
}
@ -1188,7 +1188,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id, bool
Label *label = memnew(Label);
label->set_auto_translate_mode(Node::AUTO_TRANSLATE_MODE_DISABLED); // TODO: Implement proper translation switch.
label->set_text(name_right);
label->add_theme_style_override("normal", editor->get_theme_stylebox(SNAME("label_style"), SNAME("VShaderEditor"))); //more compact
label->add_theme_style_override(CoreStringName(normal), editor->get_theme_stylebox(SNAME("label_style"), SNAME("VShaderEditor"))); //more compact
hb->add_child(label);
}
}

View File

@ -1297,7 +1297,7 @@ ProjectManager::ProjectManager() {
empty_list_message->set_use_bbcode(true);
empty_list_message->set_fit_content(true);
empty_list_message->set_h_size_flags(SIZE_EXPAND_FILL);
empty_list_message->add_theme_style_override("normal", memnew(StyleBoxEmpty));
empty_list_message->add_theme_style_override(CoreStringName(normal), memnew(StyleBoxEmpty));
const String line1 = TTR("You don't have any projects yet.");
const String line2 = TTR("Get started by creating a new one,\nimporting one that exists, or by downloading a project template from the Asset Library!");

View File

@ -704,7 +704,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
{
// Button.
p_theme->set_stylebox("normal", "Button", p_config.button_style);
p_theme->set_stylebox(CoreStringName(normal), "Button", p_config.button_style);
p_theme->set_stylebox("hover", "Button", p_config.button_style_hover);
p_theme->set_stylebox(SceneStringName(pressed), "Button", p_config.button_style_pressed);
p_theme->set_stylebox("focus", "Button", p_config.button_style_focus);
@ -730,7 +730,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
// MenuButton.
p_theme->set_stylebox("normal", "MenuButton", p_config.panel_container_style);
p_theme->set_stylebox(CoreStringName(normal), "MenuButton", p_config.panel_container_style);
p_theme->set_stylebox("hover", "MenuButton", p_config.button_style_hover);
p_theme->set_stylebox(SceneStringName(pressed), "MenuButton", p_config.panel_container_style);
p_theme->set_stylebox("focus", "MenuButton", p_config.panel_container_style);
@ -746,7 +746,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
// MenuBar.
p_theme->set_stylebox("normal", "MenuBar", p_config.button_style);
p_theme->set_stylebox(CoreStringName(normal), "MenuBar", p_config.button_style);
p_theme->set_stylebox("hover", "MenuBar", p_config.button_style_hover);
p_theme->set_stylebox(SceneStringName(pressed), "MenuBar", p_config.button_style_pressed);
p_theme->set_stylebox("disabled", "MenuBar", p_config.button_style_disabled);
@ -783,7 +783,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
option_button_disabled_style->set_content_margin(SIDE_RIGHT, 4 * EDSCALE);
p_theme->set_stylebox("focus", "OptionButton", option_button_focus_style);
p_theme->set_stylebox("normal", "OptionButton", p_config.button_style);
p_theme->set_stylebox(CoreStringName(normal), "OptionButton", p_config.button_style);
p_theme->set_stylebox("hover", "OptionButton", p_config.button_style_hover);
p_theme->set_stylebox(SceneStringName(pressed), "OptionButton", p_config.button_style_pressed);
p_theme->set_stylebox("disabled", "OptionButton", p_config.button_style_disabled);
@ -816,7 +816,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
// CheckButton.
p_theme->set_stylebox("normal", "CheckButton", p_config.panel_container_style);
p_theme->set_stylebox(CoreStringName(normal), "CheckButton", p_config.panel_container_style);
p_theme->set_stylebox(SceneStringName(pressed), "CheckButton", p_config.panel_container_style);
p_theme->set_stylebox("disabled", "CheckButton", p_config.panel_container_style);
p_theme->set_stylebox("hover", "CheckButton", p_config.panel_container_style);
@ -855,7 +855,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
Ref<StyleBoxFlat> checkbox_style = p_config.panel_container_style->duplicate();
checkbox_style->set_content_margin_all(p_config.base_margin * EDSCALE);
p_theme->set_stylebox("normal", "CheckBox", checkbox_style);
p_theme->set_stylebox(CoreStringName(normal), "CheckBox", checkbox_style);
p_theme->set_stylebox(SceneStringName(pressed), "CheckBox", checkbox_style);
p_theme->set_stylebox("disabled", "CheckBox", checkbox_style);
p_theme->set_stylebox("hover", "CheckBox", checkbox_style);
@ -1177,7 +1177,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
// LineEdit.
p_theme->set_stylebox("normal", "LineEdit", text_editor_style);
p_theme->set_stylebox(CoreStringName(normal), "LineEdit", text_editor_style);
p_theme->set_stylebox("focus", "LineEdit", p_config.button_style_focus);
p_theme->set_stylebox("read_only", "LineEdit", text_editor_disabled_style);
@ -1199,7 +1199,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
// TextEdit.
p_theme->set_stylebox("normal", "TextEdit", text_editor_style);
p_theme->set_stylebox(CoreStringName(normal), "TextEdit", text_editor_style);
p_theme->set_stylebox("focus", "TextEdit", p_config.button_style_focus);
p_theme->set_stylebox("read_only", "TextEdit", text_editor_disabled_style);
@ -1430,7 +1430,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
{
// RichTextLabel.
p_theme->set_stylebox("normal", "RichTextLabel", p_config.tree_panel_style);
p_theme->set_stylebox(CoreStringName(normal), "RichTextLabel", p_config.tree_panel_style);
p_theme->set_stylebox("focus", "RichTextLabel", make_empty_stylebox());
p_theme->set_color("default_color", "RichTextLabel", p_config.font_color);
@ -1445,7 +1445,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
// Label.
p_theme->set_stylebox("normal", "Label", p_config.base_empty_style);
p_theme->set_stylebox(CoreStringName(normal), "Label", p_config.base_empty_style);
p_theme->set_color("font_color", "Label", p_config.font_color);
p_theme->set_color("font_shadow_color", "Label", Color(0, 0, 0, 0));
@ -1620,7 +1620,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
// GraphNode's title Label.
p_theme->set_type_variation("GraphNodeTitleLabel", "Label");
p_theme->set_stylebox("normal", "GraphNodeTitleLabel", make_empty_stylebox(0, 0, 0, 0));
p_theme->set_stylebox(CoreStringName(normal), "GraphNodeTitleLabel", make_empty_stylebox(0, 0, 0, 0));
p_theme->set_color("font_color", "GraphNodeTitleLabel", p_config.dark_theme ? p_config.font_color : Color(1, 1, 1)); // Also use a bright font color for light themes.
p_theme->set_color("font_shadow_color", "GraphNodeTitleLabel", Color(0, 0, 0, 0.35));
p_theme->set_constant("shadow_outline_size", "GraphNodeTitleLabel", 4);
@ -1652,7 +1652,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
// GraphFrame's title Label.
p_theme->set_type_variation("GraphFrameTitleLabel", "Label");
p_theme->set_stylebox("normal", "GraphFrameTitleLabel", memnew(StyleBoxEmpty));
p_theme->set_stylebox(CoreStringName(normal), "GraphFrameTitleLabel", memnew(StyleBoxEmpty));
p_theme->set_font_size("font_size", "GraphFrameTitleLabel", 22);
p_theme->set_color("font_color", "GraphFrameTitleLabel", Color(1, 1, 1));
p_theme->set_color("font_shadow_color", "GraphFrameTitleLabel", Color(0, 0, 0, 0));
@ -1730,7 +1730,7 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme
tag->set_corner_radius(CORNER_BOTTOM_LEFT, 0);
tag->set_corner_radius(CORNER_TOP_RIGHT, 4);
tag->set_corner_radius(CORNER_BOTTOM_RIGHT, 4);
p_theme->set_stylebox("normal", "ProjectTag", tag);
p_theme->set_stylebox(CoreStringName(normal), "ProjectTag", tag);
tag = p_config.button_style_hover->duplicate();
tag->set_corner_radius(CORNER_TOP_LEFT, 0);
@ -1809,13 +1809,13 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme
menu_transparent_style->set_content_margin((Side)i, p_config.button_style->get_content_margin((Side)i));
main_screen_button_hover->set_content_margin((Side)i, p_config.button_style_hover->get_content_margin((Side)i));
}
p_theme->set_stylebox("normal", "MainScreenButton", menu_transparent_style);
p_theme->set_stylebox(CoreStringName(normal), "MainScreenButton", menu_transparent_style);
p_theme->set_stylebox(SceneStringName(pressed), "MainScreenButton", menu_transparent_style);
p_theme->set_stylebox("hover", "MainScreenButton", main_screen_button_hover);
p_theme->set_stylebox("hover_pressed", "MainScreenButton", main_screen_button_hover);
p_theme->set_type_variation("MainMenuBar", "FlatMenuButton");
p_theme->set_stylebox("normal", "MainMenuBar", menu_transparent_style);
p_theme->set_stylebox(CoreStringName(normal), "MainMenuBar", menu_transparent_style);
p_theme->set_stylebox(SceneStringName(pressed), "MainMenuBar", main_screen_button_hover);
p_theme->set_stylebox("hover", "MainMenuBar", main_screen_button_hover);
p_theme->set_stylebox("hover_pressed", "MainMenuBar", main_screen_button_hover);
@ -1830,7 +1830,7 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme
style_bottom_panel->set_corner_radius_all(p_config.corner_radius * EDSCALE);
p_theme->set_stylebox("BottomPanel", EditorStringName(EditorStyles), style_bottom_panel);
p_theme->set_type_variation("BottomPanelButton", "FlatMenuButton");
p_theme->set_stylebox("normal", "BottomPanelButton", menu_transparent_style);
p_theme->set_stylebox(CoreStringName(normal), "BottomPanelButton", menu_transparent_style);
p_theme->set_stylebox(SceneStringName(pressed), "BottomPanelButton", menu_transparent_style);
p_theme->set_stylebox("hover_pressed", "BottomPanelButton", main_screen_button_hover);
p_theme->set_stylebox("hover", "BottomPanelButton", main_screen_button_hover);
@ -1900,12 +1900,12 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme
}
style_flat_button_pressed->set_bg_color(flat_pressed_color);
p_theme->set_stylebox("normal", "FlatButton", style_flat_button);
p_theme->set_stylebox(CoreStringName(normal), "FlatButton", style_flat_button);
p_theme->set_stylebox("hover", "FlatButton", style_flat_button_hover);
p_theme->set_stylebox(SceneStringName(pressed), "FlatButton", style_flat_button_pressed);
p_theme->set_stylebox("disabled", "FlatButton", style_flat_button);
p_theme->set_stylebox("normal", "FlatMenuButton", style_flat_button);
p_theme->set_stylebox(CoreStringName(normal), "FlatMenuButton", style_flat_button);
p_theme->set_stylebox("hover", "FlatMenuButton", style_flat_button_hover);
p_theme->set_stylebox(SceneStringName(pressed), "FlatMenuButton", style_flat_button_pressed);
p_theme->set_stylebox("disabled", "FlatMenuButton", style_flat_button);
@ -1930,7 +1930,7 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme
if (!p_config.dark_theme) {
editor_log_button_pressed->set_bg_color(flat_pressed_color.lightened(0.5));
}
p_theme->set_stylebox("normal", "EditorLogFilterButton", style_flat_button);
p_theme->set_stylebox(CoreStringName(normal), "EditorLogFilterButton", style_flat_button);
p_theme->set_stylebox("hover", "EditorLogFilterButton", style_flat_button_hover);
p_theme->set_stylebox(SceneStringName(pressed), "EditorLogFilterButton", editor_log_button_pressed);
}
@ -1951,7 +1951,7 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme
Ref<StyleBoxFlat> panel_button_style_disabled = p_config.button_style_disabled->duplicate();
panel_button_style_disabled->set_bg_color(p_config.disabled_bg_color);
p_theme->set_stylebox("normal", "PanelBackgroundButton", panel_button_style);
p_theme->set_stylebox(CoreStringName(normal), "PanelBackgroundButton", panel_button_style);
p_theme->set_stylebox("hover", "PanelBackgroundButton", panel_button_style_hover);
p_theme->set_stylebox(SceneStringName(pressed), "PanelBackgroundButton", panel_button_style_pressed);
p_theme->set_stylebox("disabled", "PanelBackgroundButton", panel_button_style_disabled);
@ -1986,7 +1986,7 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme
Ref<StyleBoxFlat> style_inspector_action = p_config.button_style->duplicate();
style_inspector_action->set_bg_color(color_inspector_action);
style_inspector_action->set_content_margin(SIDE_RIGHT, action_extra_margin);
p_theme->set_stylebox("normal", "InspectorActionButton", style_inspector_action);
p_theme->set_stylebox(CoreStringName(normal), "InspectorActionButton", style_inspector_action);
style_inspector_action = p_config.button_style_hover->duplicate();
style_inspector_action->set_content_margin(SIDE_RIGHT, action_extra_margin);
@ -2016,7 +2016,7 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme
// Unpressed icon is dim, so use a dim highlight.
p_theme->set_color("icon_hover_color", "PreviewLightButton", dim_light_highlighted_color);
p_theme->set_stylebox("normal", "PreviewLightButton", sb_empty_borderless);
p_theme->set_stylebox(CoreStringName(normal), "PreviewLightButton", sb_empty_borderless);
p_theme->set_stylebox("hover", "PreviewLightButton", sb_empty_borderless);
p_theme->set_stylebox("focus", "PreviewLightButton", sb_empty_borderless);
p_theme->set_stylebox(SceneStringName(pressed), "PreviewLightButton", sb_empty_borderless);
@ -2232,7 +2232,7 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme
style->set_corner_radius(CORNER_BOTTOM_RIGHT, 0);
p_theme->set_type_variation("EditorHelpBitTitle", "RichTextLabel");
p_theme->set_stylebox("normal", "EditorHelpBitTitle", style);
p_theme->set_stylebox(CoreStringName(normal), "EditorHelpBitTitle", style);
}
// EditorHelpBitContent.
@ -2242,7 +2242,7 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme
style->set_corner_radius(CORNER_TOP_RIGHT, 0);
p_theme->set_type_variation("EditorHelpBitContent", "RichTextLabel");
p_theme->set_stylebox("normal", "EditorHelpBitContent", style);
p_theme->set_stylebox(CoreStringName(normal), "EditorHelpBitContent", style);
}
// Asset Library.
@ -2486,7 +2486,7 @@ void EditorThemeManager::_populate_text_editor_styles(const Ref<EditorTheme> &p_
const Color background_color = EDITOR_GET("text_editor/theme/highlighting/background_color");
Ref<StyleBoxFlat> code_edit_stylebox = make_flat_stylebox(background_color, p_config.widget_margin.x, p_config.widget_margin.y, p_config.widget_margin.x, p_config.widget_margin.y, p_config.corner_radius);
p_theme->set_stylebox("normal", "CodeEdit", code_edit_stylebox);
p_theme->set_stylebox(CoreStringName(normal), "CodeEdit", code_edit_stylebox);
p_theme->set_stylebox("read_only", "CodeEdit", code_edit_stylebox);
p_theme->set_stylebox("focus", "CodeEdit", memnew(StyleBoxEmpty));

View File

@ -159,7 +159,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
// Make the focus outline appear to be flush with the buttons it's focusing.
focus->set_expand_margin_all(Math::round(2 * scale));
theme->set_stylebox("normal", "Button", button_normal);
theme->set_stylebox(CoreStringName(normal), "Button", button_normal);
theme->set_stylebox("hover", "Button", button_hover);
theme->set_stylebox(SceneStringName(pressed), "Button", button_pressed);
theme->set_stylebox("disabled", "Button", button_disabled);
@ -188,7 +188,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_constant("icon_max_width", "Button", 0);
// MenuBar
theme->set_stylebox("normal", "MenuBar", button_normal);
theme->set_stylebox(CoreStringName(normal), "MenuBar", button_normal);
theme->set_stylebox("hover", "MenuBar", button_hover);
theme->set_stylebox(SceneStringName(pressed), "MenuBar", button_pressed);
theme->set_stylebox("disabled", "MenuBar", button_disabled);
@ -231,7 +231,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
Ref<StyleBox> sb_optbutton_pressed = make_flat_stylebox(style_pressed_color, 2 * default_margin, default_margin, 2 * default_margin, default_margin);
Ref<StyleBox> sb_optbutton_disabled = make_flat_stylebox(style_disabled_color, 2 * default_margin, default_margin, 2 * default_margin, default_margin);
theme->set_stylebox("normal", "OptionButton", sb_optbutton_normal);
theme->set_stylebox(CoreStringName(normal), "OptionButton", sb_optbutton_normal);
theme->set_stylebox("hover", "OptionButton", sb_optbutton_hover);
theme->set_stylebox(SceneStringName(pressed), "OptionButton", sb_optbutton_pressed);
theme->set_stylebox("disabled", "OptionButton", sb_optbutton_disabled);
@ -266,7 +266,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
// MenuButton
theme->set_stylebox("normal", "MenuButton", button_normal);
theme->set_stylebox(CoreStringName(normal), "MenuButton", button_normal);
theme->set_stylebox(SceneStringName(pressed), "MenuButton", button_pressed);
theme->set_stylebox("hover", "MenuButton", button_hover);
theme->set_stylebox("disabled", "MenuButton", button_disabled);
@ -292,7 +292,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
Ref<StyleBox> cbx_focus = focus;
cbx_focus->set_content_margin_all(Math::round(4 * scale));
theme->set_stylebox("normal", "CheckBox", cbx_empty);
theme->set_stylebox(CoreStringName(normal), "CheckBox", cbx_empty);
theme->set_stylebox(SceneStringName(pressed), "CheckBox", cbx_empty);
theme->set_stylebox("disabled", "CheckBox", cbx_empty);
theme->set_stylebox("hover", "CheckBox", cbx_empty);
@ -328,7 +328,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
Ref<StyleBox> cb_empty = memnew(StyleBoxEmpty);
cb_empty->set_content_margin_individual(Math::round(6 * scale), Math::round(4 * scale), Math::round(6 * scale), Math::round(4 * scale));
theme->set_stylebox("normal", "CheckButton", cb_empty);
theme->set_stylebox(CoreStringName(normal), "CheckButton", cb_empty);
theme->set_stylebox(SceneStringName(pressed), "CheckButton", cb_empty);
theme->set_stylebox("disabled", "CheckButton", cb_empty);
theme->set_stylebox("hover", "CheckButton", cb_empty);
@ -372,19 +372,19 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
Ref<StyleBoxFlat> flat_button_pressed = button_pressed->duplicate();
flat_button_pressed->set_bg_color(style_pressed_color * Color(1, 1, 1, 0.85));
theme->set_stylebox("normal", "FlatButton", flat_button_normal);
theme->set_stylebox(CoreStringName(normal), "FlatButton", flat_button_normal);
theme->set_stylebox("hover", "FlatButton", flat_button_normal);
theme->set_stylebox(SceneStringName(pressed), "FlatButton", flat_button_pressed);
theme->set_stylebox("disabled", "FlatButton", flat_button_normal);
theme->set_stylebox("normal", "FlatMenuButton", flat_button_normal);
theme->set_stylebox(CoreStringName(normal), "FlatMenuButton", flat_button_normal);
theme->set_stylebox("hover", "FlatMenuButton", flat_button_normal);
theme->set_stylebox(SceneStringName(pressed), "FlatMenuButton", flat_button_pressed);
theme->set_stylebox("disabled", "FlatMenuButton", flat_button_normal);
// Label
theme->set_stylebox("normal", "Label", memnew(StyleBoxEmpty));
theme->set_stylebox(CoreStringName(normal), "Label", memnew(StyleBoxEmpty));
theme->set_font("font", "Label", Ref<Font>());
theme->set_font_size("font_size", "Label", -1);
@ -413,7 +413,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
// Add a line at the bottom to make LineEdits distinguishable from Buttons.
style_line_edit->set_border_width(SIDE_BOTTOM, 2);
style_line_edit->set_border_color(style_pressed_color);
theme->set_stylebox("normal", "LineEdit", style_line_edit);
theme->set_stylebox(CoreStringName(normal), "LineEdit", style_line_edit);
theme->set_stylebox("focus", "LineEdit", focus);
@ -457,7 +457,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
// TextEdit
theme->set_stylebox("normal", "TextEdit", style_line_edit);
theme->set_stylebox(CoreStringName(normal), "TextEdit", style_line_edit);
theme->set_stylebox("focus", "TextEdit", focus);
theme->set_stylebox("read_only", "TextEdit", style_line_edit_read_only);
@ -487,7 +487,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
// CodeEdit
theme->set_stylebox("normal", "CodeEdit", style_line_edit);
theme->set_stylebox(CoreStringName(normal), "CodeEdit", style_line_edit);
theme->set_stylebox("focus", "CodeEdit", focus);
theme->set_stylebox("read_only", "CodeEdit", style_line_edit_read_only);
theme->set_stylebox("completion", "CodeEdit", make_flat_stylebox(style_normal_color, 0, 0, 0, 0));
@ -746,7 +746,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_type_variation("GraphNodeTitleLabel", "Label");
theme->set_stylebox("normal", "GraphNodeTitleLabel", make_empty_stylebox(0, 0, 0, 0));
theme->set_stylebox(CoreStringName(normal), "GraphNodeTitleLabel", make_empty_stylebox(0, 0, 0, 0));
theme->set_font("font", "GraphNodeTitleLabel", Ref<Font>());
theme->set_font_size("font_size", "GraphNodeTitleLabel", -1);
theme->set_color("font_color", "GraphNodeTitleLabel", control_font_color);
@ -777,7 +777,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_type_variation("GraphFrameTitleLabel", "Label");
theme->set_stylebox("normal", "GraphFrameTitleLabel", memnew(StyleBoxEmpty));
theme->set_stylebox(CoreStringName(normal), "GraphFrameTitleLabel", memnew(StyleBoxEmpty));
theme->set_font_size("font_size", "GraphFrameTitleLabel", 22);
theme->set_color("font_color", "GraphFrameTitleLabel", Color(1, 1, 1));
theme->set_color("font_shadow_color", "GraphFrameTitleLabel", Color(0, 0, 0, 0));
@ -1050,7 +1050,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
// ColorPickerButton
theme->set_icon("bg", "ColorPickerButton", icons["mini_checkerboard"]);
theme->set_stylebox("normal", "ColorPickerButton", button_normal);
theme->set_stylebox(CoreStringName(normal), "ColorPickerButton", button_normal);
theme->set_stylebox(SceneStringName(pressed), "ColorPickerButton", button_pressed);
theme->set_stylebox("hover", "ColorPickerButton", button_hover);
theme->set_stylebox("disabled", "ColorPickerButton", button_disabled);
@ -1101,7 +1101,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
// RichTextLabel
theme->set_stylebox("focus", "RichTextLabel", focus);
theme->set_stylebox("normal", "RichTextLabel", make_empty_stylebox(0, 0, 0, 0));
theme->set_stylebox(CoreStringName(normal), "RichTextLabel", make_empty_stylebox(0, 0, 0, 0));
theme->set_font("normal_font", "RichTextLabel", Ref<Font>());
theme->set_font("bold_font", "RichTextLabel", bold_font);