[Bf-blender-cvs] [cf0791bf38d] master: Property Search: Properly set expansion for instanced panels

Hans Goudey noreply at git.blender.org
Tue Sep 15 22:57:41 CEST 2020


Commit: cf0791bf38dd04a6c7067973e61894d93a73539b
Author: Hans Goudey
Date:   Tue Sep 15 15:57:30 2020 -0500
Branches: master
https://developer.blender.org/rBcf0791bf38dd04a6c7067973e61894d93a73539b

Property Search: Properly set expansion for instanced panels

Stack panels (for modifiers, etc..) also get their expansion from their
associated list data. This means that property search expansion needs
to properly update the list data, which can be accomplished by calling
`set_panels_list_data_expand_flag`.

This commit also moves this logic to `UI_panels_end`, where it fits
better.

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

M	source/blender/editors/interface/interface_panel.c
M	source/blender/editors/screen/area.c

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

diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index f956a34def9..101d3a7d38d 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -845,6 +845,9 @@ bool UI_panel_matches_search_filter(const Panel *panel)
   return search_filter_matches;
 }
 
+/**
+ * Expands a panel if it was tagged as having a result by property search, otherwise collapses it.
+ */
 static void panel_set_expansion_from_seach_filter_recursive(const bContext *C, Panel *panel)
 {
   short start_flag = panel->flag;
@@ -1913,6 +1916,15 @@ void UI_panels_end(const bContext *C, ARegion *region, int *r_x, int *r_y)
 
   region_panels_set_expansion_from_list_data(C, region);
 
+  /* Update panel expansion based on property search results. */
+  if (region->flag & RGN_FLAG_SEARCH_FILTER_UPDATE) {
+    /* Don't use the last update from the deactivation, or all the panels will be left closed. */
+    if (region->flag & RGN_FLAG_SEARCH_FILTER_ACTIVE) {
+      UI_panels_set_expansion_from_seach_filter(C, region);
+      set_panels_list_data_expand_flag(C, region);
+    }
+  }
+
   /* offset contents */
   LISTBASE_FOREACH (uiBlock *, block, &region->uiblocks) {
     if (block->active && block->panel) {
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index f6c54e87410..bfd98741ac8 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -2945,14 +2945,6 @@ void ED_region_panels_layout_ex(const bContext *C,
     }
   }
 
-  /* Update panel expansion based on property search results. */
-  if (region->flag & RGN_FLAG_SEARCH_FILTER_UPDATE) {
-    /* Don't use the last update from the deactivation, or all the panels will be left closed. */
-    if (region->flag & RGN_FLAG_SEARCH_FILTER_ACTIVE) {
-      UI_panels_set_expansion_from_seach_filter(C, region);
-    }
-  }
-
   /* align panels and return size */
   UI_panels_end(C, region, &x, &y);



More information about the Bf-blender-cvs mailing list