Blender Git Commit Log
Git Commits -> Revision 1a8aee0
Revision 1a8aee0 by Hans Goudey (master) March 2, 2021, 17:42 (GMT) |
UI: Expose an "is first search" boolean to search button callbacks Currently when you open an RNA collection search button, like a vertex group selector, the search filter isn't applied until you start typing, in order to display every option at the start. Otherwise they wouldn't be visible, since the search filter would run for the current text. Currently this check happens in one place, but it relies on the `changed` value of `uiBut`. This is fine in the interface directory, but anywhere else it would require exposing `uiBut.changed`, which is probably too low-level to expose. The solution is adding an `is_first` argument to the search callbacks, which is nice for a few reasons: - They work at a higher level of abstraction, meaning they don't have to worry about how exactly to tell if this is the first search. - It makes it easier to do special behavior when the search menu is first opened. - Then, obviously, it makes that state accessible without including `interface_intern.h`. Needed for attribute search: T85658 Differential Revision: https://developer.blender.org/D10528 |
Commit Details:
Full Hash: 1a8aee0a7cec0c2718932fdeece9dc071689f928
Parent Commit: 5a3b7c5
Lines Changed: +55, -20
11 Modified Paths:
/source/blender/editors/include/UI_interface.h (+6, -1) (Diff)
/source/blender/editors/interface/interface.c (+10, -1) (Diff)
/source/blender/editors/interface/interface_handlers.c (+5, -1) (Diff)
/source/blender/editors/interface/interface_intern.h (+8, -1) (Diff)
/source/blender/editors/interface/interface_region_search.c (+10, -7) (Diff)
/source/blender/editors/interface/interface_templates.c (+5, -3) (Diff)
/source/blender/editors/interface/interface_template_search_menu.c (+2, -1) (Diff)
/source/blender/editors/interface/interface_template_search_operator.c (+2, -1) (Diff)
/source/blender/editors/interface/interface_utils.c (+3, -2) (Diff)
/source/blender/editors/space_node/node_select.c (+2, -1) (Diff)
/source/blender/editors/space_outliner/outliner_tools.c (+2, -1) (Diff)
/source/blender/editors/interface/interface.c (+10, -1) (Diff)
/source/blender/editors/interface/interface_handlers.c (+5, -1) (Diff)
/source/blender/editors/interface/interface_intern.h (+8, -1) (Diff)
/source/blender/editors/interface/interface_region_search.c (+10, -7) (Diff)
/source/blender/editors/interface/interface_templates.c (+5, -3) (Diff)
/source/blender/editors/interface/interface_template_search_menu.c (+2, -1) (Diff)
/source/blender/editors/interface/interface_template_search_operator.c (+2, -1) (Diff)
/source/blender/editors/interface/interface_utils.c (+3, -2) (Diff)
/source/blender/editors/space_node/node_select.c (+2, -1) (Diff)
/source/blender/editors/space_outliner/outliner_tools.c (+2, -1) (Diff)