Merge pull request #57796 from akien-mga/revert-sname-theme-setters

This commit is contained in:
Rémi Verschelde
2022-02-08 11:13:24 +01:00
committed by GitHub
2 changed files with 15 additions and 15 deletions

View File

@@ -712,7 +712,7 @@ void VisualScriptEditor::_update_graph(int p_only_id) {
LineEdit *line_edit = memnew(LineEdit); LineEdit *line_edit = memnew(LineEdit);
line_edit->set_text(node->get_text()); line_edit->set_text(node->get_text());
line_edit->set_expand_to_text_length_enabled(true); line_edit->set_expand_to_text_length_enabled(true);
line_edit->add_theme_font_override(SNAME("font"), get_theme_font(SNAME("source"), SNAME("EditorFonts"))); line_edit->add_theme_font_override("font", get_theme_font(SNAME("source"), SNAME("EditorFonts")));
gnode->add_child(line_edit); gnode->add_child(line_edit);
line_edit->connect("text_changed", callable_mp(this, &VisualScriptEditor::_expression_text_changed), varray(E)); line_edit->connect("text_changed", callable_mp(this, &VisualScriptEditor::_expression_text_changed), varray(E));
} else { } else {
@@ -742,11 +742,11 @@ void VisualScriptEditor::_update_graph(int p_only_id) {
Color c = sbf->get_border_color(); Color c = sbf->get_border_color();
c = ((c.r + c.g + c.b) / 3) < 0.7 ? Color(1.0, 1.0, 1.0, 0.85) : Color(0.0, 0.0, 0.0, 0.85); c = ((c.r + c.g + c.b) / 3) < 0.7 ? Color(1.0, 1.0, 1.0, 0.85) : Color(0.0, 0.0, 0.0, 0.85);
Color ic = c; Color ic = c;
gnode->add_theme_color_override(SNAME("title_color"), c); gnode->add_theme_color_override("title_color", c);
c.a = 1; c.a = 1;
gnode->add_theme_color_override(SNAME("close_color"), c); gnode->add_theme_color_override("close_color", c);
gnode->add_theme_color_override(SNAME("resizer_color"), ic); gnode->add_theme_color_override("resizer_color", ic);
gnode->add_theme_style_override(SNAME("frame"), sbf); gnode->add_theme_style_override("frame", sbf);
} }
const Color mono_color = get_theme_color(SNAME("mono_color"), SNAME("Editor")); const Color mono_color = get_theme_color(SNAME("mono_color"), SNAME("Editor"));
@@ -2660,7 +2660,7 @@ Ref<Texture2D> VisualScriptEditor::get_theme_icon() {
icon_name += "Internal"; icon_name += "Internal";
} }
if (Control::has_theme_icon(icon_name, SNAME("EditorIcons"))) { if (Control::has_theme_icon(icon_name, "EditorIcons")) {
return Control::get_theme_icon(icon_name, SNAME("EditorIcons")); return Control::get_theme_icon(icon_name, SNAME("EditorIcons"));
} }
@@ -3930,13 +3930,13 @@ void VisualScriptEditor::_notification(int p_what) {
update_toggle_scripts_button(); update_toggle_scripts_button();
edit_variable_edit->add_theme_style_override(SNAME("bg"), get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); edit_variable_edit->add_theme_style_override("bg", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
edit_signal_edit->add_theme_style_override(SNAME("bg"), get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); edit_signal_edit->add_theme_style_override("bg", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
func_input_scroll->add_theme_style_override(SNAME("bg"), get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); func_input_scroll->add_theme_style_override("bg", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
Ref<Theme> tm = EditorNode::get_singleton()->get_theme_base()->get_theme(); Ref<Theme> tm = EditorNode::get_singleton()->get_theme_base()->get_theme();
bool dark_theme = tm->get_constant(SNAME("dark_theme"), SNAME("Editor")); bool dark_theme = tm->get_constant("dark_theme", "Editor");
if (dark_theme) { if (dark_theme) {
node_colors["flow_control"] = Color(0.96, 0.96, 0.96); node_colors["flow_control"] = Color(0.96, 0.96, 0.96);

View File

@@ -46,7 +46,7 @@
void VisualScriptPropertySelector::_update_icons() { void VisualScriptPropertySelector::_update_icons() {
search_box->set_right_icon(results_tree->get_theme_icon(SNAME("Search"), SNAME("EditorIcons"))); search_box->set_right_icon(results_tree->get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
search_box->set_clear_button_enabled(true); search_box->set_clear_button_enabled(true);
search_box->add_theme_icon_override(SNAME("right_icon"), results_tree->get_theme_icon(SNAME("Search"), SNAME("EditorIcons"))); search_box->add_theme_icon_override("right_icon", results_tree->get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
search_visual_script_nodes->set_icon(results_tree->get_theme_icon(SNAME("VisualScript"), SNAME("EditorIcons"))); search_visual_script_nodes->set_icon(results_tree->get_theme_icon(SNAME("VisualScript"), SNAME("EditorIcons")));
search_classes->set_icon(results_tree->get_theme_icon(SNAME("Object"), SNAME("EditorIcons"))); search_classes->set_icon(results_tree->get_theme_icon(SNAME("Object"), SNAME("EditorIcons")));
@@ -1142,11 +1142,11 @@ TreeItem *VisualScriptPropertySelector::SearchRunner::_create_class_item(TreeIte
} else { } else {
if (p_doc->name.is_quoted()) { if (p_doc->name.is_quoted()) {
text_0 = p_doc->name.unquote().get_file(); text_0 = p_doc->name.unquote().get_file();
if (ui_service->has_theme_icon(p_doc->inherits, SNAME("EditorIcons"))) { if (ui_service->has_theme_icon(p_doc->inherits, "EditorIcons")) {
icon = ui_service->get_theme_icon(p_doc->inherits, SNAME("EditorIcons")); icon = ui_service->get_theme_icon(p_doc->inherits, "EditorIcons");
} }
} else if (ui_service->has_theme_icon(p_doc->name, SNAME("EditorIcons"))) { } else if (ui_service->has_theme_icon(p_doc->name, "EditorIcons")) {
icon = ui_service->get_theme_icon(p_doc->name, SNAME("EditorIcons")); icon = ui_service->get_theme_icon(p_doc->name, "EditorIcons");
} else if (ClassDB::class_exists(p_doc->name) && ClassDB::is_parent_class(p_doc->name, "Object")) { } else if (ClassDB::class_exists(p_doc->name) && ClassDB::is_parent_class(p_doc->name, "Object")) {
icon = ui_service->get_theme_icon(SNAME("Object"), SNAME("EditorIcons")); icon = ui_service->get_theme_icon(SNAME("Object"), SNAME("EditorIcons"));
} }