Auto adjust dialog when resized