summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-06-17 02:25:41 +0200
committerGitHub <noreply@github.com>2021-06-17 02:25:41 +0200
commitbb4c464fecae268a419a91db8eec8f525e904b45 (patch)
tree3b7bd058bcc9c8062ca4f085cb2be5aff0b44197
parentcb471420cff173e030148e216cb071b51551007a (diff)
parent8ab13f8acefef73a0d68560c6866639d9ca0dc80 (diff)
Merge pull request #49258 from megalobyte/editor-fix
Fixes for documentation search
-rw-r--r--core/input/input_map.cpp8
-rw-r--r--doc/classes/Expression.xml6
-rw-r--r--doc/classes/LineEdit.xml2
-rw-r--r--doc/classes/ProjectSettings.xml2
-rw-r--r--doc/translations/classes.pot6
-rw-r--r--editor/action_map_editor.cpp2
-rw-r--r--editor/animation_track_editor.cpp4
-rw-r--r--editor/animation_track_editor.h2
-rw-r--r--editor/code_editor.cpp8
-rw-r--r--editor/code_editor.h4
-rw-r--r--editor/connections_dialog.cpp4
-rw-r--r--editor/connections_dialog.h2
-rw-r--r--editor/editor_audio_buses.cpp2
-rw-r--r--editor/editor_autoload_settings.cpp6
-rw-r--r--editor/editor_autoload_settings.h2
-rw-r--r--editor/editor_file_dialog.cpp8
-rw-r--r--editor/editor_file_dialog.h4
-rw-r--r--editor/editor_help.cpp9
-rw-r--r--editor/editor_help.h2
-rw-r--r--editor/editor_properties.cpp6
-rw-r--r--editor/editor_properties.h2
-rw-r--r--editor/editor_spin_slider.cpp6
-rw-r--r--editor/editor_spin_slider.h2
-rw-r--r--editor/filesystem_dock.cpp2
-rw-r--r--editor/find_in_files.cpp8
-rw-r--r--editor/find_in_files.h4
-rw-r--r--editor/groups_editor.cpp4
-rw-r--r--editor/plugins/animation_blend_tree_editor_plugin.cpp2
-rw-r--r--editor/plugins/animation_player_editor_plugin.cpp2
-rw-r--r--editor/plugins/animation_state_machine_editor.cpp2
-rw-r--r--editor/plugins/asset_library_editor_plugin.h2
-rw-r--r--editor/plugins/visual_shader_editor_plugin.cpp10
-rw-r--r--editor/plugins/visual_shader_editor_plugin.h2
-rw-r--r--editor/project_export.cpp10
-rw-r--r--editor/property_editor.cpp2
-rw-r--r--editor/script_create_dialog.cpp12
-rw-r--r--editor/script_create_dialog.h2
-rw-r--r--scene/gui/color_picker.cpp6
-rw-r--r--scene/gui/color_picker.h2
-rw-r--r--scene/gui/dialogs.cpp4
-rw-r--r--scene/gui/dialogs.h2
-rw-r--r--scene/gui/file_dialog.cpp10
-rw-r--r--scene/gui/file_dialog.h4
-rw-r--r--scene/gui/line_edit.cpp8
-rw-r--r--scene/gui/rich_text_label.cpp132
-rw-r--r--scene/gui/rich_text_label.h3
-rw-r--r--scene/gui/spin_box.cpp8
-rw-r--r--scene/gui/spin_box.h2
-rw-r--r--scene/gui/tree.cpp6
-rw-r--r--scene/gui/tree.h2
50 files changed, 219 insertions, 133 deletions
diff --git a/core/input/input_map.cpp b/core/input/input_map.cpp
index 5b96babe44..c43fd64561 100644
--- a/core/input/input_map.cpp
+++ b/core/input/input_map.cpp
@@ -353,8 +353,9 @@ static const _BuiltinActionDisplayName _builtin_action_display_names[] = {
{ "ui_text_scroll_down", TTRC("Scroll Down") },
{ "ui_text_scroll_down.OSX", TTRC("Scroll Down") },
{ "ui_text_select_all", TTRC("Select All") },
- { "ui_text_select_word_under_caret", TTRC("Select Word Under Caret") },
+ { "ui_text_select_word_under_caret", TTRC("Select Word Under Caret") },
{ "ui_text_toggle_insert_mode", TTRC("Toggle Insert Mode") },
+ { "ui_text_submit", TTRC("Text Submitted") },
{ "ui_graph_duplicate", TTRC("Duplicate Nodes") },
{ "ui_graph_delete", TTRC("Delete Nodes") },
{ "ui_filedialog_up_one_level", TTRC("Go Up One Level") },
@@ -668,6 +669,11 @@ const OrderedHashMap<String, List<Ref<InputEvent>>> &InputMap::get_builtins() {
inputs.push_back(InputEventKey::create_reference(KEY_MENU));
default_builtin_cache.insert("ui_menu", inputs);
+ inputs = List<Ref<InputEvent>>();
+ inputs.push_back(InputEventKey::create_reference(KEY_ENTER));
+ inputs.push_back(InputEventKey::create_reference(KEY_KP_ENTER));
+ default_builtin_cache.insert("ui_text_submit", inputs);
+
// ///// UI Graph Shortcuts /////
inputs = List<Ref<InputEvent>>();
diff --git a/doc/classes/Expression.xml b/doc/classes/Expression.xml
index e41de4c4ed..0781d2ffa2 100644
--- a/doc/classes/Expression.xml
+++ b/doc/classes/Expression.xml
@@ -12,9 +12,9 @@
var expression = Expression.new()
func _ready():
- $LineEdit.connect("text_entered", self, "_on_text_entered")
+ $LineEdit.connect("text_submitted", self, "_on_text_submitted")
- func _on_text_entered(command):
+ func _on_text_submitted(command):
var error = expression.parse(command)
if error != OK:
print(expression.get_error_text())
@@ -28,7 +28,7 @@
public override void _Ready()
{
- GetNode("LineEdit").Connect("text_entered", this, nameof(OnTextEntered));
+ GetNode("LineEdit").Connect("text_submitted", this, nameof(OnTextEntered));
}
private void OnTextEntered(string command)
diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml
index 7adf19632e..e11ae7969a 100644
--- a/doc/classes/LineEdit.xml
+++ b/doc/classes/LineEdit.xml
@@ -248,7 +248,7 @@
Emitted when the text changes.
</description>
</signal>
- <signal name="text_entered">
+ <signal name="text_submitted">
<argument index="0" name="new_text" type="String">
</argument>
<description>
diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml
index 757f0691bf..35656d170b 100644
--- a/doc/classes/ProjectSettings.xml
+++ b/doc/classes/ProjectSettings.xml
@@ -739,6 +739,8 @@
If no selection is currently active, selects the word currently under the caret in text fields. If a selection is currently active, deselects the current selection.
[b]Note:[/b] Currently, this is only implemented in [TextEdit], not [LineEdit].
</member>
+ <member name="input/ui_text_submit" type="Dictionary" setter="" getter="">
+ </member>
<member name="input/ui_text_toggle_insert_mode" type="Dictionary" setter="" getter="">
</member>
<member name="input/ui_undo" type="Dictionary" setter="" getter="">
diff --git a/doc/translations/classes.pot b/doc/translations/classes.pot
index d12fa78b0e..f138276364 100644
--- a/doc/translations/classes.pot
+++ b/doc/translations/classes.pot
@@ -20685,9 +20685,9 @@ msgid ""
"onready var expression = Expression.new()\n"
"\n"
"func _ready():\n"
-" $LineEdit.connect(\"text_entered\", self, \"_on_text_entered\")\n"
+" $LineEdit.connect(\"text_submitted\", self, \"_on_text_submitted\")\n"
"\n"
-"func _on_text_entered(command):\n"
+"func _on_text_submitted(command):\n"
" var error = expression.parse(command, [])\n"
" if error != OK:\n"
" print(expression.get_error_text())\n"
@@ -33187,7 +33187,7 @@ msgid ""
"Examples:\n"
"[codeblock]\n"
"connect(\"pressed\", self, \"_on_Button_pressed\") # BaseButton signal\n"
-"connect(\"text_entered\", self, \"_on_LineEdit_text_entered\") # LineEdit "
+"connect(\"text_submitted\", self, \"_on_LineEdit_text_submitted\") # LineEdit "
"signal\n"
"connect(\"hit\", self, \"_on_Player_hit\", [ weapon_type, damage ]) # User-"
"defined signal\n"
diff --git a/editor/action_map_editor.cpp b/editor/action_map_editor.cpp
index cc07d589c5..b0b79ca069 100644
--- a/editor/action_map_editor.cpp
+++ b/editor/action_map_editor.cpp
@@ -1106,7 +1106,7 @@ ActionMapEditor::ActionMapEditor() {
add_edit->set_h_size_flags(Control::SIZE_EXPAND_FILL);
add_edit->set_placeholder(TTR("Add New Action"));
add_edit->set_clear_button_enabled(true);
- add_edit->connect("text_entered", callable_mp(this, &ActionMapEditor::_add_action));
+ add_edit->connect("text_submitted", callable_mp(this, &ActionMapEditor::_add_action));
add_hbox->add_child(add_edit);
Button *add_button = memnew(Button);
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp
index b26b5ce595..28453eb41d 100644
--- a/editor/animation_track_editor.cpp
+++ b/editor/animation_track_editor.cpp
@@ -2380,7 +2380,7 @@ void AnimationTrackEdit::_zoom_changed() {
play_position->update();
}
-void AnimationTrackEdit::_path_entered(const String &p_text) {
+void AnimationTrackEdit::_path_submitted(const String &p_text) {
undo_redo->create_action(TTR("Change Track Path"));
undo_redo->add_do_method(animation.ptr(), "track_set_path", track, p_text);
undo_redo->add_undo_method(animation.ptr(), "track_set_path", track, animation->track_get_path(track));
@@ -2755,7 +2755,7 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) {
path = memnew(LineEdit);
path_popup->add_child(path);
path->set_anchors_and_offsets_preset(PRESET_WIDE);
- path->connect("text_entered", callable_mp(this, &AnimationTrackEdit::_path_entered));
+ path->connect("text_submitted", callable_mp(this, &AnimationTrackEdit::_path_submitted));
}
path->set_text(animation->track_get_path(track));
diff --git a/editor/animation_track_editor.h b/editor/animation_track_editor.h
index d083235c68..6d977e5a3f 100644
--- a/editor/animation_track_editor.h
+++ b/editor/animation_track_editor.h
@@ -177,7 +177,7 @@ class AnimationTrackEdit : public Control {
void _menu_selected(int p_index);
- void _path_entered(const String &p_text);
+ void _path_submitted(const String &p_text);
void _play_position_draw();
bool _is_value_key_valid(const Variant &p_key_value, Variant::Type &r_valid_type) const;
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp
index 2b436a4202..807a45eb32 100644
--- a/editor/code_editor.cpp
+++ b/editor/code_editor.cpp
@@ -539,7 +539,7 @@ void FindReplaceBar::_search_text_changed(const String &p_text) {
search_current();
}
-void FindReplaceBar::_search_text_entered(const String &p_text) {
+void FindReplaceBar::_search_text_submitted(const String &p_text) {
if (Input::get_singleton()->is_key_pressed(KEY_SHIFT)) {
search_prev();
} else {
@@ -547,7 +547,7 @@ void FindReplaceBar::_search_text_entered(const String &p_text) {
}
}
-void FindReplaceBar::_replace_text_entered(const String &p_text) {
+void FindReplaceBar::_replace_text_submitted(const String &p_text) {
if (selection_only->is_pressed() && text_editor->is_selection_active()) {
_replace_all();
_hide_bar();
@@ -643,7 +643,7 @@ FindReplaceBar::FindReplaceBar() {
vbc_lineedit->add_child(search_text);
search_text->set_custom_minimum_size(Size2(100 * EDSCALE, 0));
search_text->connect("text_changed", callable_mp(this, &FindReplaceBar::_search_text_changed));
- search_text->connect("text_entered", callable_mp(this, &FindReplaceBar::_search_text_entered));
+ search_text->connect("text_submitted", callable_mp(this, &FindReplaceBar::_search_text_submitted));
matches_label = memnew(Label);
hbc_button_search->add_child(matches_label);
@@ -677,7 +677,7 @@ FindReplaceBar::FindReplaceBar() {
replace_text = memnew(LineEdit);
vbc_lineedit->add_child(replace_text);
replace_text->set_custom_minimum_size(Size2(100 * EDSCALE, 0));
- replace_text->connect("text_entered", callable_mp(this, &FindReplaceBar::_replace_text_entered));
+ replace_text->connect("text_submitted", callable_mp(this, &FindReplaceBar::_replace_text_submitted));
replace = memnew(Button);
hbc_button_replace->add_child(replace);
diff --git a/editor/code_editor.h b/editor/code_editor.h
index 9fc659b611..f368305e85 100644
--- a/editor/code_editor.h
+++ b/editor/code_editor.h
@@ -99,8 +99,8 @@ class FindReplaceBar : public HBoxContainer {
void _editor_text_changed();
void _search_options_changed(bool p_pressed);
void _search_text_changed(const String &p_text);
- void _search_text_entered(const String &p_text);
- void _replace_text_entered(const String &p_text);
+ void _search_text_submitted(const String &p_text);
+ void _replace_text_submitted(const String &p_text);
void _update_size();
protected:
diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp
index a17b1aec10..de6407da73 100644
--- a/editor/connections_dialog.cpp
+++ b/editor/connections_dialog.cpp
@@ -146,7 +146,7 @@ void ConnectDialog::_item_activated() {
_ok_pressed(); // From AcceptDialog.
}
-void ConnectDialog::_text_entered(const String &p_text) {
+void ConnectDialog::_text_submitted(const String &p_text) {
_ok_pressed(); // From AcceptDialog.
}
@@ -471,7 +471,7 @@ ConnectDialog::ConnectDialog() {
dst_method = memnew(LineEdit);
dst_method->set_h_size_flags(Control::SIZE_EXPAND_FILL);
- dst_method->connect("text_entered", callable_mp(this, &ConnectDialog::_text_entered));
+ dst_method->connect("text_submitted", callable_mp(this, &ConnectDialog::_text_submitted));
dstm_hb->add_child(dst_method);
advanced = memnew(CheckButton);
diff --git a/editor/connections_dialog.h b/editor/connections_dialog.h
index 18feba0a61..b9911c1cc5 100644
--- a/editor/connections_dialog.h
+++ b/editor/connections_dialog.h
@@ -105,7 +105,7 @@ private:
void ok_pressed() override;
void _cancel_pressed();
void _item_activated();
- void _text_entered(const String &_text);
+ void _text_submitted(const String &_text);
void _tree_node_selected();
void _add_bind();
void _remove_bind();
diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp
index 13296e2f23..e08334c00e 100644
--- a/editor/editor_audio_buses.cpp
+++ b/editor/editor_audio_buses.cpp
@@ -782,7 +782,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) {
set_v_size_flags(SIZE_EXPAND_FILL);
track_name = memnew(LineEdit);
- track_name->connect("text_entered", callable_mp(this, &EditorAudioBus::_name_changed));
+ track_name->connect("text_submitted", callable_mp(this, &EditorAudioBus::_name_changed));
track_name->connect("focus_exited", callable_mp(this, &EditorAudioBus::_name_focus_exit));
vb->add_child(track_name);
diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp
index 1a09b1ac7b..304c2fe532 100644
--- a/editor/editor_autoload_settings.cpp
+++ b/editor/editor_autoload_settings.cpp
@@ -327,7 +327,7 @@ void EditorAutoloadSettings::_autoload_file_callback(const String &p_path) {
add_autoload->set_disabled(false);
}
-void EditorAutoloadSettings::_autoload_text_entered(const String p_name) {
+void EditorAutoloadSettings::_autoload_text_submitted(const String p_name) {
if (autoload_add_path->get_text() != "" && _autoload_name_is_valid(p_name, nullptr)) {
_autoload_add();
}
@@ -859,7 +859,7 @@ EditorAutoloadSettings::EditorAutoloadSettings() {
autoload_add_name = memnew(LineEdit);
autoload_add_name->set_h_size_flags(SIZE_EXPAND_FILL);
- autoload_add_name->connect("text_entered", callable_mp(this, &EditorAutoloadSettings::_autoload_text_entered));
+ autoload_add_name->connect("text_submitted", callable_mp(this, &EditorAutoloadSettings::_autoload_text_submitted));
autoload_add_name->connect("text_changed", callable_mp(this, &EditorAutoloadSettings::_autoload_text_changed));
hbc->add_child(autoload_add_name);
@@ -916,7 +916,7 @@ EditorAutoloadSettings::~EditorAutoloadSettings() {
void EditorAutoloadSettings::_set_autoload_add_path(const String &p_text) {
autoload_add_path->set_text(p_text);
- autoload_add_path->emit_signal("text_entered", p_text);
+ autoload_add_path->emit_signal("text_submitted", p_text);
}
void EditorAutoloadSettings::_browse_autoload_add_path() {
diff --git a/editor/editor_autoload_settings.h b/editor/editor_autoload_settings.h
index 762457463c..b709728856 100644
--- a/editor/editor_autoload_settings.h
+++ b/editor/editor_autoload_settings.h
@@ -81,7 +81,7 @@ class EditorAutoloadSettings : public VBoxContainer {
void _autoload_button_pressed(Object *p_item, int p_column, int p_button);
void _autoload_activated();
void _autoload_path_text_changed(const String p_path);
- void _autoload_text_entered(const String p_name);
+ void _autoload_text_submitted(const String p_name);
void _autoload_text_changed(const String p_name);
void _autoload_open(const String &fpath);
void _autoload_file_callback(const String &p_path);
diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp
index 991d76ce72..f3cee7576d 100644
--- a/editor/editor_file_dialog.cpp
+++ b/editor/editor_file_dialog.cpp
@@ -230,14 +230,14 @@ void EditorFileDialog::update_dir() {
}
}
-void EditorFileDialog::_dir_entered(String p_dir) {
+void EditorFileDialog::_dir_submitted(String p_dir) {
dir_access->change_dir(p_dir);
invalidate();
update_dir();
_push_history();
}
-void EditorFileDialog::_file_entered(const String &p_file) {
+void EditorFileDialog::_file_submitted(const String &p_file) {
_action_pressed();
}
@@ -1676,8 +1676,8 @@ EditorFileDialog::EditorFileDialog() {
item_list->connect("multi_selected", callable_mp(this, &EditorFileDialog::_multi_selected), varray(), CONNECT_DEFERRED);
item_list->connect("item_activated", callable_mp(this, &EditorFileDialog::_item_dc_selected), varray());
item_list->connect("nothing_selected", callable_mp(this, &EditorFileDialog::_items_clear_selection));
- dir->connect("text_entered", callable_mp(this, &EditorFileDialog::_dir_entered));
- file->connect("text_entered", callable_mp(this, &EditorFileDialog::_file_entered));
+ dir->connect("text_submitted", callable_mp(this, &EditorFileDialog::_dir_submitted));
+ file->connect("text_submitted", callable_mp(this, &EditorFileDialog::_file_submitted));
filter->connect("item_selected", callable_mp(this, &EditorFileDialog::_filter_selected));
confirm_save = memnew(ConfirmationDialog);
diff --git a/editor/editor_file_dialog.h b/editor/editor_file_dialog.h
index f7879838d4..d789956a3e 100644
--- a/editor/editor_file_dialog.h
+++ b/editor/editor_file_dialog.h
@@ -167,8 +167,8 @@ private:
void _item_menu_id_pressed(int p_option);
void _select_drive(int p_idx);
- void _dir_entered(String p_dir);
- void _file_entered(const String &p_file);
+ void _dir_submitted(String p_dir);
+ void _file_submitted(const String &p_file);
void _action_pressed();
void _save_confirm_pressed();
void _cancel_pressed();
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp
index 9361981db6..7365e8fd7d 100644
--- a/editor/editor_help.cpp
+++ b/editor/editor_help.cpp
@@ -1761,7 +1761,7 @@ FindBar::FindBar() {
search_text->set_custom_minimum_size(Size2(100 * EDSCALE, 0));
search_text->set_h_size_flags(SIZE_EXPAND_FILL);
search_text->connect("text_changed", callable_mp(this, &FindBar::_search_text_changed));
- search_text->connect("text_entered", callable_mp(this, &FindBar::_search_text_entered));
+ search_text->connect("text_submitted", callable_mp(this, &FindBar::_search_text_submitted));
matches_label = memnew(Label);
add_child(matches_label);
@@ -1849,9 +1849,6 @@ bool FindBar::_search(bool p_search_previous) {
bool keep = prev_search == stext;
bool ret = rich_text_label->search(stext, keep, p_search_previous);
- if (!ret) {
- ret = rich_text_label->search(stext, false, p_search_previous);
- }
prev_search = stext;
@@ -1878,7 +1875,7 @@ void FindBar::_update_results_count() {
int from_pos = 0;
while (true) {
- int pos = full_text.find(searched, from_pos);
+ int pos = full_text.findn(searched, from_pos);
if (pos == -1) {
break;
}
@@ -1935,7 +1932,7 @@ void FindBar::_search_text_changed(const String &p_text) {
search_next();
}
-void FindBar::_search_text_entered(const String &p_text) {
+void FindBar::_search_text_submitted(const String &p_text) {
if (Input::get_singleton()->is_key_pressed(KEY_SHIFT)) {
search_prev();
} else {
diff --git a/editor/editor_help.h b/editor/editor_help.h
index 65e20f060c..69bb72c52d 100644
--- a/editor/editor_help.h
+++ b/editor/editor_help.h
@@ -61,7 +61,7 @@ class FindBar : public HBoxContainer {
void _hide_bar();
void _search_text_changed(const String &p_text);
- void _search_text_entered(const String &p_text);
+ void _search_text_submitted(const String &p_text);
void _update_results_count();
void _update_matches_label();
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp
index fd3cf662a9..3feeaec070 100644
--- a/editor/editor_properties.cpp
+++ b/editor/editor_properties.cpp
@@ -51,7 +51,7 @@ EditorPropertyNil::EditorPropertyNil() {
///////////////////// TEXT /////////////////////////
-void EditorPropertyText::_text_entered(const String &p_string) {
+void EditorPropertyText::_text_submitted(const String &p_string) {
if (updating) {
return;
}
@@ -100,7 +100,7 @@ EditorPropertyText::EditorPropertyText() {
add_child(text);
add_focusable(text);
text->connect("text_changed", callable_mp(this, &EditorPropertyText::_text_changed));
- text->connect("text_entered", callable_mp(this, &EditorPropertyText::_text_entered));
+ text->connect("text_submitted", callable_mp(this, &EditorPropertyText::_text_submitted));
string_name = false;
updating = false;
@@ -297,7 +297,7 @@ EditorPropertyPath::EditorPropertyPath() {
path = memnew(LineEdit);
path->set_structured_text_bidi_override(Control::STRUCTURED_TEXT_FILE);
path_hb->add_child(path);
- path->connect("text_entered", callable_mp(this, &EditorPropertyPath::_path_selected));
+ path->connect("text_submitted", callable_mp(this, &EditorPropertyPath::_path_selected));
path->connect("focus_exited", callable_mp(this, &EditorPropertyPath::_path_focus_exited));
path->set_h_size_flags(SIZE_EXPAND_FILL);
diff --git a/editor/editor_properties.h b/editor/editor_properties.h
index 121848d936..dcde7dda3d 100644
--- a/editor/editor_properties.h
+++ b/editor/editor_properties.h
@@ -56,7 +56,7 @@ class EditorPropertyText : public EditorProperty {
bool updating;
bool string_name;
void _text_changed(const String &p_string);
- void _text_entered(const String &p_string);
+ void _text_submitted(const String &p_string);
protected:
static void _bind_methods();
diff --git a/editor/editor_spin_slider.cpp b/editor/editor_spin_slider.cpp
index 657dcfa760..4f0d75ecce 100644
--- a/editor/editor_spin_slider.cpp
+++ b/editor/editor_spin_slider.cpp
@@ -386,8 +386,8 @@ void EditorSpinSlider::_evaluate_input_text() {
set_value(v);
}
-//text_entered signal
-void EditorSpinSlider::_value_input_entered(const String &p_text) {
+//text_submitted signal
+void EditorSpinSlider::_value_input_submitted(const String &p_text) {
value_input_just_closed = true;
value_input_popup->hide();
}
@@ -510,7 +510,7 @@ EditorSpinSlider::EditorSpinSlider() {
value_input_popup->set_wrap_controls(true);
value_input->set_anchors_and_offsets_preset(PRESET_WIDE);
value_input_popup->connect("popup_hide", callable_mp(this, &EditorSpinSlider::_value_input_closed));
- value_input->connect("text_entered", callable_mp(this, &EditorSpinSlider::_value_input_entered));
+ value_input->connect("text_submitted", callable_mp(this, &EditorSpinSlider::_value_input_submitted));
value_input->connect("focus_exited", callable_mp(this, &EditorSpinSlider::_value_focus_exited));
value_input_just_closed = false;
hide_slider = false;
diff --git a/editor/editor_spin_slider.h b/editor/editor_spin_slider.h
index 248a13f7b6..50d04c9583 100644
--- a/editor/editor_spin_slider.h
+++ b/editor/editor_spin_slider.h
@@ -68,7 +68,7 @@ class EditorSpinSlider : public Range {
void _grabber_gui_input(const Ref<InputEvent> &p_event);
void _value_input_closed();
- void _value_input_entered(const String &);
+ void _value_input_submitted(const String &);
void _value_focus_exited();
bool hide_slider;
bool flat;
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp
index 46bb6a1632..fe1fa9f9d6 100644
--- a/editor/filesystem_dock.cpp
+++ b/editor/filesystem_dock.cpp
@@ -365,7 +365,7 @@ void FileSystemDock::_notification(int p_what) {
file_list_popup->connect("id_pressed", callable_mp(this, &FileSystemDock::_file_list_rmb_option));
tree_popup->connect("id_pressed", callable_mp(this, &FileSystemDock::_tree_rmb_option));
- current_path->connect("text_entered", callable_mp(this, &FileSystemDock::_navigate_to_path), make_binds(false));
+ current_path->connect("text_submitted", callable_mp(this, &FileSystemDock::_navigate_to_path), make_binds(false));
always_show_folders = bool(EditorSettings::get_singleton()->get("docks/filesystem/always_show_folders"));
diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp
index 17d24a295c..c29b5d5906 100644
--- a/editor/find_in_files.cpp
+++ b/editor/find_in_files.cpp
@@ -311,7 +311,7 @@ FindInFilesDialog::FindInFilesDialog() {
_search_text_line_edit = memnew(LineEdit);
_search_text_line_edit->set_h_size_flags(Control::SIZE_EXPAND_FILL);
_search_text_line_edit->connect("text_changed", callable_mp(this, &FindInFilesDialog::_on_search_text_modified));
- _search_text_line_edit->connect("text_entered", callable_mp(this, &FindInFilesDialog::_on_search_text_entered));
+ _search_text_line_edit->connect("text_submitted", callable_mp(this, &FindInFilesDialog::_on_search_text_submitted));
gc->add_child(_search_text_line_edit);
_replace_label = memnew(Label);
@@ -321,7 +321,7 @@ FindInFilesDialog::FindInFilesDialog() {
_replace_text_line_edit = memnew(LineEdit);
_replace_text_line_edit->set_h_size_flags(Control::SIZE_EXPAND_FILL);
- _replace_text_line_edit->connect("text_entered", callable_mp(this, &FindInFilesDialog::_on_replace_text_entered));
+ _replace_text_line_edit->connect("text_submitted", callable_mp(this, &FindInFilesDialog::_on_replace_text_submitted));
_replace_text_line_edit->hide();
gc->add_child(_replace_text_line_edit);
@@ -503,7 +503,7 @@ void FindInFilesDialog::_on_search_text_modified(String text) {
_replace_button->set_disabled(get_search_text().is_empty());
}
-void FindInFilesDialog::_on_search_text_entered(String text) {
+void FindInFilesDialog::_on_search_text_submitted(String text) {
// This allows to trigger a global search without leaving the keyboard
if (!_find_button->is_disabled()) {
if (_mode == SEARCH_MODE) {
@@ -518,7 +518,7 @@ void FindInFilesDialog::_on_search_text_entered(String text) {
}
}
-void FindInFilesDialog::_on_replace_text_entered(String text) {
+void FindInFilesDialog::_on_replace_text_submitted(String text) {
// This allows to trigger a global search without leaving the keyboard
if (!_replace_button->is_disabled()) {
if (_mode == REPLACE_MODE) {
diff --git a/editor/find_in_files.h b/editor/find_in_files.h
index b9d60a8d4f..488f14a922 100644
--- a/editor/find_in_files.h
+++ b/editor/find_in_files.h
@@ -128,8 +128,8 @@ private:
void _on_folder_button_pressed();
void _on_folder_selected(String path);
void _on_search_text_modified(String text);
- void _on_search_text_entered(String text);
- void _on_replace_text_entered(String text);
+ void _on_search_text_submitted(String text);
+ void _on_replace_text_submitted(String text);
FindInFilesMode _mode;
LineEdit *_search_text_line_edit;
diff --git a/editor/groups_editor.cpp b/editor/groups_editor.cpp
index d8e5a05c5d..1b11ec4451 100644
--- a/editor/groups_editor.cpp
+++ b/editor/groups_editor.cpp
@@ -446,7 +446,7 @@ GroupDialog::GroupDialog() {
add_group_text = memnew(LineEdit);
chbc->add_child(add_group_text);
add_group_text->set_h_size_flags(Control::SIZE_EXPAND_FILL);
- add_group_text->connect("text_entered", callable_mp(this, &GroupDialog::_add_group_pressed));
+ add_group_text->connect("text_submitted", callable_mp(this, &GroupDialog::_add_group_pressed));
Button *add_group_button = memnew(Button);
add_group_button->set_text(TTR("Add"));
@@ -689,7 +689,7 @@ GroupsEditor::GroupsEditor() {
group_name = memnew(LineEdit);
group_name->set_h_size_flags(Control::SIZE_EXPAND_FILL);
hbc->add_child(group_name);
- group_name->connect("text_entered", callable_mp(this, &GroupsEditor::_add_group));
+ group_name->connect("text_submitted", callable_mp(this, &GroupsEditor::_add_group));
add = memnew(Button);
add->set_text(TTR("Add"));
diff --git a/editor/plugins/animation_blend_tree_editor_plugin.cpp b/editor/plugins/animation_blend_tree_editor_plugin.cpp
index 78c30df04b..867c701733 100644
--- a/editor/plugins/animation_blend_tree_editor_plugin.cpp
+++ b/editor/plugins/animation_blend_tree_editor_plugin.cpp
@@ -139,7 +139,7 @@ void AnimationNodeBlendTreeEditor::_update_graph() {
name->set_expand_to_text_length_enabled(true);
node->add_child(name);
node->set_slot(0, false, 0, Color(), true, 0, get_theme_color("font_color", "Label"));
- name->connect("text_entered", callable_mp(this, &AnimationNodeBlendTreeEditor::_node_renamed), varray(agnode), CONNECT_DEFERRED);
+ name->connect("text_submitted", callable_mp(this, &AnimationNodeBlendTreeEditor::_node_renamed), varray(agnode), CONNECT_DEFERRED);
name->connect("focus_exited", callable_mp(this, &AnimationNodeBlendTreeEditor::_node_renamed_focus_out), varray(name, agnode), CONNECT_DEFERRED);
base = 1;
node->set_show_close_button(true);
diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp
index bd88d96a66..4a3f3212fa 100644
--- a/editor/plugins/animation_player_editor_plugin.cpp
+++ b/editor/plugins/animation_player_editor_plugin.cpp
@@ -1694,7 +1694,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor, AnimationPlay
file->connect("file_selected", callable_mp(this, &AnimationPlayerEditor::_dialog_action));
frame->connect("value_changed", callable_mp(this, &AnimationPlayerEditor::_seek_value_changed), make_binds(true, false));
- scale->connect("text_entered", callable_mp(this, &AnimationPlayerEditor::_scale_changed));
+ scale->connect("text_submitted", callable_mp(this, &AnimationPlayerEditor::_scale_changed));
renaming = false;
last_active = false;
diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp
index c915276d3a..fe5a0cab4d 100644
--- a/editor/plugins/animation_state_machine_editor.cpp
+++ b/editor/plugins/animation_state_machine_editor.cpp
@@ -1329,7 +1329,7 @@ AnimationNodeStateMachineEditor::AnimationNodeStateMachineEditor() {
name_edit = memnew(LineEdit);
name_edit_popup->add_child(name_edit);
name_edit->set_anchors_and_offsets_preset(PRESET_WIDE);
- name_edit->connect("text_entered", callable_mp(this, &AnimationNodeStateMachineEditor::_name_edited));
+ name_edit->connect("text_submitted", callable_mp(this, &AnimationNodeStateMachineEditor::_name_edited));
name_edit->connect("focus_exited", callable_mp(this, &AnimationNodeStateMachineEditor::_name_edited_focus_out));
open_file = memnew(EditorFileDialog);
diff --git a/editor/plugins/asset_library_editor_plugin.h b/editor/plugins/asset_library_editor_plugin.h
index 11eae9e041..c6ca1ecd4f 100644
--- a/editor/plugins/asset_library_editor_plugin.h
+++ b/editor/plugins/asset_library_editor_plugin.h
@@ -282,7 +282,7 @@ class EditorAssetLibrary : public PanelContainer {
void _search(int p_page = 0);
void _rerun_search(int p_ignore);
void _search_text_changed(const String &p_text = "");
- void _search_text_entered(const String &p_text = "");
+ void _search_text_submitted(const String &p_text = "");
void _api_request(const String &p_request, RequestType p_request_type, const String &p_arguments = "");
void _http_request_completed(int p_status, int p_code, const PackedStringArray &headers, const PackedByteArray &p_data);
void _http_download_completed(int p_status, int p_code, const PackedStringArray &headers, const PackedByteArray &p_data);
diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp
index 237cd83b84..e393f960bd 100644
--- a/editor/plugins/visual_shader_editor_plugin.cpp
+++ b/editor/plugins/visual_shader_editor_plugin.cpp
@@ -432,7 +432,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id) {
register_uniform_name(p_id, uniform_name);
uniform_name->set_text(uniform->get_uniform_name());
node->add_child(uniform_name);
- uniform_name->connect("text_entered", callable_mp(VisualShaderEditor::get_singleton(), &VisualShaderEditor::_uniform_line_edit_changed), varray(p_id));
+ uniform_name->connect("text_submitted", callable_mp(VisualShaderEditor::get_singleton(), &VisualShaderEditor::_uniform_line_edit_changed), varray(p_id));
uniform_name->connect("focus_exited", callable_mp(VisualShaderEditor::get_singleton(), &VisualShaderEditor::_uniform_line_edit_focus_out), varray(uniform_name, p_id));
if (vsnode->get_input_port_count() == 0 && vsnode->get_output_port_count() == 1 && vsnode->get_output_port_name(0) == "") {
@@ -666,7 +666,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id) {
name_box->set_custom_minimum_size(Size2(65 * EDSCALE, 0));
name_box->set_h_size_flags(Control::SIZE_EXPAND_FILL);
name_box->set_text(name_left);
- name_box->connect("text_entered", callable_mp(VisualShaderEditor::get_singleton(), &VisualShaderEditor::_change_input_port_name), varray(name_box, p_id, i), CONNECT_DEFERRED);
+ name_box->connect("text_submitted", callable_mp(VisualShaderEditor::get_singleton(), &VisualShaderEditor::_change_input_port_name), varray(name_box, p_id, i), CONNECT_DEFERRED);
name_box->connect("focus_exited", callable_mp(VisualShaderEditor::get_singleton(), &VisualShaderEditor::_port_name_focus_out), varray(name_box, p_id, i, false), CONNECT_DEFERRED);
Button *remove_btn = memnew(Button);
@@ -707,7 +707,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id) {
name_box->set_custom_minimum_size(Size2(65 * EDSCALE, 0));
name_box->set_h_size_flags(Control::SIZE_EXPAND_FILL);
name_box->set_text(name_right);
- name_box->connect("text_entered", callable_mp(VisualShaderEditor::get_singleton(), &VisualShaderEditor::_change_output_port_name), varray(name_box, p_id, i), CONNECT_DEFERRED);
+ name_box->connect("text_submitted", callable_mp(VisualShaderEditor::get_singleton(), &VisualShaderEditor::_change_output_port_name), varray(name_box, p_id, i), CONNECT_DEFERRED);
name_box->connect("focus_exited", callable_mp(VisualShaderEditor::get_singleton(), &VisualShaderEditor::_port_name_focus_out), varray(name_box, p_id, i, true), CONNECT_DEFERRED);
OptionButton *type_box = memnew(OptionButton);
@@ -1855,7 +1855,7 @@ void VisualShaderEditor::_comment_title_text_changed(const String &p_new_text) {
comment_title_change_popup->set_size(Size2(-1, -1));
}
-void VisualShaderEditor::_comment_title_text_entered(const String &p_new_text) {
+void VisualShaderEditor::_comment_title_text_submitted(const String &p_new_text) {
comment_title_change_popup->hide();
}
@@ -3944,7 +3944,7 @@ VisualShaderEditor::VisualShaderEditor() {
comment_title_change_edit = memnew(LineEdit);
comment_title_change_edit->set_expand_to_text_length_enabled(true);
comment_title_change_edit->connect("text_changed", callable_mp(this, &VisualShaderEditor::_comment_title_text_changed));
- comment_title_change_edit->connect("text_entered", callable_mp(this, &VisualShaderEditor::_comment_title_text_entered));
+ comment_title_change_edit->connect("text_submitted", callable_mp(this, &VisualShaderEditor::_comment_title_text_submitted));
comment_title_change_popup->add_child(comment_title_change_edit);
comment_title_change_edit->set_size(Size2(-1, -1));
comment_title_change_popup->set_size(Size2(-1, -1));
diff --git a/editor/plugins/visual_shader_editor_plugin.h b/editor/plugins/visual_shader_editor_plugin.h
index fa98c6b780..4c7489a694 100644
--- a/editor/plugins/visual_shader_editor_plugin.h
+++ b/editor/plugins/visual_shader_editor_plugin.h
@@ -358,7 +358,7 @@ class VisualShaderEditor : public VBoxContainer {
void _comment_title_popup_hide();
void _comment_title_popup_focus_out();
void _comment_title_text_changed(const String &p_new_text);
- void _comment_title_text_entered(const String &p_new_text);
+ void _comment_title_text_submitted(const String &p_new_text);
void _comment_desc_popup_show(const Point2 &p_position, int p_node_id);
void _comment_desc_popup_hide();
diff --git a/editor/project_export.cpp b/editor/project_export.cpp
index 7ca2d4d324..ec65694772 100644
--- a/editor/project_export.cpp
+++ b/editor/project_export.cpp
@@ -871,10 +871,10 @@ void ProjectExportDialog::_validate_export_path(const String &p_path) {
if (invalid_path) {
export_project->get_ok_button()->set_disabled(true);
- export_project->get_line_edit()->disconnect("text_entered", Callable(export_project, "_file_entered"));
+ export_project->get_line_edit()->disconnect("text_submitted", Callable(export_project, "_file_submitted"));
} else {
export_project->get_ok_button()->set_disabled(false);
- export_project->get_line_edit()->connect("text_entered", Callable(export_project, "_file_entered"));
+ export_project->get_line_edit()->connect("text_submitted", Callable(export_project, "_file_submitted"));
}
}
@@ -905,10 +905,10 @@ void ProjectExportDialog::_export_project() {
// Ensure that signal is connected if previous attempt left it disconnected
// with _validate_export_path.
// FIXME: This is a hack, we should instead change EditorFileDialog to allow
- // disabling validation by the "text_entered" signal.
- if (!export_project->get_line_edit()->is_connected("text_entered", Callable(export_project, "_file_entered"))) {
+ // disabling validation by the "text_submitted" signal.
+ if (!export_project->get_line_edit()->is_connected("text_submitted", Callable(export_project, "_file_submitted"))) {
export_project->get_ok_button()->set_disabled(false);
- export_project->get_line_edit()->connect("text_entered", Callable(export_project, "_file_entered"));
+ export_project->get_line_edit()->connect("text_submitted", Callable(export_project, "_file_submitted"));
}
export_project->set_file_mode(EditorFileDialog::FILE_MODE_SAVE_FILE);
diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp
index c44f8d9a4b..ba3c9aafb4 100644
--- a/editor/property_editor.cpp
+++ b/editor/property_editor.cpp
@@ -1781,7 +1781,7 @@ CustomPropertyEditor::CustomPropertyEditor() {
value_hboxes[hbox_idx]->add_child(value_editor[i]);
value_editor[i]->set_h_size_flags(Control::SIZE_EXPAND_FILL);
value_editor[i]->hide();
- value_editor[i]->connect("text_entered", callable_mp(this, &CustomPropertyEditor::_modified));
+ value_editor[i]->connect("text_submitted", callable_mp(this, &CustomPropertyEditor::_modified));
value_editor[i]->connect("focus_entered", callable_mp(this, &CustomPropertyEditor::_focus_enter));
value_editor[i]->connect("focus_exited", callable_mp(this, &CustomPropertyEditor::_focus_exit));
}
diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp
index 650decfd49..01743bccab 100644
--- a/editor/script_create_dialog.cpp
+++ b/editor/script_create_dialog.cpp
@@ -602,7 +602,7 @@ void ScriptCreateDialog::_path_changed(const String &p_path) {
_update_dialog();
}
-void ScriptCreateDialog::_path_entered(const String &p_path) {
+void ScriptCreateDialog::_path_submitted(const String &p_path) {
ok_pressed();
}
@@ -731,13 +731,13 @@ void ScriptCreateDialog::_update_dialog() {
get_ok_button()->set_disabled(!script_ok);
- Callable entered_call = callable_mp(this, &ScriptCreateDialog::_path_entered);
+ Callable entered_call = callable_mp(this, &ScriptCreateDialog::_path_submitted);
if (script_ok) {
- if (!file_path->is_connected("text_entered", entered_call)) {
- file_path->connect("text_entered", entered_call);
+ if (!file_path->is_connected("text_submitted", entered_call)) {
+ file_path->connect("text_submitted", entered_call);
}
- } else if (file_path->is_connected("text_entered", entered_call)) {
- file_path->disconnect("text_entered", entered_call);
+ } else if (file_path->is_connected("text_submitted", entered_call)) {
+ file_path->disconnect("text_submitted", entered_call);
}
}
diff --git a/editor/script_create_dialog.h b/editor/script_create_dialog.h
index d6417b9d33..a020be0478 100644
--- a/editor/script_create_dialog.h
+++ b/editor/script_create_dialog.h
@@ -105,7 +105,7 @@ class ScriptCreateDialog : public ConfirmationDialog {
void _path_hbox_sorted();
bool _can_be_built_in();
void _path_changed(const String &p_path = String());
- void _path_entered(const String &p_path = String());
+ void _path_submitted(const String &p_path = String());
void _lang_changed(int l = 0);
void _built_in_pressed();
bool _validate_parent(const String &p_string);
diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp
index c0b4563615..f394b9e3a5 100644
--- a/scene/gui/color_picker.cpp
+++ b/scene/gui/color_picker.cpp
@@ -289,7 +289,7 @@ void ColorPicker::_value_changed(double) {
emit_signal("color_changed", color);
}
-void ColorPicker::_html_entered(const String &p_html) {
+void ColorPicker::_html_submitted(const String &p_html) {
if (updating || text_is_constructor || !c_text->is_visible()) {
return;
}
@@ -1041,7 +1041,7 @@ void ColorPicker::_html_focus_exit() {
if (c_text->get_menu()->is_visible()) {
return;
}
- _html_entered(c_text->get_text());
+ _html_submitted(c_text->get_text());
_focus_exit();
}
@@ -1204,7 +1204,7 @@ ColorPicker::ColorPicker() :
hhb->add_child(c_text);
c_text->set_h_size_flags(SIZE_EXPAND_FILL);
- c_text->connect("text_entered", callable_mp(this, &ColorPicker::_html_entered));
+ c_text->connect("text_submitted", callable_mp(this, &ColorPicker::_html_submitted));
c_text->connect("focus_entered", callable_mp(this, &ColorPicker::_focus_enter));
c_text->connect("focus_exited", callable_mp(this, &ColorPicker::_html_focus_exit));
diff --git a/scene/gui/color_picker.h b/scene/gui/color_picker.h
index 14113467d0..3bd2ff9375 100644
--- a/scene/gui/color_picker.h
+++ b/scene/gui/color_picker.h
@@ -104,7 +104,7 @@ private:
float v = 0.0;
Color last_hsv;
- void _html_entered(const String &p_html);
+ void _html_submitted(const String &p_html);
void _value_changed(double);
void _update_controls();
void _update_color(bool p_update_sliders = true);
diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp
index 7cae091c57..f63ae7569f 100644
--- a/scene/gui/dialogs.cpp
+++ b/scene/gui/dialogs.cpp
@@ -97,7 +97,7 @@ void AcceptDialog::_notification(int p_what) {
}
}
-void AcceptDialog::_text_entered(const String &p_text) {
+void AcceptDialog::_text_submitted(const String &p_text) {
_ok_pressed();
}
@@ -159,7 +159,7 @@ void AcceptDialog::register_text_enter(Control *p_line_edit) {
ERR_FAIL_NULL(p_line_edit);
LineEdit *line_edit = Object::cast_to<LineEdit>(p_line_edit);
if (line_edit) {
- line_edit->connect("text_entered", callable_mp(this, &AcceptDialog::_text_entered));
+ line_edit->connect("text_submitted", callable_mp(this, &AcceptDialog::_text_submitted));
}
}
diff --git a/scene/gui/dialogs.h b/scene/gui/dialogs.h
index 69035001c0..d389806fff 100644
--- a/scene/gui/dialogs.h
+++ b/scene/gui/dialogs.h
@@ -69,7 +69,7 @@ protected:
virtual void custom_action(const String &) {}
// Not private since used by derived classes signal.
- void _text_entered(const String &p_text);
+ void _text_submitted(const String &p_text);
void _ok_pressed();
void _cancel_pressed();
diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp
index 806039d7ac..f8cee6daec 100644
--- a/scene/gui/file_dialog.cpp
+++ b/scene/gui/file_dialog.cpp
@@ -116,7 +116,7 @@ void FileDialog::_unhandled_input(const Ref<InputEvent> &p_event) {
invalidate();
} break;
case KEY_BACKSPACE: {
- _dir_entered("..");
+ _dir_submitted("..");
} break;
default: {
handled = false;
@@ -156,7 +156,7 @@ void FileDialog::update_dir() {
deselect_all();
}
-void FileDialog::_dir_entered(String p_dir) {
+void FileDialog::_dir_submitted(String p_dir) {
dir_access->change_dir(p_dir);
file->set_text("");
invalidate();
@@ -164,7 +164,7 @@ void FileDialog::_dir_entered(String p_dir) {
_push_history();
}
-void FileDialog::_file_entered(const String &p_file) {
+void FileDialog::_file_submitted(const String &p_file) {
_action_pressed();
}
@@ -1020,8 +1020,8 @@ FileDialog::FileDialog() {
tree->connect("cell_selected", callable_mp(this, &FileDialog::_tree_selected), varray(), CONNECT_DEFERRED);
tree->connect("item_activated", callable_mp(this, &FileDialog::_tree_item_activated), varray());
tree->connect("nothing_selected", callable_mp(this, &FileDialog::deselect_all));
- dir->connect("text_entered", callable_mp(this, &FileDialog::_dir_entered));
- file->connect("text_entered", callable_mp(this, &FileDialog::_file_entered));
+ dir->connect("text_submitted", callable_mp(this, &FileDialog::_dir_submitted));
+ file->connect("text_submitted", callable_mp(this, &FileDialog::_file_submitted));
filter->connect("item_selected", callable_mp(this, &FileDialog::_filter_selected));
confirm_save = memnew(ConfirmationDialog);
diff --git a/scene/gui/file_dialog.h b/scene/gui/file_dialog.h
index 55774b488c..7fbafc4bb4 100644
--- a/scene/gui/file_dialog.h
+++ b/scene/gui/file_dialog.h
@@ -118,8 +118,8 @@ private:
void _select_drive(int p_idx);
void _tree_item_activated();
- void _dir_entered(String p_dir);
- void _file_entered(const String &p_file);
+ void _dir_submitted(String p_dir);
+ void _file_submitted(const String &p_file);
void _action_pressed();
void _save_confirm_pressed();
void _cancel_pressed();
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index c2ed9c1a3c..089893e63b 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -357,9 +357,9 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) {
}
}
- // Default is ENTER, KP_ENTER. Cannot use ui_accept as default includes SPACE
- if (k->is_action("ui_text_newline", true)) {
- emit_signal("text_entered", text);
+ // Default is ENTER and KP_ENTER. Cannot use ui_accept as default includes SPACE
+ if (k->is_action("ui_text_submit", false)) {
+ emit_signal("text_submitted", text);
if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_VIRTUAL_KEYBOARD) && virtual_keyboard_enabled) {
DisplayServer::get_singleton()->virtual_keyboard_hide();
}
@@ -2159,7 +2159,7 @@ void LineEdit::_bind_methods() {
ADD_SIGNAL(MethodInfo("text_changed", PropertyInfo(Variant::STRING, "new_text")));
ADD_SIGNAL(MethodInfo("text_change_rejected"));
- ADD_SIGNAL(MethodInfo("text_entered", PropertyInfo(Variant::STRING, "new_text")));
+ ADD_SIGNAL(MethodInfo("text_submitted", PropertyInfo(Variant::STRING, "new_text")));
BIND_ENUM_CONSTANT(ALIGN_LEFT);
BIND_ENUM_CONSTANT(ALIGN_CENTER);
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index a2c3b4ed8a..987d05bf71 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -3452,7 +3452,30 @@ void RichTextLabel::set_selection_enabled(bool p_enabled) {
}
}
-bool RichTextLabel::_search_line(ItemFrame *p_frame, int p_line, const String &p_string, Item *p_from, Item *p_to) {
+bool RichTextLabel::_search_table(ItemTable *p_table, List<Item *>::Element *p_from, const String &p_string, bool p_reverse_search) {
+ List<Item *>::Element *E = p_from;
+ while (E != nullptr) {
+ ERR_CONTINUE(E->get()->type != ITEM_FRAME); // Children should all be frames.
+ ItemFrame *frame = static_cast<ItemFrame *>(E->get());
+ if (p_reverse_search) {
+ for (int i = frame->lines.size() - 1; i >= 0; i--) {
+ if (_search_line(frame, i, p_string, -1, p_reverse_search)) {
+ return true;
+ }
+ }
+ } else {
+ for (int i = 0; i < frame->lines.size(); i++) {
+ if (_search_line(frame, i, p_string, 0, p_reverse_search)) {
+ return true;
+ }
+ }
+ }
+ E = p_reverse_search ? E->prev() : E->next();
+ }
+ return false;
+}
+
+bool RichTextLabel::_search_line(ItemFrame *p_frame, int p_line, const String &p_string, int p_char_idx, bool p_reverse_search) {
ERR_FAIL_COND_V(p_frame == nullptr, false);
ERR_FAIL_COND_V(p_line < 0 || p_line >= p_frame->lines.size(), false);
@@ -3474,24 +3497,23 @@ bool RichTextLabel::_search_line(ItemFrame *p_frame, int p_line, const String &p
} break;
case ITEM_TABLE: {
ItemTable *table = static_cast<ItemTable *>(it);
- int idx = 0;
- for (List<Item *>::Element *E = table->subitems.front(); E; E = E->next()) {
- ERR_CONTINUE(E->get()->type != ITEM_FRAME); // Children should all be frames.
- ItemFrame *frame = static_cast<ItemFrame *>(E->get());
-
- for (int i = 0; i < frame->lines.size(); i++) {
- if (_search_line(frame, i, p_string, p_from, p_to)) {
- return true;
- }
- }
- idx++;
+ List<Item *>::Element *E = p_reverse_search ? table->subitems.back() : table->subitems.front();
+ if (_search_table(table, E, p_string, p_reverse_search)) {
+ return true;
}
} break;
default:
break;
}
}
- int sp = text.findn(p_string, 0);
+
+ int sp = -1;
+ if (p_reverse_search) {
+ sp = text.rfindn(p_string, p_char_idx);
+ } else {
+ sp = text.findn(p_string, p_char_idx);
+ }
+
if (sp != -1) {
selection.from_frame = p_frame;
selection.from_line = p_line;
@@ -3499,8 +3521,8 @@ bool RichTextLabel::_search_line(ItemFrame *p_frame, int p_line, const String &p
selection.from_char = sp;
selection.to_frame = p_frame;
selection.to_line = p_line;
- selection.to_item = _get_item_at_pos(l.from, it_to, sp + p_string.length() - 1);
- selection.to_char = sp + p_string.length() - 1;
+ selection.to_item = _get_item_at_pos(l.from, it_to, sp + p_string.length());
+ selection.to_char = sp + p_string.length();
selection.active = true;
return true;
}
@@ -3511,23 +3533,81 @@ bool RichTextLabel::_search_line(ItemFrame *p_frame, int p_line, const String &p
bool RichTextLabel::search(const String &p_string, bool p_from_selection, bool p_search_previous) {
ERR_FAIL_COND_V(!selection.enabled, false);
+ if (p_string.size() == 0) {
+ selection.active = false;
+ return false;
+ }
+
+ int char_idx = p_search_previous ? -1 : 0;
+ int current_line = 0;
+ int ending_line = main->lines.size() - 1;
if (p_from_selection && selection.active) {
- for (int i = 0; i < main->lines.size(); i++) {
- if (_search_line(main, i, p_string, selection.from_item, selection.to_item)) {
- update();
- return true;
- }
+ // First check to see if other results exist in current line
+ char_idx = p_search_previous ? selection.from_char - 1 : selection.to_char;
+ if (!(p_search_previous && char_idx < 0) &&
+ _search_line(selection.from_frame, selection.from_line, p_string, char_idx, p_search_previous)) {
+ scroll_to_line(selection.from_frame->line + selection.from_line);
+ update();
+ return true;
}
- } else {
- for (int i = 0; i < main->lines.size(); i++) {
- if (_search_line(main, i, p_string, nullptr, nullptr)) {
- update();
- return true;
+ char_idx = p_search_previous ? -1 : 0;
+
+ // Next, check to see if the current search result is in a table
+ if (selection.from_frame->parent != nullptr && selection.from_frame->parent->type == ITEM_TABLE) {
+ // Find last search result in table
+ ItemTable *parent_table = static_cast<ItemTable *>(selection.from_frame->parent);
+ List<Item *>::Element *parent_element = p_search_previous ? parent_table->subitems.back() : parent_table->subitems.front();
+
+ while (parent_element->get() != selection.from_frame) {
+ parent_element = p_search_previous ? parent_element->prev() : parent_element->next();
+ ERR_FAIL_COND_V(parent_element == nullptr, false);
+ }
+
+ // Search remainder of table
+ if (!(p_search_previous && parent_element == parent_table->subitems.front()) &&
+ parent_element != parent_table->subitems.back()) {
+ parent_element = p_search_previous ? parent_element->prev() : parent_element->next(); // Don't want to search current item
+ ERR_FAIL_COND_V(parent_element == nullptr, false);
+
+ // Search for next element
+ if (_search_table(parent_table, parent_element, p_string, p_search_previous)) {
+ scroll_to_line(selection.from_frame->line + selection.from_line);
+ update();
+ return true;
+ }
}
}
+
+ ending_line = selection.from_frame->line + selection.from_line;
+ current_line = p_search_previous ? ending_line - 1 : ending_line + 1;
+ } else if (p_search_previous) {
+ current_line = ending_line;
+ ending_line = 0;
}
- return false;
+ // Search remainder of the file
+ while (current_line != ending_line) {
+ // Wrap around
+ if (current_line < 0) {
+ current_line = main->lines.size() - 1;
+ } else if (current_line >= main->lines.size()) {
+ current_line = 0;
+ }
+
+ if (_search_line(main, current_line, p_string, char_idx, p_search_previous)) {
+ scroll_to_line(current_line);
+ update();
+ return true;
+ }
+ p_search_previous ? current_line-- : current_line++;
+ }
+
+ if (p_from_selection && selection.active) {
+ // Check contents of selection
+ return _search_line(main, current_line, p_string, char_idx, p_search_previous);
+ } else {
+ return false;
+ }
}
String RichTextLabel::_get_line_text(ItemFrame *p_frame, int p_line, Selection p_selection) const {
diff --git a/scene/gui/rich_text_label.h b/scene/gui/rich_text_label.h
index e3e457d1f2..9cf94b0cd7 100644
--- a/scene/gui/rich_text_label.h
+++ b/scene/gui/rich_text_label.h
@@ -392,7 +392,8 @@ private:
void _find_click(ItemFrame *p_frame, const Point2i &p_click, ItemFrame **r_click_frame = nullptr, int *r_click_line = nullptr, Item **r_click_item = nullptr, int *r_click_char = nullptr, bool *r_outside = nullptr);
String _get_line_text(ItemFrame *p_frame, int p_line, Selection p_sel) const;
- bool _search_line(ItemFrame *p_frame, int p_line, const String &p_string, Item *p_from, Item *p_to);
+ bool _search_line(ItemFrame *p_frame, int p_line, const String &p_string, int p_char_idx, bool p_reverse_search);
+ bool _search_table(ItemTable *p_table, List<Item *>::Element *p_from, const String &p_string, bool p_reverse_search);
void _shape_line(ItemFrame *p_frame, int p_line, const Ref<Font> &p_base_font, int p_base_font_size, int p_width, int *r_char_offset);
void _resize_line(ItemFrame *p_frame, int p_line, const Ref<Font> &p_base_font, int p_base_font_size, int p_width);
diff --git a/scene/gui/spin_box.cpp b/scene/gui/spin_box.cpp
index 9dc2afdb2d..4ac73ae6b5 100644
--- a/scene/gui/spin_box.cpp
+++ b/scene/gui/spin_box.cpp
@@ -50,7 +50,7 @@ void SpinBox::_value_changed(double) {
line_edit->set_text(value);
}
-void SpinBox::_text_entered(const String &p_string) {
+void SpinBox::_text_submitted(const String &p_string) {
Ref<Expression> expr;
expr.instance();
@@ -172,7 +172,7 @@ void SpinBox::_line_edit_focus_exit() {
return;
}
- _text_entered(line_edit->get_text());
+ _text_submitted(line_edit->get_text());
}
inline void SpinBox::_adjust_width_for_icon(const Ref<Texture2D> &icon) {
@@ -251,7 +251,7 @@ bool SpinBox::is_editable() const {
}
void SpinBox::apply() {
- _text_entered(line_edit->get_text());
+ _text_submitted(line_edit->get_text());
}
void SpinBox::_bind_methods() {
@@ -283,7 +283,7 @@ SpinBox::SpinBox() {
line_edit->set_align(LineEdit::ALIGN_LEFT);
//connect("value_changed",this,"_value_changed");
- line_edit->connect("text_entered", callable_mp(this, &SpinBox::_text_entered), Vector<Variant>(), CONNECT_DEFERRED);
+ line_edit->connect("text_submitted", callable_mp(this, &SpinBox::_text_submitted), Vector<Variant>(), CONNECT_DEFERRED);
line_edit->connect("focus_exited", callable_mp(this, &SpinBox::_line_edit_focus_exit), Vector<Variant>(), CONNECT_DEFERRED);
line_edit->connect("gui_input", callable_mp(this, &SpinBox::_line_edit_input));
diff --git a/scene/gui/spin_box.h b/scene/gui/spin_box.h
index e116adb64c..fb10379296 100644
--- a/scene/gui/spin_box.h
+++ b/scene/gui/spin_box.h
@@ -45,7 +45,7 @@ class SpinBox : public Range {
void _range_click_timeout();
void _release_mouse();
- void _text_entered(const String &p_string);
+ void _text_submitted(const String &p_string);
virtual void _value_changed(double) override;
String prefix;
String suffix;
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index f66cc13af5..26d881955b 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -2451,10 +2451,10 @@ void Tree::_text_editor_modal_close() {
return;
}
- _text_editor_enter(text_editor->get_text());
+ _text_editor_submit(text_editor->get_text());
}
-void Tree::_text_editor_enter(String p_text) {
+void Tree::_text_editor_submit(String p_text) {
popup_editor->hide();
if (!popup_edited_item) {
@@ -4554,7 +4554,7 @@ Tree::Tree() {
h_scroll->connect("value_changed", callable_mp(this, &Tree::_scroll_moved));
v_scroll->connect("value_changed", callable_mp(this, &Tree::_scroll_moved));
- text_editor->connect("text_entered", callable_mp(this, &Tree::_text_editor_enter));
+ text_editor->connect("text_submitted", callable_mp(this, &Tree::_text_editor_submit));
popup_editor->connect("popup_hide", callable_mp(this, &Tree::_text_editor_modal_close));
popup_menu->connect("id_pressed", callable_mp(this, &Tree::popup_select));
value_editor->connect("value_changed", callable_mp(this, &Tree::value_editor_changed));
diff --git a/scene/gui/tree.h b/scene/gui/tree.h
index 5176d01497..0571a605a5 100644
--- a/scene/gui/tree.h
+++ b/scene/gui/tree.h
@@ -449,7 +449,7 @@ private:
int draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2 &p_draw_size, TreeItem *p_item);
void select_single_item(TreeItem *p_selected, TreeItem *p_current, int p_col, TreeItem *p_prev = nullptr, bool *r_in_range = nullptr, bool p_force_deselect = false);
int propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, bool p_double_click, TreeItem *p_item, int p_button, const Ref<InputEventWithModifiers> &p_mod);
- void _text_editor_enter(String p_text);
+ void _text_editor_submit(String p_text);
void _text_editor_modal_close();
void value_editor_changed(double p_value);