Merge pull request #116981 from Giganzo/replace-button

Fix replace button doesn't highlight next occurrence
This commit is contained in:
Thaddeus Crews 2026-03-04 11:20:44 -06:00
commit b83356283d
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC
2 changed files with 7 additions and 1 deletions

View file

@ -699,6 +699,11 @@ void FindReplaceBar::_replace_text_submitted(const String &p_text) {
}
}
void FindReplaceBar::_replace_button_pressed() {
_replace();
search_next();
}
void FindReplaceBar::_toggle_replace_pressed() {
bool replace_visible = replace_text->is_visible_in_tree();
replace_visible ? popup_search(true) : popup_replace();
@ -843,7 +848,7 @@ FindReplaceBar::FindReplaceBar() {
replace = memnew(Button);
hbc_button_replace->add_child(replace);
replace->set_text(TTRC("Replace"));
replace->connect(SceneStringName(pressed), callable_mp(this, &FindReplaceBar::_replace));
replace->connect(SceneStringName(pressed), callable_mp(this, &FindReplaceBar::_replace_button_pressed));
replace_all = memnew(Button);
hbc_button_replace->add_child(replace_all);

View file

@ -117,6 +117,7 @@ class FindReplaceBar : public HBoxContainer {
void _search_text_changed(const String &p_text);
void _search_text_submitted(const String &p_text);
void _replace_text_submitted(const String &p_text);
void _replace_button_pressed();
void _toggle_replace_pressed();
protected: