Fixes #17339. Fix messed up layout of the panels of the slot which happens in some conditions as side-effect of the fix of #16996
Fixes #15628. show() now calls resize() to solve layout issues due to the content not being visible initially
(cherry picked from commit fe3ad3266c30165dd1205f9d51695e295cd69762)