code for prettifying and resizing dialog.