Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2020-09-15 19:25:49 +0300
committerHans Goudey <h.goudey@me.com>2020-09-15 19:25:49 +0300
commit8bcdcab659fb688d976a50d892dcb4285ff2a180 (patch)
treed85178a6bda0ca80bc62ae6d85428d6f0ed12c5a /source/blender/editors/interface/interface_intern.h
parent7a0a60dde8b4bf120ab7977e476bf5c82b2a63ad (diff)
UI: Single tab property search
This adds a search bar to the properties editor. The full search for every tab isn't included in this patch, but the interaction with panels, searching behavior, UI, region level, and DNA changes are included here. The block-level search works by iterating over the block's button groups and checking whether they match the search. If they do, they are tagged with a flag, and the block's panel is tagged too. For every update (text edit), the panel's expansion is set to whether the panel has a result or not. The search also checks for matching strings inside enums and in panel labels. One complication to this that isn't immediately apparent is that closed panel's subpanels have to be searched too. This adds some complexity to the area-level panel layout code. Possible Future Improvements: - Use the new fuzzy search in BLI - Reset panels to their expansion before the search started if the user escape out of the text box. - Open all child panels of a panel with expansion. Differential Revision: https://developer.blender.org/D8856
Diffstat (limited to 'source/blender/editors/interface/interface_intern.h')
-rw-r--r--source/blender/editors/interface/interface_intern.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h
index edaadd880d7..d62b8a0258a 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -81,6 +81,11 @@ enum {
UI_HAS_ICON = (1 << 3),
UI_HIDDEN = (1 << 4),
UI_SELECT_DRAW = (1 << 5), /* Display selected, doesn't impact interaction. */
+ /**
+ * The button matches the search filter. When property search is active, this
+ * is used to determine which items to keep enabled and which to disable.
+ */
+ UI_SEARCH_FILTER_MATCHES = (1 << 12),
/* warn: rest of uiBut->flag in UI_interface.h */
};
@@ -517,6 +522,12 @@ struct uiBlock {
*/
char display_device[64];
+ /**
+ * Pointer to the space's property search string.
+ * The block doesn't allocate this or change it.
+ */
+ const char *search_filter;
+
struct PieMenuData pie_data;
};
@@ -805,7 +816,9 @@ extern void ui_draw_aligned_panel(const struct uiStyle *style,
const uiBlock *block,
const rcti *rect,
const bool show_pin,
- const bool show_background);
+ const bool show_background,
+ const bool region_search_filter_active);
+void ui_panel_set_search_filter_match(struct Panel *panel, const bool value);
/* interface_draw.c */
extern void ui_draw_dropshadow(