Center dialogs based on the main window.