Implement search bar for PopupMenu#114236
Conversation
c3ceaef to
3e41bb3
Compare
|
This would fix godotengine/godot-proposals#7278 |
|
This feature should be optional, and disabled by default. Currently it always enables when there are at least 10 items. |
I agree however the option should be toggled on in all areas of the editor. |
3e41bb3 to
b07225b
Compare
|
Managed to figure out how to add support for searching inside submenus. Probably not the most optimal implementation but it works (at least as much as I tested). |
Screencast_20251222_213848.webmExample |
|
I can see a regression in your video: the submenu doesn't align with the item in the parent popup anymore. Also, you need to fill in the documentation for the new functions (run the binary with |
e861ea5 to
f70fea7
Compare
b14fed3 to
8be0066
Compare
|
@YeldhamDev regression solved and docs added. |
99f932c to
b8f99ce
Compare
|
Noticed that caret jumps to the front when using up key which in this case is only desired if non of the items in scroll container are hovered over. |
284d189 to
8a1125d
Compare
e8bba09 to
13da832
Compare
|
@YeldhamDev Changed |
a public method for "clear_search_filter" should be enough, that way the user can connect on about to popup to this method |
|
I think it would be better for this to be the default behavior. Having the bar start with the old search will be more of a nuisance than useful. |
Probably can be done in a follow up PR. |
13da832 to
18e989c
Compare
|
Thanks! |
|
Also closes - Add search to the bone selection dropdown menu |
|
Excuse me, I’m wondering why the search bar not be displayed when the PopupMenu has a parent popup. godot/scene/gui/popup_menu.cpp Lines 3635 to 3643 in 6d6e822 |
|
@jinyangcruise My reasoning was recursive search. Since you can search items inside submenus, there's no need to provide search bars for submenus. |
|
Got it. That sounds like a good idea. However, this behavior is governed by the Additionally, your recursive search method checks the state of hidden sub-popups. However, the content within these sub-popups can be post-modified through the What if we let users decide? A new property such as
There might be some better options out there. |
Sounds like a bug to me. Probably submenu item count should be taken into consideration.
In any case. I'd suggest making a bug report about |
This adds an ability to search items inside PopupMenu.
Currently the search bar is only visible if there are 10 or more items.Implements proposal: godotengine/godot-proposals#13681
There are a couple of questions that I want feedback on:
activated_by_keyboardoption? Feels at least redundant in my eyes.Screencast_20251220_140018.webm