@@ -390,6 +390,18 @@ bool OptionButton::get_allow_reselect() const {
390390 return allow_reselect;
391391}
392392
393+ bool OptionButton::is_search_bar_enabled () const {
394+ return popup->is_search_bar_enabled ();
395+ }
396+
397+ void OptionButton::set_search_bar_enabled_on_item_count (int p_count) {
398+ popup->set_search_bar_enabled_on_item_count (p_count);
399+ }
400+
401+ int OptionButton::get_search_bar_enabled_on_item_count () const {
402+ return popup->get_search_bar_enabled_on_item_count ();
403+ }
404+
393405void OptionButton::add_separator (const String &p_text) {
394406 popup->add_separator (p_text);
395407}
@@ -570,6 +582,7 @@ void OptionButton::_bind_methods() {
570582 ClassDB::bind_method (D_METHOD (" set_item_metadata" , " idx" , " metadata" ), &OptionButton::set_item_metadata);
571583 ClassDB::bind_method (D_METHOD (" set_item_tooltip" , " idx" , " tooltip" ), &OptionButton::set_item_tooltip);
572584 ClassDB::bind_method (D_METHOD (" set_item_auto_translate_mode" , " idx" , " mode" ), &OptionButton::set_item_auto_translate_mode);
585+ ClassDB::bind_method (D_METHOD (" set_search_bar_enabled_on_item_count" , " counts" ), &OptionButton::set_search_bar_enabled_on_item_count);
573586 ClassDB::bind_method (D_METHOD (" get_item_text" , " idx" ), &OptionButton::get_item_text);
574587 ClassDB::bind_method (D_METHOD (" get_item_icon" , " idx" ), &OptionButton::get_item_icon);
575588 ClassDB::bind_method (D_METHOD (" get_item_id" , " idx" ), &OptionButton::get_item_id);
@@ -579,6 +592,8 @@ void OptionButton::_bind_methods() {
579592 ClassDB::bind_method (D_METHOD (" get_item_auto_translate_mode" , " idx" ), &OptionButton::get_item_auto_translate_mode);
580593 ClassDB::bind_method (D_METHOD (" is_item_disabled" , " idx" ), &OptionButton::is_item_disabled);
581594 ClassDB::bind_method (D_METHOD (" is_item_separator" , " idx" ), &OptionButton::is_item_separator);
595+ ClassDB::bind_method (D_METHOD (" is_search_bar_enabled" ), &OptionButton::is_search_bar_enabled);
596+ ClassDB::bind_method (D_METHOD (" get_search_bar_enabled_on_item_count" ), &OptionButton::get_search_bar_enabled_on_item_count);
582597 ClassDB::bind_method (D_METHOD (" add_separator" , " text" ), &OptionButton::add_separator, DEFVAL (String ()));
583598 ClassDB::bind_method (D_METHOD (" clear" ), &OptionButton::clear);
584599 ClassDB::bind_method (D_METHOD (" select" , " idx" ), &OptionButton::select);
@@ -604,6 +619,7 @@ void OptionButton::_bind_methods() {
604619 ADD_PROPERTY (PropertyInfo (Variant::INT , " selected" ), " _select_int" , " get_selected" );
605620 ADD_PROPERTY (PropertyInfo (Variant::BOOL , " fit_to_longest_item" ), " set_fit_to_longest_item" , " is_fit_to_longest_item" );
606621 ADD_PROPERTY (PropertyInfo (Variant::BOOL , " allow_reselect" ), " set_allow_reselect" , " get_allow_reselect" );
622+ ADD_PROPERTY (PropertyInfo (Variant::INT , " enable_search_bar_on_item_count" , PROPERTY_HINT_RANGE , " 0,20,1,or_greater" ), " set_search_bar_enabled_on_item_count" , " get_search_bar_enabled_on_item_count" );
607623 ADD_ARRAY_COUNT (" Items" , " item_count" , " set_item_count" , " get_item_count" , " popup/item_" );
608624
609625 ADD_SIGNAL (MethodInfo (" item_selected" , PropertyInfo (Variant::INT , " index" )));
0 commit comments