fix #349 maxwidth/maxheight issue in Dialog

After delivering #349 via commit 29331b13d5724498ca8bb8a8566564499ed0bf36
a regresion was found during release testing: maxwidth/maxheight
constraints of the Dialog were calculated too big due to addition of the
shadow. That addition should be done only in maximized mode.