Constrain maximum size of dialogs so they aren't bigger than the screen.