diff options
author | Hans Goudey <h.goudey@me.com> | 2020-10-13 21:10:41 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-10-13 21:10:41 +0300 |
commit | 7c633686e99512d33391f30e4602213ed3890802 (patch) | |
tree | 5c0b651851d9de7896ea9687d83ed62059f84492 /source/blender/editors/interface | |
parent | 96dd299055a1ce35819480f3c4b938f8e6f91537 (diff) |
Property Search: Find results in all tabs
This patch enables property search for all tabs in the property editor.
To make interaction faster, if the editor's current tab doesn't have a
result, the current tab changes to the next tab that has a match.
This patch implements basic code that only searches panels.
While we could run the existing "single tab" property search for every
tab, that would also do everything else related to the layout pass,
which would be less efficient, and maybe more complicated to maintain.
The search match status for every current tab of the property editor is
stored in a runtime bitfield and them displayed later by dimming icons
in the tab selector panel to the left. Using `BLI_bitmap` properly in
the runtime struct required moving it to `buttons_intern.h` and
adding a small API to access the search filter instead.
To make sure the editor isn't influenced by anything that happens while
building the layout for other tabs, most of the context is duplicated
and the new search is run in the duplicated editor.
Note that the tool settings tab works slightly different than the other
tabs, so I've disabled searching it for this commit. That would be a
relatively simple improvement, but would just require a bit of
refactoring of existing code.
Differential Revision: https://developer.blender.org/D8859
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_layout.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 98b1c020d95..3e276a69277 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -5600,6 +5600,19 @@ void uiLayoutSetFunc(uiLayout *layout, uiMenuHandleFunc handlefunc, void *argv) layout->root->argv = argv; } +/** + * Used for property search when the layout process needs to be cancelled in order to avoid + * computing the locations for buttons, but the layout items created while adding the buttons + * must still be freed. + */ +void UI_block_layout_free(uiBlock *block) +{ + LISTBASE_FOREACH_MUTABLE (uiLayoutRoot *, root, &block->layouts) { + ui_layout_free(root->layout); + MEM_freeN(root); + } +} + void UI_block_layout_resolve(uiBlock *block, int *r_x, int *r_y) { BLI_assert(block->active); |