mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-10 23:07:59 +00:00
Merge pull request #7477 from silverqx/options-dlg-persist-size
Center Options dialog when showed
This commit is contained in:
commit
308fd3dcac
@ -391,8 +391,10 @@ OptionsDialog::OptionsDialog(QWidget *parent)
|
||||
m_ui->textTempPath->setDialogCaption(tr("Choose a save directory"));
|
||||
m_ui->textTempPath->setMode(FileSystemPathEdit::Mode::DirectorySave);
|
||||
|
||||
show();
|
||||
loadWindowState();
|
||||
show();
|
||||
// Have to be called after show(), because splitter width needed
|
||||
loadSplitterState();
|
||||
}
|
||||
|
||||
void OptionsDialog::initializeLanguageCombo()
|
||||
@ -442,6 +444,12 @@ void OptionsDialog::loadWindowState()
|
||||
const Preferences* const pref = Preferences::instance();
|
||||
|
||||
resize(pref->getPrefSize(this->size()));
|
||||
}
|
||||
|
||||
void OptionsDialog::loadSplitterState()
|
||||
{
|
||||
const Preferences* const pref = Preferences::instance();
|
||||
|
||||
const QStringList sizes_str = pref->getPrefHSplitterSizes();
|
||||
QList<int> sizes;
|
||||
if (sizes_str.size() == 2) {
|
||||
|
@ -93,6 +93,7 @@ private slots:
|
||||
void toggleComboRatioLimitAct();
|
||||
void changePage(QListWidgetItem*, QListWidgetItem*);
|
||||
void loadWindowState();
|
||||
void loadSplitterState();
|
||||
void saveWindowState() const;
|
||||
void handleScanFolderViewSelectionChanged();
|
||||
void on_IpFilterRefreshBtn_clicked();
|
||||
|
Loading…
Reference in New Issue
Block a user