fix dialog display problem

the original code did not make the size of dialog fit in each screen size, in some resolutions, the terminal box is out of the dialog. fix this by using relative size.
Merge pull request #8 from winguse/patch-1

fix dialog display problem