Blender Git Commit Log
Git Commits -> Revision 10e885c
Revision 10e885c by Hans Goudey (temp-geometry-nodes-attribute-search) February 24, 2021, 23:49 (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 list every option at the start. Otherwise they wouldn't be visible, since the search filter would run. Currently this same check happens in one place, but it checks the `changed` value of `uiBut`. This is fine in the interface directory, but anywhere else it doesn't work. And I think exposing `uiBut.changed` is not a good idea, since it's too general and is only used for this specific situation anyway. So, 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`. Ref T85658 Maniphest Tasks: T85658 Differential Revision: https://developer.blender.org/D10528 |
Commit Details:
Full Hash: 10e885c56b0d22217e53a5ebceb295081462b8b9
Parent Commit: c11063f
Lines Changed: +24, -13
10 Modified Paths:
/source/blender/editors/include/UI_interface.h (+2, -1) (Diff)
/source/blender/editors/interface/interface.c (+2, -1) (Diff)
/source/blender/editors/interface/interface_intern.h (+2, -1) (Diff)
/source/blender/editors/interface/interface_region_search.c (+2, -1) (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 (+2, -1) (Diff)
/source/blender/editors/interface/interface_intern.h (+2, -1) (Diff)
/source/blender/editors/interface/interface_region_search.c (+2, -1) (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)