Page MenuHome

Property Search: Reset panel expansion when exiting search
ClosedPublic

Authored by Hans Goudey (HooglyBoogly) on Sep 23 2020, 5:36 AM.

Details

Summary

This patch implements panel expansion saving and resetting for property search.
While property 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 that were interacted
with during the search won't reset their expansion.

This requires adding a new runtime flag for panels, PANEL_USE_CLOSED_FROM_SEARCH.
It also requires better handling for animation when panel expansion changes with
a PANEL_WAS_CLOSED flag. UI_panel_is_closed gets the search-dependent
expansion stated, but this function is intentionally not used in every single case where
the expansion is accessed-- in some cases it's necessary to use PNL_CLOSED directly.

Diff Detail

Repository
rB Blender

Event Timeline

Hans Goudey (HooglyBoogly) requested review of this revision.Sep 23 2020, 5:36 AM
Hans Goudey (HooglyBoogly) created this revision.
Hans Goudey (HooglyBoogly) added inline comments.
source/blender/makesrna/intern/rna_space.c
1838–1849 ↗(On Diff #29189)

The comment here brings up an issue with using this as a "search box entered" callback. I'm not sure if there's a better way to do it though.

  • Merge branch 'master' into property-search-save-panel-expansion
Julian Eisel (Severin) requested changes to this revision.Oct 2 2020, 7:16 PM

I'd prefer to do this in a simpler way, that is having two separate flags for when the user opened/collapsed a panel or when we override the state temporarily. That would simplify things quite a bit I believe.

This revision now requires changes to proceed.Oct 2 2020, 7:16 PM

Switch to the simpler solution suggested by Julian. Although this is a little more involved than I would have liked, the changes themselves seem much more sensible than they did before.

This revision is now accepted and ready to land.Oct 16 2020, 3:32 PM