mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 14:08:03 -06:00
Don't resize dialog with invalid sizes
This fixes wrong dialog sizes on first startup.
This commit is contained in:
@@ -572,10 +572,8 @@ OptionsDialog::OptionsDialog(QWidget *parent)
|
||||
|
||||
m_ui->tabSelection->setCurrentRow(m_storeLastViewedPage);
|
||||
|
||||
resize(m_storeDialogSize);
|
||||
|
||||
// Have to be called after show(), because splitter width needed
|
||||
loadSplitterState();
|
||||
if (const QSize dialogSize = m_storeDialogSize; dialogSize.isValid())
|
||||
resize(dialogSize);
|
||||
}
|
||||
|
||||
void OptionsDialog::initializeLanguageCombo()
|
||||
@@ -646,6 +644,13 @@ void OptionsDialog::loadSplitterState()
|
||||
m_ui->hsplitter->setSizes(splitterSizes);
|
||||
}
|
||||
|
||||
void OptionsDialog::showEvent(QShowEvent *e)
|
||||
{
|
||||
QDialog::showEvent(e);
|
||||
|
||||
loadSplitterState();
|
||||
}
|
||||
|
||||
void OptionsDialog::saveOptions()
|
||||
{
|
||||
auto *pref = Preferences::instance();
|
||||
|
||||
Reference in New Issue
Block a user