Re-add missing SNAME macros in get_theme_* calls

They were removed in the previous commit reverting the addition of `SNAME`
to `add_theme_*` and theme setter methods, which is not wanted.
This commit is contained in:
Rémi Verschelde 2022-02-08 10:30:18 +01:00
parent fc076ece3d
commit 6eeeb9a63c
No known key found for this signature in database
GPG Key ID: C3336907360768E1
7 changed files with 68 additions and 68 deletions

View File

@ -3020,7 +3020,7 @@ void EditorInspector::_update_inspector_bg() {
n = n->get_parent(); n = n->get_parent();
} }
count_subinspectors = MIN(15, count_subinspectors); count_subinspectors = MIN(15, count_subinspectors);
add_theme_style_override("bg", get_theme_stylebox("sub_inspector_bg" + itos(count_subinspectors), "Editor")); add_theme_style_override("bg", get_theme_stylebox("sub_inspector_bg" + itos(count_subinspectors), SNAME("Editor")));
} else { } else {
add_theme_style_override("bg", get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); add_theme_style_override("bg", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
} }

View File

@ -272,15 +272,15 @@ void EditorSettingsDialog::_create_shortcut_treeitem(TreeItem *p_parent, const S
shortcut_item->set_text(1, sc_text); shortcut_item->set_text(1, sc_text);
if (sc_text == "None") { if (sc_text == "None") {
// Fade out unassigned shortcut labels for easier visual grepping. // Fade out unassigned shortcut labels for easier visual grepping.
shortcut_item->set_custom_color(1, shortcuts->get_theme_color("font_color", "Label") * Color(1, 1, 1, 0.5)); shortcut_item->set_custom_color(1, shortcuts->get_theme_color(SNAME("font_color"), SNAME("Label")) * Color(1, 1, 1, 0.5));
} }
if (p_allow_revert) { if (p_allow_revert) {
shortcut_item->add_button(1, shortcuts->get_theme_icon("Reload", "EditorIcons"), SHORTCUT_REVERT); shortcut_item->add_button(1, shortcuts->get_theme_icon(SNAME("Reload"), SNAME("EditorIcons")), SHORTCUT_REVERT);
} }
shortcut_item->add_button(1, shortcuts->get_theme_icon("Add", "EditorIcons"), SHORTCUT_ADD); shortcut_item->add_button(1, shortcuts->get_theme_icon(SNAME("Add"), SNAME("EditorIcons")), SHORTCUT_ADD);
shortcut_item->add_button(1, shortcuts->get_theme_icon("Close", "EditorIcons"), SHORTCUT_ERASE); shortcut_item->add_button(1, shortcuts->get_theme_icon(SNAME("Close"), SNAME("EditorIcons")), SHORTCUT_ERASE);
shortcut_item->set_meta("is_action", p_is_action); shortcut_item->set_meta("is_action", p_is_action);
shortcut_item->set_meta("type", "shortcut"); shortcut_item->set_meta("type", "shortcut");
@ -299,11 +299,11 @@ void EditorSettingsDialog::_create_shortcut_treeitem(TreeItem *p_parent, const S
event_item->set_text(0, shortcut_item->get_child_count() == 1 ? "Primary" : ""); event_item->set_text(0, shortcut_item->get_child_count() == 1 ? "Primary" : "");
event_item->set_text(1, ie->as_text()); event_item->set_text(1, ie->as_text());
event_item->add_button(1, shortcuts->get_theme_icon("Edit", "EditorIcons"), SHORTCUT_EDIT); event_item->add_button(1, shortcuts->get_theme_icon(SNAME("Edit"), SNAME("EditorIcons")), SHORTCUT_EDIT);
event_item->add_button(1, shortcuts->get_theme_icon("Close", "EditorIcons"), SHORTCUT_ERASE); event_item->add_button(1, shortcuts->get_theme_icon(SNAME("Close"), SNAME("EditorIcons")), SHORTCUT_ERASE);
event_item->set_custom_bg_color(0, shortcuts->get_theme_color("dark_color_3", "Editor")); event_item->set_custom_bg_color(0, shortcuts->get_theme_color(SNAME("dark_color_3"), SNAME("Editor")));
event_item->set_custom_bg_color(1, shortcuts->get_theme_color("dark_color_3", "Editor")); event_item->set_custom_bg_color(1, shortcuts->get_theme_color(SNAME("dark_color_3"), SNAME("Editor")));
event_item->set_meta("is_action", p_is_action); event_item->set_meta("is_action", p_is_action);
event_item->set_meta("type", "event"); event_item->set_meta("type", "event");

View File

@ -113,22 +113,22 @@ void EditorToaster::_notification(int p_what) {
disable_notifications_button->set_icon(get_theme_icon(SNAME("NotificationDisabled"), SNAME("EditorIcons"))); disable_notifications_button->set_icon(get_theme_icon(SNAME("NotificationDisabled"), SNAME("EditorIcons")));
// Styleboxes background. // Styleboxes background.
info_panel_style_background->set_bg_color(get_theme_color("base_color", "Editor")); info_panel_style_background->set_bg_color(get_theme_color(SNAME("base_color"), SNAME("Editor")));
warning_panel_style_background->set_bg_color(get_theme_color("base_color", "Editor")); warning_panel_style_background->set_bg_color(get_theme_color(SNAME("base_color"), SNAME("Editor")));
warning_panel_style_background->set_border_color(get_theme_color("warning_color", "Editor")); warning_panel_style_background->set_border_color(get_theme_color(SNAME("warning_color"), SNAME("Editor")));
error_panel_style_background->set_bg_color(get_theme_color("base_color", "Editor")); error_panel_style_background->set_bg_color(get_theme_color(SNAME("base_color"), SNAME("Editor")));
error_panel_style_background->set_border_color(get_theme_color("error_color", "Editor")); error_panel_style_background->set_border_color(get_theme_color(SNAME("error_color"), SNAME("Editor")));
// Styleboxes progress. // Styleboxes progress.
info_panel_style_progress->set_bg_color(get_theme_color("base_color", "Editor").lightened(0.03)); info_panel_style_progress->set_bg_color(get_theme_color(SNAME("base_color"), SNAME("Editor")).lightened(0.03));
warning_panel_style_progress->set_bg_color(get_theme_color("base_color", "Editor").lightened(0.03)); warning_panel_style_progress->set_bg_color(get_theme_color(SNAME("base_color"), SNAME("Editor")).lightened(0.03));
warning_panel_style_progress->set_border_color(get_theme_color("warning_color", "Editor")); warning_panel_style_progress->set_border_color(get_theme_color(SNAME("warning_color"), SNAME("Editor")));
error_panel_style_progress->set_bg_color(get_theme_color("base_color", "Editor").lightened(0.03)); error_panel_style_progress->set_bg_color(get_theme_color(SNAME("base_color"), SNAME("Editor")).lightened(0.03));
error_panel_style_progress->set_border_color(get_theme_color("error_color", "Editor")); error_panel_style_progress->set_border_color(get_theme_color(SNAME("error_color"), SNAME("Editor")));
main_button->update(); main_button->update();
disable_notifications_button->update(); disable_notifications_button->update();
@ -256,13 +256,13 @@ void EditorToaster::_draw_button() {
real_t button_radius = main_button->get_size().x / 8; real_t button_radius = main_button->get_size().x / 8;
switch (highest_severity) { switch (highest_severity) {
case SEVERITY_INFO: case SEVERITY_INFO:
color = get_theme_color("accent_color", "Editor"); color = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
break; break;
case SEVERITY_WARNING: case SEVERITY_WARNING:
color = get_theme_color("warning_color", "Editor"); color = get_theme_color(SNAME("warning_color"), SNAME("Editor"));
break; break;
case SEVERITY_ERROR: case SEVERITY_ERROR:
color = get_theme_color("error_color", "Editor"); color = get_theme_color(SNAME("error_color"), SNAME("Editor"));
break; break;
default: default:
break; break;
@ -360,7 +360,7 @@ Control *EditorToaster::popup(Control *p_control, Severity p_severity, double p_
if (p_time > 0.0) { if (p_time > 0.0) {
Button *close_button = memnew(Button); Button *close_button = memnew(Button);
close_button->set_flat(true); close_button->set_flat(true);
close_button->set_icon(get_theme_icon("Close", "EditorIcons")); close_button->set_icon(get_theme_icon(SNAME("Close"), SNAME("EditorIcons")));
close_button->connect("pressed", callable_bind(callable_mp(this, &EditorToaster::close), panel)); close_button->connect("pressed", callable_bind(callable_mp(this, &EditorToaster::close), panel));
close_button->connect("theme_changed", callable_bind(callable_mp(this, &EditorToaster::_close_button_theme_changed), close_button)); close_button->connect("theme_changed", callable_bind(callable_mp(this, &EditorToaster::_close_button_theme_changed), close_button));
hbox_container->add_child(close_button); hbox_container->add_child(close_button);
@ -442,7 +442,7 @@ void EditorToaster::close(Control *p_control) {
void EditorToaster::_close_button_theme_changed(Control *p_close_button) { void EditorToaster::_close_button_theme_changed(Control *p_close_button) {
Button *close_button = Object::cast_to<Button>(p_close_button); Button *close_button = Object::cast_to<Button>(p_close_button);
if (close_button) { if (close_button) {
close_button->set_icon(get_theme_icon("Close", "EditorIcons")); close_button->set_icon(get_theme_icon(SNAME("Close"), SNAME("EditorIcons")));
} }
} }

View File

@ -495,7 +495,7 @@ void DynamicFontImportSettings::_variation_add() {
vars_item->set_text(0, TTR("New configuration")); vars_item->set_text(0, TTR("New configuration"));
vars_item->set_editable(0, true); vars_item->set_editable(0, true);
vars_item->add_button(1, vars_list->get_theme_icon("Remove", "EditorIcons"), BUTTON_REMOVE_VAR, false, TTR("Remove Variation")); vars_item->add_button(1, vars_list->get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), BUTTON_REMOVE_VAR, false, TTR("Remove Variation"));
vars_item->set_button_color(1, 0, Color(1, 1, 1, 0.75)); vars_item->set_button_color(1, 0, Color(1, 1, 1, 0.75));
Ref<DynamicFontImportSettingsData> import_variation_data; Ref<DynamicFontImportSettingsData> import_variation_data;
@ -643,8 +643,8 @@ void DynamicFontImportSettings::_glyph_selected() {
TreeItem *item = glyph_table->get_selected(); TreeItem *item = glyph_table->get_selected();
ERR_FAIL_NULL(item); ERR_FAIL_NULL(item);
Color scol = glyph_table->get_theme_color("box_selection_fill_color", "Editor"); Color scol = glyph_table->get_theme_color(SNAME("box_selection_fill_color"), SNAME("Editor"));
Color fcol = glyph_table->get_theme_color("font_selected_color", "Editor"); Color fcol = glyph_table->get_theme_color(SNAME("font_selected_color"), SNAME("Editor"));
scol.a = 1.f; scol.a = 1.f;
int32_t c = item->get_metadata(glyph_table->get_selected_column()); int32_t c = item->get_metadata(glyph_table->get_selected_column());
@ -705,8 +705,8 @@ void DynamicFontImportSettings::_edit_range(int32_t p_start, int32_t p_end) {
TreeItem *root = glyph_table->create_item(); TreeItem *root = glyph_table->create_item();
ERR_FAIL_NULL(root); ERR_FAIL_NULL(root);
Color scol = glyph_table->get_theme_color("box_selection_fill_color", "Editor"); Color scol = glyph_table->get_theme_color(SNAME("box_selection_fill_color"), SNAME("Editor"));
Color fcol = glyph_table->get_theme_color("font_selected_color", "Editor"); Color fcol = glyph_table->get_theme_color(SNAME("font_selected_color"), SNAME("Editor"));
scol.a = 1.f; scol.a = 1.f;
TreeItem *item = nullptr; TreeItem *item = nullptr;
@ -719,12 +719,12 @@ void DynamicFontImportSettings::_edit_range(int32_t p_start, int32_t p_end) {
item->set_text(0, _pad_zeros(String::num_int64(c, 16))); item->set_text(0, _pad_zeros(String::num_int64(c, 16)));
item->set_text_alignment(0, HORIZONTAL_ALIGNMENT_LEFT); item->set_text_alignment(0, HORIZONTAL_ALIGNMENT_LEFT);
item->set_selectable(0, false); item->set_selectable(0, false);
item->set_custom_bg_color(0, glyph_table->get_theme_color("dark_color_3", "Editor")); item->set_custom_bg_color(0, glyph_table->get_theme_color(SNAME("dark_color_3"), SNAME("Editor")));
} }
if (font_main->has_char(c)) { if (font_main->has_char(c)) {
item->set_text(col + 1, String::chr(c)); item->set_text(col + 1, String::chr(c));
item->set_custom_color(col + 1, Color(1, 1, 1)); item->set_custom_color(col + 1, Color(1, 1, 1));
if (selected_chars.has(c) || (font_main->get_data(0).is_valid() && selected_glyphs.has(font_main->get_data(0)->get_glyph_index(get_theme_font_size("font_size") * 2, c)))) { if (selected_chars.has(c) || (font_main->get_data(0).is_valid() && selected_glyphs.has(font_main->get_data(0)->get_glyph_index(get_theme_font_size(SNAME("font_size")) * 2, c)))) {
item->set_custom_color(col + 1, fcol); item->set_custom_color(col + 1, fcol);
item->set_custom_bg_color(col + 1, scol); item->set_custom_bg_color(col + 1, scol);
} else { } else {
@ -732,13 +732,13 @@ void DynamicFontImportSettings::_edit_range(int32_t p_start, int32_t p_end) {
item->clear_custom_bg_color(col + 1); item->clear_custom_bg_color(col + 1);
} }
} else { } else {
item->set_custom_bg_color(col + 1, glyph_table->get_theme_color("dark_color_2", "Editor")); item->set_custom_bg_color(col + 1, glyph_table->get_theme_color(SNAME("dark_color_2"), SNAME("Editor")));
} }
item->set_metadata(col + 1, c); item->set_metadata(col + 1, c);
item->set_text_alignment(col + 1, HORIZONTAL_ALIGNMENT_CENTER); item->set_text_alignment(col + 1, HORIZONTAL_ALIGNMENT_CENTER);
item->set_selectable(col + 1, true); item->set_selectable(col + 1, true);
item->set_custom_font(col + 1, font_main); item->set_custom_font(col + 1, font_main);
item->set_custom_font_size(col + 1, get_theme_font_size("font_size") * 2); item->set_custom_font_size(col + 1, get_theme_font_size(SNAME("font_size")) * 2);
col++; col++;
if (col == 16) { if (col == 16) {
@ -752,8 +752,8 @@ bool DynamicFontImportSettings::_char_update(int32_t p_char) {
if (selected_chars.has(p_char)) { if (selected_chars.has(p_char)) {
selected_chars.erase(p_char); selected_chars.erase(p_char);
return false; return false;
} else if (font_main->get_data(0).is_valid() && selected_glyphs.has(font_main->get_data(0)->get_glyph_index(get_theme_font_size("font_size") * 2, p_char))) { } else if (font_main->get_data(0).is_valid() && selected_glyphs.has(font_main->get_data(0)->get_glyph_index(get_theme_font_size(SNAME("font_size")) * 2, p_char))) {
selected_glyphs.erase(font_main->get_data(0)->get_glyph_index(get_theme_font_size("font_size") * 2, p_char)); selected_glyphs.erase(font_main->get_data(0)->get_glyph_index(get_theme_font_size(SNAME("font_size")) * 2, p_char));
return false; return false;
} else { } else {
selected_chars.insert(p_char); selected_chars.insert(p_char);
@ -767,7 +767,7 @@ void DynamicFontImportSettings::_range_update(int32_t p_start, int32_t p_end) {
for (int32_t i = p_start; i <= p_end; i++) { for (int32_t i = p_start; i <= p_end; i++) {
if (font_main->has_char(i)) { if (font_main->has_char(i)) {
if (font_main->get_data(0).is_valid()) { if (font_main->get_data(0).is_valid()) {
all_selected = all_selected && (selected_chars.has(i) || (font_main->get_data(0).is_valid() && selected_glyphs.has(font_main->get_data(0)->get_glyph_index(get_theme_font_size("font_size") * 2, i)))); all_selected = all_selected && (selected_chars.has(i) || (font_main->get_data(0).is_valid() && selected_glyphs.has(font_main->get_data(0)->get_glyph_index(get_theme_font_size(SNAME("font_size")) * 2, i))));
} else { } else {
all_selected = all_selected && selected_chars.has(i); all_selected = all_selected && selected_chars.has(i);
} }
@ -780,7 +780,7 @@ void DynamicFontImportSettings::_range_update(int32_t p_start, int32_t p_end) {
} else { } else {
selected_chars.erase(i); selected_chars.erase(i);
if (font_main->get_data(0).is_valid()) { if (font_main->get_data(0).is_valid()) {
selected_glyphs.erase(font_main->get_data(0)->get_glyph_index(get_theme_font_size("font_size") * 2, i)); selected_glyphs.erase(font_main->get_data(0)->get_glyph_index(get_theme_font_size(SNAME("font_size")) * 2, i));
} }
} }
} }
@ -809,7 +809,7 @@ void DynamicFontImportSettings::_lang_add_item(const String &p_locale) {
lang_item->set_checked(0, false); lang_item->set_checked(0, false);
lang_item->set_text(1, p_locale); lang_item->set_text(1, p_locale);
lang_item->set_editable(1, true); lang_item->set_editable(1, true);
lang_item->add_button(2, lang_list->get_theme_icon("Remove", "EditorIcons"), BUTTON_REMOVE_VAR, false, TTR("Remove")); lang_item->add_button(2, lang_list->get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), BUTTON_REMOVE_VAR, false, TTR("Remove"));
lang_item->set_button_color(2, 0, Color(1, 1, 1, 0.75)); lang_item->set_button_color(2, 0, Color(1, 1, 1, 0.75));
} }
@ -841,7 +841,7 @@ void DynamicFontImportSettings::_ot_add_item(int p_option) {
ot_item->set_editable(0, false); ot_item->set_editable(0, false);
ot_item->set_text(1, "1"); ot_item->set_text(1, "1");
ot_item->set_editable(1, true); ot_item->set_editable(1, true);
ot_item->add_button(2, ot_list->get_theme_icon("Remove", "EditorIcons"), BUTTON_REMOVE_VAR, false, TTR("Remove")); ot_item->add_button(2, ot_list->get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), BUTTON_REMOVE_VAR, false, TTR("Remove"));
ot_item->set_button_color(2, 0, Color(1, 1, 1, 0.75)); ot_item->set_button_color(2, 0, Color(1, 1, 1, 0.75));
} }
@ -868,7 +868,7 @@ void DynamicFontImportSettings::_script_add_item(int p_option) {
script_item->set_checked(0, false); script_item->set_checked(0, false);
script_item->set_text(1, script_codes[p_option]); script_item->set_text(1, script_codes[p_option]);
script_item->set_editable(1, true); script_item->set_editable(1, true);
script_item->add_button(2, lang_list->get_theme_icon("Remove", "EditorIcons"), BUTTON_REMOVE_VAR, false, TTR("Remove")); script_item->add_button(2, lang_list->get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), BUTTON_REMOVE_VAR, false, TTR("Remove"));
script_item->set_button_color(2, 0, Color(1, 1, 1, 0.75)); script_item->set_button_color(2, 0, Color(1, 1, 1, 0.75));
} }
@ -895,10 +895,10 @@ void DynamicFontImportSettings::_notification(int p_what) {
if (p_what == NOTIFICATION_READY) { if (p_what == NOTIFICATION_READY) {
connect("confirmed", callable_mp(this, &DynamicFontImportSettings::_re_import)); connect("confirmed", callable_mp(this, &DynamicFontImportSettings::_re_import));
} else if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { } else if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
add_lang->set_icon(add_var->get_theme_icon("Add", "EditorIcons")); add_lang->set_icon(add_var->get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
add_script->set_icon(add_var->get_theme_icon("Add", "EditorIcons")); add_script->set_icon(add_var->get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
add_var->set_icon(add_var->get_theme_icon("Add", "EditorIcons")); add_var->set_icon(add_var->get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
add_ot->set_icon(add_var->get_theme_icon("Add", "EditorIcons")); add_ot->set_icon(add_var->get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
} }
} }
@ -1043,7 +1043,7 @@ void DynamicFontImportSettings::open_settings(const String &p_path) {
inspector_vars->edit(nullptr); inspector_vars->edit(nullptr);
inspector_general->edit(nullptr); inspector_general->edit(nullptr);
int gww = get_theme_font("font")->get_string_size("00000", get_theme_font_size("font_size")).x + 50; int gww = get_theme_font(SNAME("font"))->get_string_size("00000", get_theme_font_size(SNAME("font_size"))).x + 50;
glyph_table->set_column_custom_minimum_width(0, gww); glyph_table->set_column_custom_minimum_width(0, gww);
glyph_table->clear(); glyph_table->clear();
@ -1146,7 +1146,7 @@ void DynamicFontImportSettings::open_settings(const String &p_path) {
vars_item->set_text(0, TTR("Configuration") + " " + itos(i)); vars_item->set_text(0, TTR("Configuration") + " " + itos(i));
vars_item->set_editable(0, true); vars_item->set_editable(0, true);
vars_item->add_button(1, vars_list->get_theme_icon("Remove", "EditorIcons"), BUTTON_REMOVE_VAR, false, TTR("Remove Variation")); vars_item->add_button(1, vars_list->get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), BUTTON_REMOVE_VAR, false, TTR("Remove Variation"));
vars_item->set_button_color(1, 0, Color(1, 1, 1, 0.75)); vars_item->set_button_color(1, 0, Color(1, 1, 1, 0.75));
Ref<DynamicFontImportSettingsData> import_variation_data_custom; Ref<DynamicFontImportSettingsData> import_variation_data_custom;
@ -1184,7 +1184,7 @@ void DynamicFontImportSettings::open_settings(const String &p_path) {
lang_item->set_checked(0, true); lang_item->set_checked(0, true);
lang_item->set_text(1, _langs[i]); lang_item->set_text(1, _langs[i]);
lang_item->set_editable(1, true); lang_item->set_editable(1, true);
lang_item->add_button(2, lang_list->get_theme_icon("Remove", "EditorIcons"), BUTTON_REMOVE_VAR, false, TTR("Remove")); lang_item->add_button(2, lang_list->get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), BUTTON_REMOVE_VAR, false, TTR("Remove"));
} }
} else if (key == "support_overrides/language_disabled") { } else if (key == "support_overrides/language_disabled") {
PackedStringArray _langs = config->get_value("params", key); PackedStringArray _langs = config->get_value("params", key);
@ -1197,7 +1197,7 @@ void DynamicFontImportSettings::open_settings(const String &p_path) {
lang_item->set_checked(0, false); lang_item->set_checked(0, false);
lang_item->set_text(1, _langs[i]); lang_item->set_text(1, _langs[i]);
lang_item->set_editable(1, true); lang_item->set_editable(1, true);
lang_item->add_button(2, lang_list->get_theme_icon("Remove", "EditorIcons"), BUTTON_REMOVE_VAR, false, TTR("Remove")); lang_item->add_button(2, lang_list->get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), BUTTON_REMOVE_VAR, false, TTR("Remove"));
} }
} else if (key == "support_overrides/script_enabled") { } else if (key == "support_overrides/script_enabled") {
PackedStringArray _scripts = config->get_value("params", key); PackedStringArray _scripts = config->get_value("params", key);
@ -1210,7 +1210,7 @@ void DynamicFontImportSettings::open_settings(const String &p_path) {
script_item->set_checked(0, true); script_item->set_checked(0, true);
script_item->set_text(1, _scripts[i]); script_item->set_text(1, _scripts[i]);
script_item->set_editable(1, true); script_item->set_editable(1, true);
script_item->add_button(2, lang_list->get_theme_icon("Remove", "EditorIcons"), BUTTON_REMOVE_VAR, false, TTR("Remove")); script_item->add_button(2, lang_list->get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), BUTTON_REMOVE_VAR, false, TTR("Remove"));
} }
} else if (key == "support_overrides/script_disabled") { } else if (key == "support_overrides/script_disabled") {
PackedStringArray _scripts = config->get_value("params", key); PackedStringArray _scripts = config->get_value("params", key);
@ -1223,7 +1223,7 @@ void DynamicFontImportSettings::open_settings(const String &p_path) {
script_item->set_checked(0, false); script_item->set_checked(0, false);
script_item->set_text(1, _scripts[i]); script_item->set_text(1, _scripts[i]);
script_item->set_editable(1, true); script_item->set_editable(1, true);
script_item->add_button(2, lang_list->get_theme_icon("Remove", "EditorIcons"), BUTTON_REMOVE_VAR, false, TTR("Remove")); script_item->add_button(2, lang_list->get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), BUTTON_REMOVE_VAR, false, TTR("Remove"));
} }
} else if (key == "opentype_feature_overrides") { } else if (key == "opentype_feature_overrides") {
Dictionary features = config->get_value("params", key); Dictionary features = config->get_value("params", key);
@ -1239,7 +1239,7 @@ void DynamicFontImportSettings::open_settings(const String &p_path) {
ot_item->set_editable(0, false); ot_item->set_editable(0, false);
ot_item->set_text(1, itos(value)); ot_item->set_text(1, itos(value));
ot_item->set_editable(1, true); ot_item->set_editable(1, true);
ot_item->add_button(2, ot_list->get_theme_icon("Remove", "EditorIcons"), BUTTON_REMOVE_VAR, false, TTR("Remove")); ot_item->add_button(2, ot_list->get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), BUTTON_REMOVE_VAR, false, TTR("Remove"));
ot_item->set_button_color(2, 0, Color(1, 1, 1, 0.75)); ot_item->set_button_color(2, 0, Color(1, 1, 1, 0.75));
} }
} else { } else {
@ -1356,7 +1356,7 @@ DynamicFontImportSettings::DynamicFontImportSettings() {
menu_ot->add_child(menu_ot_cu); menu_ot->add_child(menu_ot_cu);
menu_ot_cu->connect("id_pressed", callable_mp(this, &DynamicFontImportSettings::_ot_add_item)); menu_ot_cu->connect("id_pressed", callable_mp(this, &DynamicFontImportSettings::_ot_add_item));
Color warn_color = (EditorNode::get_singleton()) ? EditorNode::get_singleton()->get_gui_base()->get_theme_color("warning_color", "Editor") : Color(1, 1, 0); Color warn_color = (EditorNode::get_singleton()) ? EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("warning_color"), SNAME("Editor")) : Color(1, 1, 0);
// Root layout // Root layout
@ -1438,7 +1438,7 @@ DynamicFontImportSettings::DynamicFontImportSettings() {
add_var = memnew(Button); add_var = memnew(Button);
page2_hb_vars->add_child(add_var); page2_hb_vars->add_child(add_var);
add_var->set_tooltip(TTR("Add configuration")); add_var->set_tooltip(TTR("Add configuration"));
add_var->set_icon(add_var->get_theme_icon("Add", "EditorIcons")); add_var->set_icon(add_var->get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
add_var->connect("pressed", callable_mp(this, &DynamicFontImportSettings::_variation_add)); add_var->connect("pressed", callable_mp(this, &DynamicFontImportSettings::_variation_add));
vars_list = memnew(Tree); vars_list = memnew(Tree);
@ -1545,8 +1545,8 @@ DynamicFontImportSettings::DynamicFontImportSettings() {
for (int i = 0; i < 16; i++) { for (int i = 0; i < 16; i++) {
glyph_table->set_column_title(i + 1, String::num_int64(i, 16)); glyph_table->set_column_title(i + 1, String::num_int64(i, 16));
} }
glyph_table->add_theme_style_override("selected", glyph_table->get_theme_stylebox("bg")); glyph_table->add_theme_style_override("selected", glyph_table->get_theme_stylebox(SNAME("bg")));
glyph_table->add_theme_style_override("selected_focus", glyph_table->get_theme_stylebox("bg")); glyph_table->add_theme_style_override("selected_focus", glyph_table->get_theme_stylebox(SNAME("bg")));
glyph_table->add_theme_constant_override("hseparation", 0); glyph_table->add_theme_constant_override("hseparation", 0);
glyph_table->set_h_size_flags(Control::SIZE_EXPAND_FILL); glyph_table->set_h_size_flags(Control::SIZE_EXPAND_FILL);
glyph_table->set_v_size_flags(Control::SIZE_EXPAND_FILL); glyph_table->set_v_size_flags(Control::SIZE_EXPAND_FILL);
@ -1590,7 +1590,7 @@ DynamicFontImportSettings::DynamicFontImportSettings() {
add_lang = memnew(Button); add_lang = memnew(Button);
hb_lang->add_child(add_lang); hb_lang->add_child(add_lang);
add_lang->set_tooltip(TTR("Add language override")); add_lang->set_tooltip(TTR("Add language override"));
add_lang->set_icon(add_var->get_theme_icon("Add", "EditorIcons")); add_lang->set_icon(add_var->get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
add_lang->connect("pressed", callable_mp(this, &DynamicFontImportSettings::_lang_add)); add_lang->connect("pressed", callable_mp(this, &DynamicFontImportSettings::_lang_add));
lang_list = memnew(Tree); lang_list = memnew(Tree);
@ -1618,7 +1618,7 @@ DynamicFontImportSettings::DynamicFontImportSettings() {
add_script = memnew(Button); add_script = memnew(Button);
hb_script->add_child(add_script); hb_script->add_child(add_script);
add_script->set_tooltip(TTR("Add script override")); add_script->set_tooltip(TTR("Add script override"));
add_script->set_icon(add_var->get_theme_icon("Add", "EditorIcons")); add_script->set_icon(add_var->get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
add_script->connect("pressed", callable_mp(this, &DynamicFontImportSettings::_script_add)); add_script->connect("pressed", callable_mp(this, &DynamicFontImportSettings::_script_add));
script_list = memnew(Tree); script_list = memnew(Tree);
@ -1646,7 +1646,7 @@ DynamicFontImportSettings::DynamicFontImportSettings() {
add_ot = memnew(Button); add_ot = memnew(Button);
hb_ot->add_child(add_ot); hb_ot->add_child(add_ot);
add_ot->set_tooltip(TTR("Add feature override")); add_ot->set_tooltip(TTR("Add feature override"));
add_ot->set_icon(add_var->get_theme_icon("Add", "EditorIcons")); add_ot->set_icon(add_var->get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
add_ot->connect("pressed", callable_mp(this, &DynamicFontImportSettings::_ot_add)); add_ot->connect("pressed", callable_mp(this, &DynamicFontImportSettings::_ot_add));
ot_list = memnew(Tree); ot_list = memnew(Tree);

View File

@ -258,7 +258,7 @@ void ReplicationEditor::edit(MultiplayerSynchronizer *p_sync) {
Ref<Texture2D> ReplicationEditor::_get_class_icon(const Node *p_node) { Ref<Texture2D> ReplicationEditor::_get_class_icon(const Node *p_node) {
if (!p_node || !has_theme_icon(p_node->get_class(), "EditorIcons")) { if (!p_node || !has_theme_icon(p_node->get_class(), "EditorIcons")) {
return get_theme_icon("ImportFail", "EditorIcons"); return get_theme_icon(SNAME("ImportFail"), SNAME("EditorIcons"));
} }
return get_theme_icon(p_node->get_class(), "EditorIcons"); return get_theme_icon(p_node->get_class(), "EditorIcons");
} }
@ -285,7 +285,7 @@ void ReplicationEditor::_add_property(const NodePath &p_property, bool p_spawn,
icon = _get_class_icon(node); icon = _get_class_icon(node);
} }
item->set_icon(0, icon); item->set_icon(0, icon);
item->add_button(3, get_theme_icon("Remove", "EditorIcons")); item->add_button(3, get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")));
item->set_text_alignment(1, HORIZONTAL_ALIGNMENT_CENTER); item->set_text_alignment(1, HORIZONTAL_ALIGNMENT_CENTER);
item->set_cell_mode(1, TreeItem::CELL_MODE_CHECK); item->set_cell_mode(1, TreeItem::CELL_MODE_CHECK);
item->set_checked(1, p_spawn); item->set_checked(1, p_spawn);

View File

@ -220,9 +220,9 @@ void TextControlEditor::_update_control() {
} }
int current_font_size = edited_control->get_theme_font_size(edited_font_size); int current_font_size = edited_control->get_theme_font_size(edited_font_size);
int current_outline_size = edited_control->get_theme_constant("outline_size"); int current_outline_size = edited_control->get_theme_constant(SNAME("outline_size"));
Color current_font_color = edited_control->get_theme_color(edited_color); Color current_font_color = edited_control->get_theme_color(edited_color);
Color current_outline_color = edited_control->get_theme_color("font_outline_color"); Color current_outline_color = edited_control->get_theme_color(SNAME("font_outline_color"));
if (i > 0) { if (i > 0) {
same_font_size = same_font_size && (font_size == current_font_size); same_font_size = same_font_size && (font_size == current_font_size);
same_outline_size = same_outline_size && (outline_size == current_outline_size); same_outline_size = same_outline_size && (outline_size == current_outline_size);
@ -393,7 +393,7 @@ void TextControlEditor::_outline_size_selected(double p_size) {
ur->add_do_method(edited_control, "add_theme_constant_override", "outline_size", p_size); ur->add_do_method(edited_control, "add_theme_constant_override", "outline_size", p_size);
if (edited_control->has_theme_constant_override("outline_size")) { if (edited_control->has_theme_constant_override("outline_size")) {
ur->add_undo_method(edited_control, "add_theme_constant_override", "outline_size", edited_control->get_theme_constant("outline_size")); ur->add_undo_method(edited_control, "add_theme_constant_override", "outline_size", edited_control->get_theme_constant(SNAME("outline_size")));
} else { } else {
ur->add_undo_method(edited_control, "remove_theme_constant_override", "outline_size"); ur->add_undo_method(edited_control, "remove_theme_constant_override", "outline_size");
} }
@ -452,7 +452,7 @@ void TextControlEditor::_outline_color_changed(const Color &p_color) {
ur->add_do_method(edited_control, "add_theme_color_override", "font_outline_color", p_color); ur->add_do_method(edited_control, "add_theme_color_override", "font_outline_color", p_color);
if (edited_control->has_theme_color_override("font_outline_color")) { if (edited_control->has_theme_color_override("font_outline_color")) {
ur->add_undo_method(edited_control, "add_theme_color_override", "font_outline_color", edited_control->get_theme_color("font_outline_color")); ur->add_undo_method(edited_control, "add_theme_color_override", "font_outline_color", edited_control->get_theme_color(SNAME("font_outline_color")));
} else { } else {
ur->add_undo_method(edited_control, "remove_theme_color_override", "font_outline_color"); ur->add_undo_method(edited_control, "remove_theme_color_override", "font_outline_color");
} }
@ -511,12 +511,12 @@ void TextControlEditor::_clear_formatting() {
ur->add_do_method(edited_control, "remove_theme_color_override", "font_outline_color"); ur->add_do_method(edited_control, "remove_theme_color_override", "font_outline_color");
if (edited_control->has_theme_color_override("font_outline_color")) { if (edited_control->has_theme_color_override("font_outline_color")) {
ur->add_undo_method(edited_control, "add_theme_color_override", "font_outline_color", edited_control->get_theme_color("font_outline_color")); ur->add_undo_method(edited_control, "add_theme_color_override", "font_outline_color", edited_control->get_theme_color(SNAME("font_outline_color")));
} }
ur->add_do_method(edited_control, "remove_theme_constant_override", "outline_size"); ur->add_do_method(edited_control, "remove_theme_constant_override", "outline_size");
if (edited_control->has_theme_constant_override("outline_size")) { if (edited_control->has_theme_constant_override("outline_size")) {
ur->add_undo_method(edited_control, "add_theme_constant_override", "outline_size", edited_control->get_theme_constant("outline_size")); ur->add_undo_method(edited_control, "add_theme_constant_override", "outline_size", edited_control->get_theme_constant(SNAME("outline_size")));
} }
ur->add_do_method(edited_control, "end_bulk_theme_override"); ur->add_do_method(edited_control, "end_bulk_theme_override");

View File

@ -1114,14 +1114,14 @@ TreeItem *VisualScriptPropertySelector::SearchRunner::_create_class_item(TreeIte
String details = p_doc->name; String details = p_doc->name;
if (p_doc->category.begins_with("VisualScriptCustomNode/")) { if (p_doc->category.begins_with("VisualScriptCustomNode/")) {
Vector<String> path = p_doc->name.split("/"); Vector<String> path = p_doc->name.split("/");
icon = ui_service->get_theme_icon("VisualScript", "EditorIcons"); icon = ui_service->get_theme_icon(SNAME("VisualScript"), SNAME("EditorIcons"));
text_0 = path[path.size() - 1]; text_0 = path[path.size() - 1];
text_1 = "VisualScriptCustomNode"; text_1 = "VisualScriptCustomNode";
what = "VisualScriptCustomNode"; what = "VisualScriptCustomNode";
details = "CustomNode"; details = "CustomNode";
} else if (p_doc->category.begins_with("VisualScriptNode/")) { } else if (p_doc->category.begins_with("VisualScriptNode/")) {
Vector<String> path = p_doc->name.split("/"); Vector<String> path = p_doc->name.split("/");
icon = ui_service->get_theme_icon("VisualScript", "EditorIcons"); icon = ui_service->get_theme_icon(SNAME("VisualScript"), SNAME("EditorIcons"));
text_0 = path[path.size() - 1]; text_0 = path[path.size() - 1];
if (p_doc->category.begins_with("VisualScriptNode/deconstruct")) { if (p_doc->category.begins_with("VisualScriptNode/deconstruct")) {
text_0 = "deconstruct " + text_0; text_0 = "deconstruct " + text_0;