calculate dialog height