diff options
Diffstat (limited to 'editor')
26 files changed, 124 insertions, 74 deletions
diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index 6ed723b891..74fea03fee 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -1126,7 +1126,7 @@ ConnectionsDock::ConnectionsDock() { search_box = memnew(LineEdit); search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL); - search_box->set_placeholder(TTR("Filter signals")); + search_box->set_placeholder(TTR("Filter Signals")); search_box->set_clear_button_enabled(true); search_box->connect("text_changed", callable_mp(this, &ConnectionsDock::_filter_changed)); vbc->add_child(search_box); diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp index 60486b5286..8cb984af1b 100644 --- a/editor/debugger/script_editor_debugger.cpp +++ b/editor/debugger/script_editor_debugger.cpp @@ -1765,7 +1765,7 @@ ScriptEditorDebugger::ScriptEditorDebugger() { search = memnew(LineEdit); search->set_h_size_flags(Control::SIZE_EXPAND_FILL); - search->set_placeholder(TTR("Filter stack variables")); + search->set_placeholder(TTR("Filter Stack Variables")); search->set_clear_button_enabled(true); tools_hb->add_child(search); diff --git a/editor/editor_command_palette.cpp b/editor/editor_command_palette.cpp index e3cbd8ad50..c1cd7f9c7b 100644 --- a/editor/editor_command_palette.cpp +++ b/editor/editor_command_palette.cpp @@ -299,7 +299,7 @@ EditorCommandPalette::EditorCommandPalette() { add_child(vbc); command_search_box = memnew(LineEdit); - command_search_box->set_placeholder(TTR("Filter commands")); + command_search_box->set_placeholder(TTR("Filter Commands")); command_search_box->connect("gui_input", callable_mp(this, &EditorCommandPalette::_sbox_input)); command_search_box->connect("text_changed", callable_mp(this, &EditorCommandPalette::_update_command_search)); command_search_box->set_v_size_flags(Control::SIZE_EXPAND_FILL); diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index dba0864fcb..19ffb6f0f5 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -73,6 +73,13 @@ void EditorHelp::_search(bool p_search_previous) { } } +void EditorHelp::_class_desc_finished() { + if (scroll_to >= 0) { + class_desc->scroll_to_paragraph(scroll_to); + } + scroll_to = -1; +} + void EditorHelp::_class_list_select(const String &p_select) { _goto_desc(p_select); } @@ -126,7 +133,11 @@ void EditorHelp::_class_desc_select(const String &p_select) { // Case order is important here to correctly handle edge cases like Variant.Type in @GlobalScope. if (table->has(link)) { // Found in the current page. - class_desc->scroll_to_paragraph((*table)[link]); + if (class_desc->is_ready()) { + class_desc->scroll_to_paragraph((*table)[link]); + } else { + scroll_to = (*table)[link]; + } } else { // Look for link in @GlobalScope. // Note that a link like @GlobalScope.enum_name will not be found in this section, only enum_name will be. @@ -1469,7 +1480,11 @@ void EditorHelp::_help_callback(const String &p_topic) { } } - class_desc->call_deferred(SNAME("scroll_to_paragraph"), line); + if (class_desc->is_ready()) { + class_desc->call_deferred(SNAME("scroll_to_paragraph"), line); + } else { + scroll_to = line; + } } static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt) { @@ -1824,7 +1839,11 @@ Vector<Pair<String, int>> EditorHelp::get_sections() { void EditorHelp::scroll_to_section(int p_section_index) { _wait_for_thread(); int line = section_line[p_section_index].second; - class_desc->scroll_to_paragraph(line); + if (class_desc->is_ready()) { + class_desc->scroll_to_paragraph(line); + } else { + scroll_to = line; + } } void EditorHelp::popup_search() { @@ -1877,6 +1896,7 @@ EditorHelp::EditorHelp() { class_desc->set_v_size_flags(SIZE_EXPAND_FILL); class_desc->add_theme_color_override("selection_color", get_theme_color(SNAME("accent_color"), SNAME("Editor")) * Color(1, 1, 1, 0.4)); + class_desc->connect("finished", callable_mp(this, &EditorHelp::_class_desc_finished)); class_desc->connect("meta_clicked", callable_mp(this, &EditorHelp::_class_desc_select)); class_desc->connect("gui_input", callable_mp(this, &EditorHelp::_class_desc_input)); class_desc->connect("resized", callable_mp(this, &EditorHelp::_class_desc_resized), varray(false)); diff --git a/editor/editor_help.h b/editor/editor_help.h index b5410f6880..766a09f485 100644 --- a/editor/editor_help.h +++ b/editor/editor_help.h @@ -140,6 +140,8 @@ class EditorHelp : public VBoxContainer { Ref<Font> doc_title_font; Ref<Font> doc_code_font; + int scroll_to = -1; + void _update_theme(); void _help_callback(const String &p_topic); @@ -152,6 +154,7 @@ class EditorHelp : public VBoxContainer { void _add_bulletpoint(); + void _class_desc_finished(); void _class_list_select(const String &p_select); void _class_desc_select(const String &p_select); void _class_desc_input(const Ref<InputEvent> &p_input); diff --git a/editor/editor_log.cpp b/editor/editor_log.cpp index 8d45f90ed6..dbe44aee1b 100644 --- a/editor/editor_log.cpp +++ b/editor/editor_log.cpp @@ -353,7 +353,7 @@ EditorLog::EditorLog() { // Search box search_box = memnew(LineEdit); search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL); - search_box->set_placeholder(TTR("Filter messages")); + search_box->set_placeholder(TTR("Filter Messages")); search_box->set_clear_button_enabled(true); search_box->set_visible(true); search_box->connect("text_changed", callable_mp(this, &EditorLog::_search_changed)); diff --git a/editor/editor_sectioned_inspector.cpp b/editor/editor_sectioned_inspector.cpp index 801a1a4641..b7073665a8 100644 --- a/editor/editor_sectioned_inspector.cpp +++ b/editor/editor_sectioned_inspector.cpp @@ -250,6 +250,11 @@ void SectionedInspector::update_category_list() { continue; } + // Filter out unnecessary ProjectSettings sections, as they already have their dedicated tabs. + if (pi.name.begins_with("autoload") || pi.name.begins_with("editor_plugins") || pi.name.begins_with("shader_globals")) { + continue; + } + if (!filter.is_empty() && !_property_path_matches(pi.name, filter, name_style)) { continue; } diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 31ce31a437..504e09aa36 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -681,6 +681,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { // Visual editors EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/visual_editors/minimap_opacity", 0.85, "0.0,1.0,0.01") + EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/visual_editors/lines_curvature", 0.5, "0.0,1.0,0.01") EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "editors/visual_editors/visualshader/port_preview_size", 160, "100,400,0.01") /* Run */ diff --git a/editor/editor_settings_dialog.cpp b/editor/editor_settings_dialog.cpp index 02bff2761d..3eb7d7ffbd 100644 --- a/editor/editor_settings_dialog.cpp +++ b/editor/editor_settings_dialog.cpp @@ -698,7 +698,7 @@ EditorSettingsDialog::EditorSettingsDialog() { tab_general->add_child(hbc); search_box = memnew(LineEdit); - search_box->set_placeholder(TTR("Search")); + search_box->set_placeholder(TTR("Filter Settings")); search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL); hbc->add_child(search_box); @@ -740,7 +740,7 @@ EditorSettingsDialog::EditorSettingsDialog() { tab_shortcuts->set_name(TTR("Shortcuts")); shortcut_search_box = memnew(LineEdit); - shortcut_search_box->set_placeholder(TTR("Search")); + shortcut_search_box->set_placeholder(TTR("Filter Shortcuts")); shortcut_search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL); tab_shortcuts->add_child(shortcut_search_box); shortcut_search_box->connect("text_changed", callable_mp(this, &EditorSettingsDialog::_filter_shortcuts)); diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 9efe7f81a0..c53c04af4e 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -1448,8 +1448,6 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_icon("snap", "GraphEdit", theme->get_icon(SNAME("SnapGrid"), SNAME("EditorIcons"))); theme->set_icon("minimap", "GraphEdit", theme->get_icon(SNAME("GridMinimap"), SNAME("EditorIcons"))); theme->set_icon("layout", "GraphEdit", theme->get_icon(SNAME("GridLayout"), SNAME("EditorIcons"))); - theme->set_constant("bezier_len_pos", "GraphEdit", 80 * EDSCALE); - theme->set_constant("bezier_len_neg", "GraphEdit", 160 * EDSCALE); // GraphEditMinimap Ref<StyleBoxFlat> style_minimap_bg = make_flat_stylebox(dark_color_1, 0, 0, 0, 0); diff --git a/editor/editor_zoom_widget.cpp b/editor/editor_zoom_widget.cpp index c8099c9a0b..e4beea5e5f 100644 --- a/editor/editor_zoom_widget.cpp +++ b/editor/editor_zoom_widget.cpp @@ -178,7 +178,7 @@ EditorZoomWidget::EditorZoomWidget() { zoom_reset->add_theme_color_override("font_outline_color", Color(0, 0, 0)); zoom_reset->add_theme_color_override("font_color", Color(1, 1, 1)); zoom_reset->connect("pressed", callable_mp(this, &EditorZoomWidget::_button_zoom_reset)); - zoom_reset->set_shortcut(ED_SHORTCUT("canvas_item_editor/zoom_reset", TTR("Zoom Reset"), KeyModifierMask::CMD | Key::KEY_0)); + zoom_reset->set_shortcut(ED_GET_SHORTCUT("canvas_item_editor/zoom_100_percent")); zoom_reset->set_shortcut_context(this); zoom_reset->set_focus_mode(FOCUS_NONE); zoom_reset->set_text_alignment(HORIZONTAL_ALIGNMENT_CENTER); diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index aaff892c2a..3dd0044ab9 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -3082,7 +3082,7 @@ FileSystemDock::FileSystemDock() { tree_search_box = memnew(LineEdit); tree_search_box->set_h_size_flags(SIZE_EXPAND_FILL); - tree_search_box->set_placeholder(TTR("Search files")); + tree_search_box->set_placeholder(TTR("Filter Files")); tree_search_box->connect("text_changed", callable_mp(this, &FileSystemDock::_search_changed), varray(tree_search_box)); toolbar2_hbc->add_child(tree_search_box); @@ -3127,7 +3127,7 @@ FileSystemDock::FileSystemDock() { file_list_search_box = memnew(LineEdit); file_list_search_box->set_h_size_flags(SIZE_EXPAND_FILL); - file_list_search_box->set_placeholder(TTR("Search files")); + file_list_search_box->set_placeholder(TTR("Filter Files")); file_list_search_box->connect("text_changed", callable_mp(this, &FileSystemDock::_search_changed), varray(file_list_search_box)); path_hb->add_child(file_list_search_box); diff --git a/editor/groups_editor.cpp b/editor/groups_editor.cpp index bbf9b11be3..f3129db65e 100644 --- a/editor/groups_editor.cpp +++ b/editor/groups_editor.cpp @@ -499,7 +499,7 @@ GroupDialog::GroupDialog() { add_filter = memnew(LineEdit); add_filter->set_h_size_flags(Control::SIZE_EXPAND_FILL); - add_filter->set_placeholder(TTR("Filter nodes")); + add_filter->set_placeholder(TTR("Filter Nodes")); add_filter_hbc->add_child(add_filter); add_filter->connect("text_changed", callable_mp(this, &GroupDialog::_add_filter_changed)); @@ -549,7 +549,7 @@ GroupDialog::GroupDialog() { remove_filter = memnew(LineEdit); remove_filter->set_h_size_flags(Control::SIZE_EXPAND_FILL); - remove_filter->set_placeholder(TTR("Filter nodes")); + remove_filter->set_placeholder(TTR("Filter Nodes")); remove_filter_hbc->add_child(remove_filter); remove_filter->connect("text_changed", callable_mp(this, &GroupDialog::_remove_filter_changed)); diff --git a/editor/inspector_dock.cpp b/editor/inspector_dock.cpp index 934d3a82b4..ad92911810 100644 --- a/editor/inspector_dock.cpp +++ b/editor/inspector_dock.cpp @@ -657,7 +657,7 @@ InspectorDock::InspectorDock(EditorData &p_editor_data) { search = memnew(LineEdit); search->set_h_size_flags(Control::SIZE_EXPAND_FILL); - search->set_placeholder(TTR("Filter properties")); + search->set_placeholder(TTR("Filter Properties")); search->set_clear_button_enabled(true); property_tools_hb->add_child(search); diff --git a/editor/plugins/animation_blend_tree_editor_plugin.cpp b/editor/plugins/animation_blend_tree_editor_plugin.cpp index 8c8505283c..5e703cf814 100644 --- a/editor/plugins/animation_blend_tree_editor_plugin.cpp +++ b/editor/plugins/animation_blend_tree_editor_plugin.cpp @@ -264,6 +264,8 @@ void AnimationNodeBlendTreeEditor::_update_graph() { float graph_minimap_opacity = EditorSettings::get_singleton()->get("editors/visual_editors/minimap_opacity"); graph->set_minimap_opacity(graph_minimap_opacity); + float graph_lines_curvature = EditorSettings::get_singleton()->get("editors/visual_editors/lines_curvature"); + graph->set_connection_lines_curvature(graph_lines_curvature); } void AnimationNodeBlendTreeEditor::_file_opened(const String &p_file) { @@ -969,6 +971,8 @@ AnimationNodeBlendTreeEditor::AnimationNodeBlendTreeEditor() { graph->connect("connection_from_empty", callable_mp(this, &AnimationNodeBlendTreeEditor::_connection_from_empty)); float graph_minimap_opacity = EditorSettings::get_singleton()->get("editors/visual_editors/minimap_opacity"); graph->set_minimap_opacity(graph_minimap_opacity); + float graph_lines_curvature = EditorSettings::get_singleton()->get("editors/visual_editors/lines_curvature"); + graph->set_connection_lines_curvature(graph_lines_curvature); VSeparator *vs = memnew(VSeparator); graph->get_zoom_hbox()->add_child(vs); diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index d7061a420a..249b3a6d6a 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -1402,9 +1402,9 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { filter = memnew(LineEdit); if (templates_only) { - filter->set_placeholder(TTR("Search templates, projects, and demos")); + filter->set_placeholder(TTR("Search Templates, Projects, and Demos")); } else { - filter->set_placeholder(TTR("Search assets (excluding templates, projects, and demos)")); + filter->set_placeholder(TTR("Search Assets (Excluding Templates, Projects, and Demos)")); } filter->set_clear_button_enabled(true); search_hb->add_child(filter); diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index a7e3d17fdc..d28629b41a 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -5295,14 +5295,12 @@ CanvasItemEditor::CanvasItemEditor() { // To ensure that scripts can parse the list of shortcuts correctly, we have to define // those shortcuts one by one. - // Resetting zoom to 100% is a duplicate shortcut of `canvas_item_editor/reset_zoom`, - // but it ensures both 1 and Ctrl + 0 can be used to reset zoom. ED_SHORTCUT("canvas_item_editor/zoom_3.125_percent", TTR("Zoom to 3.125%"), KeyModifierMask::SHIFT | Key::KEY_5); ED_SHORTCUT("canvas_item_editor/zoom_6.25_percent", TTR("Zoom to 6.25%"), KeyModifierMask::SHIFT | Key::KEY_4); ED_SHORTCUT("canvas_item_editor/zoom_12.5_percent", TTR("Zoom to 12.5%"), KeyModifierMask::SHIFT | Key::KEY_3); ED_SHORTCUT("canvas_item_editor/zoom_25_percent", TTR("Zoom to 25%"), KeyModifierMask::SHIFT | Key::KEY_2); ED_SHORTCUT("canvas_item_editor/zoom_50_percent", TTR("Zoom to 50%"), KeyModifierMask::SHIFT | Key::KEY_1); - ED_SHORTCUT("canvas_item_editor/zoom_100_percent", TTR("Zoom to 100%"), Key::KEY_1); + ED_SHORTCUT_ARRAY("canvas_item_editor/zoom_100_percent", TTR("Zoom to 100%"), { (int32_t)Key::KEY_1, (int32_t)(KeyModifierMask::CMD | Key::KEY_0) }); ED_SHORTCUT("canvas_item_editor/zoom_200_percent", TTR("Zoom to 200%"), Key::KEY_2); ED_SHORTCUT("canvas_item_editor/zoom_400_percent", TTR("Zoom to 400%"), Key::KEY_3); ED_SHORTCUT("canvas_item_editor/zoom_800_percent", TTR("Zoom to 800%"), Key::KEY_4); diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 99b810be44..b9d99fcc93 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -3674,7 +3674,7 @@ ScriptEditor::ScriptEditor() { list_split->add_child(scripts_vbox); filter_scripts = memnew(LineEdit); - filter_scripts->set_placeholder(TTR("Filter scripts")); + filter_scripts->set_placeholder(TTR("Filter Scripts")); filter_scripts->set_clear_button_enabled(true); filter_scripts->connect("text_changed", callable_mp(this, &ScriptEditor::_filter_scripts_text_changed)); scripts_vbox->add_child(filter_scripts); @@ -3717,7 +3717,7 @@ ScriptEditor::ScriptEditor() { buttons_hbox->add_child(members_overview_alphabeta_sort_button); filter_methods = memnew(LineEdit); - filter_methods->set_placeholder(TTR("Filter methods")); + filter_methods->set_placeholder(TTR("Filter Methods")); filter_methods->set_clear_button_enabled(true); filter_methods->connect("text_changed", callable_mp(this, &ScriptEditor::_filter_methods_text_changed)); overview_vbox->add_child(filter_methods); diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index a4bccf30e3..05c707c065 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -1524,6 +1524,7 @@ void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data te->set_caret_line(row); te->set_caret_column(col); te->insert_text_at_caret(res->get_path()); + te->grab_focus(); } if (d.has("type") && (String(d["type"]) == "files" || String(d["type"]) == "files_and_dirs")) { @@ -1546,6 +1547,7 @@ void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data te->set_caret_line(row); te->set_caret_column(col); te->insert_text_at_caret(text_to_drop); + te->grab_focus(); } if (d.has("type") && String(d["type"]) == "nodes") { @@ -1568,9 +1570,11 @@ void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data continue; } + bool is_unique = false; String path; if (node->is_unique_name_in_owner()) { - path = "%" + node->get_name(); + path = node->get_name(); + is_unique = true; } else { path = sn->get_path_to(node); } @@ -1583,9 +1587,9 @@ void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data String variable_name = String(node->get_name()).camelcase_to_underscore(true).validate_identifier(); if (use_type) { - text_to_drop += vformat("@onready var %s: %s = $%s\n", variable_name, node->get_class_name(), path); + text_to_drop += vformat("@onready var %s: %s = %s%s\n", variable_name, node->get_class_name(), is_unique ? "%" : "$", path); } else { - text_to_drop += vformat("@onready var %s = $%s\n", variable_name, path); + text_to_drop += vformat("@onready var %s = %s%s\n", variable_name, is_unique ? "%" : "$", path); } } } else { @@ -1600,25 +1604,29 @@ void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data continue; } + bool is_unique = false; String path; if (node->is_unique_name_in_owner()) { - path = "%" + node->get_name(); + path = node->get_name(); + is_unique = true; } else { path = sn->get_path_to(node); } + for (const String &segment : path.split("/")) { if (!segment.is_valid_identifier()) { path = path.c_escape().quote(quote_style); break; } } - text_to_drop += "$" + path; + text_to_drop += (is_unique ? "%" : "$") + path; } } te->set_caret_line(row); te->set_caret_column(col); te->insert_text_at_caret(text_to_drop); + te->grab_focus(); } if (d.has("type") && String(d["type"]) == "obj_property") { @@ -1627,6 +1635,7 @@ void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data te->set_caret_line(row); te->set_caret_column(col); te->insert_text_at_caret(text_to_drop); + te->grab_focus(); } } diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp index c814f9bb97..418115c041 100644 --- a/editor/plugins/theme_editor_plugin.cpp +++ b/editor/plugins/theme_editor_plugin.cpp @@ -834,6 +834,8 @@ void ThemeItemImportTree::_notification(int p_what) { select_icons_warning_icon->set_texture(get_theme_icon(SNAME("StatusWarning"), SNAME("EditorIcons"))); select_icons_warning->add_theme_color_override("font_color", get_theme_color(SNAME("disabled_font_color"), SNAME("Editor"))); + import_items_filter->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons"))); + // Bottom panel buttons. import_collapse_types_button->set_icon(get_theme_icon(SNAME("CollapseTree"), SNAME("EditorIcons"))); import_expand_types_button->set_icon(get_theme_icon(SNAME("ExpandTree"), SNAME("EditorIcons"))); @@ -881,15 +883,10 @@ void ThemeItemImportTree::_bind_methods() { } ThemeItemImportTree::ThemeItemImportTree() { - HBoxContainer *import_items_filter_hb = memnew(HBoxContainer); - add_child(import_items_filter_hb); - Label *import_items_filter_label = memnew(Label); - import_items_filter_label->set_text(TTR("Filter:")); - import_items_filter_hb->add_child(import_items_filter_label); import_items_filter = memnew(LineEdit); + import_items_filter->set_placeholder(TTR("Filter Items")); import_items_filter->set_clear_button_enabled(true); - import_items_filter->set_h_size_flags(Control::SIZE_EXPAND_FILL); - import_items_filter_hb->add_child(import_items_filter); + add_child(import_items_filter); import_items_filter->connect("text_changed", callable_mp(this, &ThemeItemImportTree::_filter_text_changed)); HBoxContainer *import_main_hb = memnew(HBoxContainer); diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index 6e13a31a1f..642973648e 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -1745,6 +1745,8 @@ void VisualShaderEditor::_update_graph() { float graph_minimap_opacity = EditorSettings::get_singleton()->get("editors/visual_editors/minimap_opacity"); graph->set_minimap_opacity(graph_minimap_opacity); + float graph_lines_curvature = EditorSettings::get_singleton()->get("editors/visual_editors/lines_curvature"); + graph->set_connection_lines_curvature(graph_lines_curvature); } VisualShader::Type VisualShaderEditor::get_current_shader_type() const { @@ -4675,6 +4677,8 @@ VisualShaderEditor::VisualShaderEditor() { graph->set_drag_forwarding(this); float graph_minimap_opacity = EditorSettings::get_singleton()->get("editors/visual_editors/minimap_opacity"); graph->set_minimap_opacity(graph_minimap_opacity); + float graph_lines_curvature = EditorSettings::get_singleton()->get("editors/visual_editors/lines_curvature"); + graph->set_connection_lines_curvature(graph_lines_curvature); graph->add_valid_right_disconnect_type(VisualShaderNode::PORT_TYPE_SCALAR); graph->add_valid_right_disconnect_type(VisualShaderNode::PORT_TYPE_SCALAR_INT); graph->add_valid_right_disconnect_type(VisualShaderNode::PORT_TYPE_BOOLEAN); diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index a56b6ec9d4..7fcabb1e80 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -2594,7 +2594,7 @@ ProjectManager::ProjectManager() { search_tree_vb->add_child(hb); search_box = memnew(LineEdit); - search_box->set_placeholder(TTR("Filter projects")); + search_box->set_placeholder(TTR("Filter Projects")); search_box->set_tooltip(TTR("This field filters projects by name and last path component.\nTo filter projects by name and full path, the query must contain at least one `/` character.")); search_box->connect("text_changed", callable_mp(this, &ProjectManager::_on_search_term_changed)); search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL); diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index 5238c8f50c..404199d2da 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -587,7 +587,7 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { general_editor->add_child(header); property_box = memnew(LineEdit); - property_box->set_placeholder(TTR("Select a setting or type its name")); + property_box->set_placeholder(TTR("Select a Setting or Type its Name")); property_box->set_h_size_flags(Control::SIZE_EXPAND_FILL); property_box->connect("text_changed", callable_mp(this, &ProjectSettingsEditor::_property_box_changed)); header->add_child(property_box); diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index c1cc144ff5..1ddefeba77 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -3381,7 +3381,7 @@ SceneTreeDock::SceneTreeDock(Node *p_scene_root, EditorSelection *p_editor_selec vbc->add_child(filter_hbc); filter = memnew(LineEdit); filter->set_h_size_flags(SIZE_EXPAND_FILL); - filter->set_placeholder(TTR("Filter nodes")); + filter->set_placeholder(TTR("Filter Nodes")); filter_hbc->add_child(filter); filter->add_theme_constant_override("minimum_character_width", 0); filter->connect("text_changed", callable_mp(this, &SceneTreeDock::_filter_changed)); diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index eaec3bab02..b5b70b827b 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -170,9 +170,9 @@ void SceneTreeEditor::_toggle_visible(Node *p_node) { } } -bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent, bool p_scroll_to_selected) { +void SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) { if (!p_node) { - return false; + return; } // only owned nodes are editable, since nodes can create their own (manually owned) child nodes, @@ -185,7 +185,7 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent, bool p_scroll part_of_subscene = true; //allow } else { - return false; + return; } } else { part_of_subscene = p_node != get_scene_node() && get_scene_node()->get_scene_inherited_state().is_valid() && get_scene_node()->get_scene_inherited_state()->find_node_by_path(get_scene_node()->get_path_to(p_node)) >= 0; @@ -431,29 +431,21 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent, bool p_scroll } } - bool scroll = false; - if (editor_selection) { if (editor_selection->is_selected(p_node)) { item->select(0); - scroll = p_scroll_to_selected; } } if (selected == p_node) { if (!editor_selection) { item->select(0); - scroll = p_scroll_to_selected; } item->set_as_cursor(0); } - bool keep = (filter.is_subsequence_ofn(String(p_node->get_name()))); - for (int i = 0; i < p_node->get_child_count(); i++) { - bool child_keep = _add_nodes(p_node->get_child(i), item, p_scroll_to_selected); - - keep = keep || child_keep; + _add_nodes(p_node->get_child(i), item); } if (valid_types.size()) { @@ -466,27 +458,10 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent, bool p_scroll } if (!valid) { - //item->set_selectable(0,marked_selectable); item->set_custom_color(0, get_theme_color(SNAME("disabled_font_color"), SNAME("Editor"))); item->set_selectable(0, false); } } - - if (!keep) { - if (editor_selection) { - Node *n = get_node(item->get_metadata(0)); - if (n) { - editor_selection->remove_node(n); - } - } - memdelete(item); - return false; - } else { - if (scroll) { - tree->scroll_to_item(item); - } - return true; - } } void SceneTreeEditor::_node_visibility_changed(Node *p_node) { @@ -592,13 +567,48 @@ void SceneTreeEditor::_update_tree(bool p_scroll_to_selected) { updating_tree = true; tree->clear(); if (get_scene_node()) { - _add_nodes(get_scene_node(), nullptr, p_scroll_to_selected); + _add_nodes(get_scene_node(), nullptr); last_hash = hash_djb2_one_64(0); _compute_hash(get_scene_node(), last_hash); } updating_tree = false; - tree_dirty = false; + + if (!filter.is_empty()) { + _update_filter(nullptr, p_scroll_to_selected); + } +} + +bool SceneTreeEditor::_update_filter(TreeItem *p_parent, bool p_scroll_to_selected) { + if (!p_parent) { + p_parent = tree->get_root(); + } + + bool keep = false; + for (TreeItem *child = p_parent->get_first_child(); child; child = child->get_next()) { + keep = _update_filter(child, p_scroll_to_selected) || keep; + } + + if (!keep) { + keep = filter.is_subsequence_ofn(p_parent->get_text(0)); + } + + p_parent->set_visible(keep); + if (editor_selection) { + Node *n = get_node(p_parent->get_metadata(0)); + if (keep) { + if (p_scroll_to_selected && n && editor_selection->is_selected(n)) { + tree->scroll_to_item(p_parent); + } + } else { + if (n && p_parent->is_selected(0)) { + editor_selection->remove_node(n); + p_parent->deselect(0); + } + } + } + + return keep; } void SceneTreeEditor::_compute_hash(Node *p_node, uint64_t &hash) { @@ -898,7 +908,7 @@ void SceneTreeEditor::set_marked(Node *p_marked, bool p_selectable, bool p_child void SceneTreeEditor::set_filter(const String &p_filter) { filter = p_filter; - _update_tree(true); + _update_filter(nullptr, true); } String SceneTreeEditor::get_filter() const { @@ -1211,7 +1221,7 @@ void SceneTreeEditor::set_connecting_signal(bool p_enable) { } void SceneTreeEditor::_bind_methods() { - ClassDB::bind_method(D_METHOD("_update_tree", "scroll_to_selected"), &SceneTreeEditor::_update_tree, DEFVAL(false)); // Still used by some connect_compat. + ClassDB::bind_method(D_METHOD("_update_tree"), &SceneTreeEditor::_update_tree, DEFVAL(false)); // Still used by some connect_compat. ClassDB::bind_method("_rename_node", &SceneTreeEditor::_rename_node); ClassDB::bind_method("_test_update_tree", &SceneTreeEditor::_test_update_tree); @@ -1360,7 +1370,7 @@ SceneTreeDialog::SceneTreeDialog() { filter = memnew(LineEdit); filter->set_h_size_flags(Control::SIZE_EXPAND_FILL); - filter->set_placeholder(TTR("Filter nodes")); + filter->set_placeholder(TTR("Filter Nodes")); filter->set_clear_button_enabled(true); filter->add_theme_constant_override("minimum_character_width", 0); filter->connect("text_changed", callable_mp(this, &SceneTreeDialog::_filter_changed)); diff --git a/editor/scene_tree_editor.h b/editor/scene_tree_editor.h index 60387cea3e..5d4230059c 100644 --- a/editor/scene_tree_editor.h +++ b/editor/scene_tree_editor.h @@ -73,9 +73,10 @@ class SceneTreeEditor : public Control { void _compute_hash(Node *p_node, uint64_t &hash); - bool _add_nodes(Node *p_node, TreeItem *p_parent, bool p_scroll_to_selected = false); + void _add_nodes(Node *p_node, TreeItem *p_parent); void _test_update_tree(); void _update_tree(bool p_scroll_to_selected = false); + bool _update_filter(TreeItem *p_parent = nullptr, bool p_scroll_to_selected = false); void _tree_changed(); void _tree_process_mode_changed(); void _node_removed(Node *p_node); |