Browse Source

Center Options dialog when showed

adaptive-webui-19844
silver 7 years ago
parent
commit
64e539fcfb
No known key found for this signature in database
GPG Key ID: 7AF60D549724DEEF
  1. 10
      src/gui/optionsdlg.cpp
  2. 1
      src/gui/optionsdlg.h

10
src/gui/optionsdlg.cpp

@ -391,8 +391,10 @@ OptionsDialog::OptionsDialog(QWidget *parent)
m_ui->textTempPath->setDialogCaption(tr("Choose a save directory")); m_ui->textTempPath->setDialogCaption(tr("Choose a save directory"));
m_ui->textTempPath->setMode(FileSystemPathEdit::Mode::DirectorySave); m_ui->textTempPath->setMode(FileSystemPathEdit::Mode::DirectorySave);
show();
loadWindowState(); loadWindowState();
show();
// Have to be called after show(), because splitter width needed
loadSplitterState();
} }
void OptionsDialog::initializeLanguageCombo() void OptionsDialog::initializeLanguageCombo()
@ -439,6 +441,12 @@ void OptionsDialog::loadWindowState()
const Preferences* const pref = Preferences::instance(); const Preferences* const pref = Preferences::instance();
resize(pref->getPrefSize(this->size())); resize(pref->getPrefSize(this->size()));
}
void OptionsDialog::loadSplitterState()
{
const Preferences* const pref = Preferences::instance();
const QStringList sizes_str = pref->getPrefHSplitterSizes(); const QStringList sizes_str = pref->getPrefHSplitterSizes();
QList<int> sizes; QList<int> sizes;
if (sizes_str.size() == 2) { if (sizes_str.size() == 2) {

1
src/gui/optionsdlg.h

@ -93,6 +93,7 @@ private slots:
void toggleComboRatioLimitAct(); void toggleComboRatioLimitAct();
void changePage(QListWidgetItem*, QListWidgetItem*); void changePage(QListWidgetItem*, QListWidgetItem*);
void loadWindowState(); void loadWindowState();
void loadSplitterState();
void saveWindowState() const; void saveWindowState() const;
void handleScanFolderViewSelectionChanged(); void handleScanFolderViewSelectionChanged();
void on_IpFilterRefreshBtn_clicked(); void on_IpFilterRefreshBtn_clicked();

Loading…
Cancel
Save