[Bf-blender-cvs] [6f5ca857fc5] property-search-ui: Property Search: Move button tagging to separate function
Hans Goudey
noreply at git.blender.org
Tue Jul 7 19:55:48 CEST 2020
Commit: 6f5ca857fc5fe5796741978fdf447c5259a2c0a8
Author: Hans Goudey
Date: Tue Jul 7 13:55:34 2020 -0400
Branches: property-search-ui
https://developer.blender.org/rB6f5ca857fc5fe5796741978fdf447c5259a2c0a8
Property Search: Move button tagging to separate function
===================================================================
M source/blender/editors/interface/interface_layout.c
===================================================================
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 659f8ab0625..2825cb13bec 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -5291,6 +5291,29 @@ static void ui_layout_free_hide_buttons(uiLayout *layout)
MEM_freeN(layout);
}
+static bool ui_button_search_tag(uiBut *but, char *search_filter)
+{
+ if (BLI_strcasestr(but->str, search_filter)) {
+ return true;
+ }
+ if (BLI_strcasestr(RNA_property_ui_name(but->rnaprop), search_filter)) {
+ return true;
+ }
+ /* HANS-TODO: This isn't working. but->optype is always null for some reason?? */
+ // if (but->optype != NULL) {
+ // if (BLI_strcasestr(but->optype->name, search_filter)) {
+ // return true;
+ // }
+ // }
+#ifdef PROPERTY_SEARCH_USE_TOOLTIPS
+ if (BLI_strcasestr(RNA_property_description(but->rnaprop), search_filter)) {
+ return true;
+ }
+#endif
+
+ return false;
+}
+
/**
* Tag all buttons with whether they matched the search filter or not.
*
@@ -5312,12 +5335,7 @@ static void ui_block_search_filter_tag_buttons(uiBlock *block)
}
/* Do the shorter check first, in case the check returns true. */
- if (BLI_strcasestr(but->str, block->search_filter) ||
- BLI_strcasestr(RNA_property_ui_name(but->rnaprop), block->search_filter)
-#ifdef PROPERTY_SEARCH_USE_TOOLTIPS
- || BLI_strcasestr(RNA_property_description(but->rnaprop), block->search_filter)
-#endif
- ) {
+ if (ui_button_search_tag(but, block->search_filter)) {
continue;
}
More information about the Bf-blender-cvs
mailing list