generalize dialog resizing to show whole text