From 54da72d3cd546ecbd2560d7d57cbed33064bbee1 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Fri, 16 Oct 2020 15:16:44 -0500 Subject: Property Search: Reset panel expansion when exiting search This patch implements panel expansion saving and resetting for property search. While search is active, the panel expansion is based on whether or not it has a search result. When the search finishes, the panel expansion returns to its state before the search started. However, any panels interacted with during the search won't reset their expansion. This requires adding a new runtime flag for panels to store whether to use search result status as expansion. It also requires better handling for animation when panel expansion changes with another new runtime flag. `UI_panel_is_closed` gets the search-dependent expansion, but it is intentionally not used to access expansion in every case-- sometimes it's necessary to use `PNL_CLOSED` directly. Differential Revision: https://developer.blender.org/D8984 --- source/blender/editors/screen/area.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/screen/area.c') diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 1a8c74c59b1..b77d3d1100d 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -2970,7 +2970,7 @@ void ED_region_panels_layout_ex(const bContext *C, Panel *panel = region->panels.last; if (panel != NULL) { const int size_dyn[2] = { - UI_UNIT_X * ((panel->flag & PNL_CLOSED) ? 8 : 14) / UI_DPI_FAC, + UI_UNIT_X * (UI_panel_is_closed(panel) ? 8 : 14) / UI_DPI_FAC, UI_panel_size_y(panel) / UI_DPI_FAC, }; /* region size is layout based and needs to be updated */ -- cgit v1.2.3