I was in a rush for a meeting earlier and should have included MB's point, as when you drag the 'shade' you're essentially altering the stored value of $TitleHeight. There's a bit more on this here - even if only as a bookmark from when you forget which bit to adjust. Useful for map use might be stamps you could make:
'Hide Viewport'. Code:
'Reset Viewport'. Code:
I just tested both and even for a resized container both work as imagined. If you've 'hidden' the container viewport and re-size the container you'll need to re-apply the 'hide' stamp but I don't think that's onerous (and better than running the code all the time as a rule which would be overkill for the task at hand).