Auto-resize dialog to fit content