From 7c633686e99512d33391f30e4602213ed3890802 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Tue, 13 Oct 2020 13:10:41 -0500 Subject: 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 --- source/blender/makesdna/DNA_space_types.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'source/blender/makesdna/DNA_space_types.h') diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 9d9b41a1f81..be02e450412 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -56,6 +56,9 @@ struct bNodeTree; struct wmOperator; struct wmTimer; +/* Defined in `buttons_intern.h`. */ +typedef struct SpaceProperties_Runtime SpaceProperties_Runtime; + /* TODO 2.8: We don't write the global areas to files currently. Uncomment * define to enable writing (should become the default in a bit). */ //#define WITH_GLOBAL_AREA_WRITING @@ -129,13 +132,6 @@ typedef enum eSpaceInfo_RptMask { /** \name Properties Editor * \{ */ -# -# -typedef struct SpaceProperties_Runtime { - /** For filtering properties displayed in the space. Length defined as UI_MAX_NAME_STR. */ - char search_string[128]; -} SpaceProperties_Runtime; - /* Properties Editor */ typedef struct SpaceProperties { SpaceLink *next, *prev; @@ -168,7 +164,7 @@ typedef struct SpaceProperties { void *texuser; /* Doesn't necessarily need to be a pointer, but runtime structs are still written to files. */ - SpaceProperties_Runtime *runtime; + struct SpaceProperties_Runtime *runtime; } SpaceProperties; /* button defines (deprecated) */ -- cgit v1.2.3