mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-21 05:43:32 -07:00
Remember Y position of the torrent addition dialog
This commit is contained in:
parent
90b1567d13
commit
e27a648594
1 changed files with 11 additions and 3 deletions
|
@ -108,6 +108,7 @@ void AddNewTorrentDialog::saveState()
|
||||||
settings.beginGroup(QString::fromUtf8("AddNewTorrentDialog"));
|
settings.beginGroup(QString::fromUtf8("AddNewTorrentDialog"));
|
||||||
if (m_contentModel)
|
if (m_contentModel)
|
||||||
settings.setValue("treeHeaderState", ui->content_tree->header()->saveState());
|
settings.setValue("treeHeaderState", ui->content_tree->header()->saveState());
|
||||||
|
settings.setValue("y", pos().y());
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddNewTorrentDialog::showTorrent(const QString &torrent_path, const QString& from_url)
|
void AddNewTorrentDialog::showTorrent(const QString &torrent_path, const QString& from_url)
|
||||||
|
@ -474,9 +475,16 @@ void AddNewTorrentDialog::setdialogPosition()
|
||||||
{
|
{
|
||||||
qApp->processEvents();
|
qApp->processEvents();
|
||||||
QPoint center(misc::screenCenter(this));
|
QPoint center(misc::screenCenter(this));
|
||||||
center.ry() -= 120;
|
// Adjust y
|
||||||
if (center.y() < 0)
|
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||||
center.setY(0);
|
int y = settings.value("AddNewTorrentDialog/y", -1).toInt();
|
||||||
|
if (y >= 0) {
|
||||||
|
center.setY(y);
|
||||||
|
} else {
|
||||||
|
center.ry() -= 120;
|
||||||
|
if (center.y() < 0)
|
||||||
|
center.setY(0);
|
||||||
|
}
|
||||||
move(center);
|
move(center);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue