[#74499710] Panel not collapsing when embedding designer.

Moved `hide-display`class to a different scope, so it will work when the designer is embedded...

[Fixes #74499710]
No needs for this as it works well for Travis CI (well, used to work), but I agree that I've seen similar issue on my local machine.