Page MenuHome

Fix T86331: Improved Showing and Hiding of Preferences Regions
ClosedPublic

Authored by Harley Acheson (harley) on Mar 7 2021, 8:42 PM.
Tokens
"Like" token, awarded by rboxman."Like" token, awarded by Tetone."Like" token, awarded by MetinSeven."Like" token, awarded by hitrpr.

Details

Summary

The Preferences editor has two regions at the bottom. One is of type RGN_TYPE_HEADER that contains menus we only want to see if Preferences is among other editors on a larger window. When Preferences is alone as a popup window we want to instead show a second region, of type RGN_TYPE_EXECUTE, that contains some quick-save buttons.

In the state described by this bug report, the RGN_TYPE_EXECUTE region is of zero height - with the "Load & Save" button drawing outside of those bounds - so will not respond to events. This is because the region starts off this size and does not change with simply adding the buttons. Although it has RGN_FLAG_DYNAMIC_SIZE, delayed reinit of regions is only currently supported on headers.

This problem has been with us for more than a year, and has proved a bit mysterious. We've managed to simply hide this issue by just updating the Prefs window more than necessary. Instead this patch fixes the problem directly:

This gives the execute region an initial (minimum) vertical size but also makes the region hidden by default. This way showing Prefs as an editor among others it will show the header but not the execute region. But then when showing Prefs in a popup window, this hides the header region and shows the execute region.

Diff Detail

Repository
rB Blender

Event Timeline

Harley Acheson (harley) requested review of this revision.Mar 7 2021, 8:42 PM
Harley Acheson (harley) created this revision.

Whoops, I had added one more blank line than intended.

Grrr.... can't use ED_region_toggle_hidden or it reverses these areas when opening Prefs while it is already open. Now explicitly showing and hiding.

This revision is now accepted and ready to land.Apr 1 2021, 8:45 AM