summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2020-05-17 23:27:02 +0200
committerHugo Locurcio <hugo.locurcio@hugo.pro>2020-05-17 23:28:24 +0200
commitc9abc631084cecdafb6d48d708ef06b18f70a766 (patch)
tree8d9779f8825f4ba6e2a947f52a538592e19d646a
parentd4599fff68c96e8a4f25927d1786491098a18d4e (diff)
Allow searching with keyboard input by default in PopupMenu
See discussion in https://github.com/godotengine/godot-proposals/issues/43.
-rw-r--r--scene/gui/option_button.cpp3
-rw-r--r--scene/gui/popup_menu.cpp2
2 files changed, 1 insertions, 4 deletions
diff --git a/scene/gui/option_button.cpp b/scene/gui/option_button.cpp
index e7de0f0912..5780cc5e71 100644
--- a/scene/gui/option_button.cpp
+++ b/scene/gui/option_button.cpp
@@ -334,9 +334,6 @@ OptionButton::OptionButton() {
popup = memnew(PopupMenu);
popup->hide();
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("id_focused", callable_mp(this, &OptionButton::_focused));
popup->connect("popup_hide", callable_mp((BaseButton *)this, &BaseButton::set_pressed), varray(false));
diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp
index b439d85983..6e19b820e0 100644
--- a/scene/gui/popup_menu.cpp
+++ b/scene/gui/popup_menu.cpp
@@ -1442,7 +1442,7 @@ PopupMenu::PopupMenu() {
during_grabbed_click = false;
invalidated_click = false;
- allow_search = false;
+ allow_search = true;
search_time_msec = 0;
search_string = "";