mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-09-09 04:22:11 +00:00
Ensure that the options window will always be placed onscreen. Closes #1226.
This commit is contained in:
parent
ed54f0f7c3
commit
ecfd06cfe9
@ -256,8 +256,8 @@ options_imp::options_imp(QWidget *parent):
|
|||||||
connect(advancedSettings, SIGNAL(settingsChanged()), this, SLOT(enableApplyButton()));
|
connect(advancedSettings, SIGNAL(settingsChanged()), this, SLOT(enableApplyButton()));
|
||||||
|
|
||||||
// Adapt size
|
// Adapt size
|
||||||
show();
|
|
||||||
loadWindowState();
|
loadWindowState();
|
||||||
|
show();
|
||||||
}
|
}
|
||||||
|
|
||||||
void options_imp::initializeLanguageCombo()
|
void options_imp::initializeLanguageCombo()
|
||||||
@ -294,7 +294,8 @@ void options_imp::loadWindowState() {
|
|||||||
QIniSettings settings;
|
QIniSettings settings;
|
||||||
resize(settings.value(QString::fromUtf8("Preferences/State/size"), sizeFittingScreen()).toSize());
|
resize(settings.value(QString::fromUtf8("Preferences/State/size"), sizeFittingScreen()).toSize());
|
||||||
QPoint p = settings.value(QString::fromUtf8("Preferences/State/pos"), QPoint()).toPoint();
|
QPoint p = settings.value(QString::fromUtf8("Preferences/State/pos"), QPoint()).toPoint();
|
||||||
if (!p.isNull())
|
QRect scr_rect = qApp->desktop()->screenGeometry();
|
||||||
|
if (!p.isNull() && scr_rect.contains(p))
|
||||||
move(p);
|
move(p);
|
||||||
// Load slider size
|
// Load slider size
|
||||||
const QStringList sizes_str = settings.value("Preferences/State/hSplitterSizes", QStringList()).toStringList();
|
const QStringList sizes_str = settings.value("Preferences/State/hSplitterSizes", QStringList()).toStringList();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user