[Bf-blender-cvs] [7137e99ff3c] property-search-ui: Property Search: Fix some filtered buttons not hidden

Hans Goudey noreply at git.blender.org
Wed Jul 1 21:10:48 CEST 2020


Commit: 7137e99ff3caca4f3dc3d7482e7bfcef6d82a362
Author: Hans Goudey
Date:   Wed Jul 1 12:35:57 2020 -0400
Branches: property-search-ui
https://developer.blender.org/rB7137e99ff3caca4f3dc3d7482e7bfcef6d82a362

Property Search: Fix some filtered buttons not hidden

===================================================================

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 d51d792d181..f1c913d44ca 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -5488,7 +5488,17 @@ static bool ui_block_search_layout(uiBlock *block)
   }
 
   /* Set empty flags. */
-  SET_FLAG_FROM_TEST(block->flag, all_roots_empty || block->search_only, UI_BLOCK_FILTERED_EMPTY);
+  if (all_roots_empty || block->search_only) {
+    /* Make sure all of the block's buttons are hidden. They might not have
+     * been hidden if a layout wasn't searched. */
+    LISTBASE_FOREACH (uiBut *, but, &block->buttons) {
+      but->flag |= UI_HIDDEN;
+    }
+    block->flag |= UI_BLOCK_FILTERED_EMPTY;
+  }
+  else {
+    block->flag &= ~UI_BLOCK_FILTERED_EMPTY;
+  }
   if (block->panel != NULL) {
     ui_panel_set_search_filtered(block->panel, all_roots_empty);
   }



More information about the Bf-blender-cvs mailing list