Allow searching with keyboard input by default in PopupMenu

See discussion in https://github.com/godotengine/godot-proposals/issues/43.
This commit is contained in:
Hugo Locurcio 2020-05-17 23:27:02 +02:00
parent d4599fff68
commit c9abc63108
No known key found for this signature in database
GPG key ID: 39E8F8BE30B0A49C
2 changed files with 1 additions and 4 deletions

View file

@ -334,9 +334,6 @@ OptionButton::OptionButton() {
popup = memnew(PopupMenu); popup = memnew(PopupMenu);
popup->hide(); popup->hide();
add_child(popup); add_child(popup);
// popup->set_pass_on_modal_close_click(false);
// popup->set_notify_transform(true);
popup->set_allow_search(true);
popup->connect("index_pressed", callable_mp(this, &OptionButton::_selected)); popup->connect("index_pressed", callable_mp(this, &OptionButton::_selected));
popup->connect("id_focused", callable_mp(this, &OptionButton::_focused)); popup->connect("id_focused", callable_mp(this, &OptionButton::_focused));
popup->connect("popup_hide", callable_mp((BaseButton *)this, &BaseButton::set_pressed), varray(false)); popup->connect("popup_hide", callable_mp((BaseButton *)this, &BaseButton::set_pressed), varray(false));

View file

@ -1442,7 +1442,7 @@ PopupMenu::PopupMenu() {
during_grabbed_click = false; during_grabbed_click = false;
invalidated_click = false; invalidated_click = false;
allow_search = false; allow_search = true;
search_time_msec = 0; search_time_msec = 0;
search_string = ""; search_string = "";