Commit a97b449f authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Kai Koehne
Browse files

MainWindow: Delay restoreWindowState



QLayout calls setMinimumSize, which breaks maximized state on Windows.

Task-number: QTCREATORBUG-9586
Change-Id: Ibd9ceb8bccbdf26c6369e86ad4918835d645ca1e
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
Reviewed-by: default avatarKai Koehne <kai.koehne@digia.com>
parent 4ba5a058
......@@ -1077,9 +1077,8 @@ void MainWindow::readSettings()
QColor(Utils::StyleHelper::DEFAULT_BASE_COLOR)).value<QColor>());
}
if (!restoreGeometry(m_settings->value(QLatin1String(windowGeometryKey)).toByteArray()))
resize(1008, 700); // size without window decoration
restoreState(m_settings->value(QLatin1String(windowStateKey)).toByteArray());
// Delay restoreWindowState, since it is overridden by LayoutRequest event
QTimer::singleShot(0, this, SLOT(restoreWindowState()));
bool modeSelectorVisible = m_settings->value(QLatin1String(modeSelectorVisibleKey), true).toBool();
ModeManager::setModeSelectorVisible(modeSelectorVisible);
......@@ -1262,3 +1261,12 @@ bool MainWindow::showWarningWithOptions(const QString &title,
return showOptionsDialog(settingsCategory, settingsId);
return false;
}
void MainWindow::restoreWindowState()
{
m_settings->beginGroup(QLatin1String(settingsGroup));
if (!restoreGeometry(m_settings->value(QLatin1String(windowGeometryKey)).toByteArray()))
resize(1008, 700); // size without window decoration
restoreState(m_settings->value(QLatin1String(windowStateKey)).toByteArray());
m_settings->endGroup();
}
......@@ -149,6 +149,7 @@ private slots:
void setSidebarVisible(bool visible);
void destroyVersionDialog();
void openDelayedFiles();
void restoreWindowState();
private:
void updateContextObject(const QList<IContext *> &context);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment