Fixed macOS-specific bug in AddNewTorrentDialog

Because AddNewTorrentDialog is a sheet in macOS, repositioning it causes bad things to happen, particularly if the main dialog is on a secondary monitor.
This commit is contained in:
Brian Kendall 2017-04-25 13:34:06 -04:00 committed by sledgehammer999
parent e4a5b8d352
commit 390d22bc66
No known key found for this signature in database
GPG key ID: 6E4A2D025B7CC9A2

View file

@ -551,6 +551,10 @@ void AddNewTorrentDialog::renameSelectedFile()
void AddNewTorrentDialog::setdialogPosition()
{
// In macOS, AddNewTorrentDialog is a sheet, not a window. Moving it
// causes very bad things to happen, especially if AddNewTorrentDialog is
// on a secondary monitor.
#ifndef Q_OS_MAC
qApp->processEvents();
QPoint center(Utils::Misc::screenCenter(this));
// Adjust y
@ -564,6 +568,7 @@ void AddNewTorrentDialog::setdialogPosition()
center.setY(0);
}
move(center);
#endif
}
void AddNewTorrentDialog::populateSavePathComboBox()