Qt: simplify resetGeometry occurances

This commit is contained in:
Megamouse 2018-03-28 20:08:15 +02:00 committed by Ivan
parent 755ceb50a4
commit 92ec846375
3 changed files with 6 additions and 22 deletions

View file

@ -1374,17 +1374,11 @@ void main_window::CreateDockWindows()
void main_window::ConfigureGuiFromSettings(bool configure_all)
{
// Restore GUI state if needed. We need to if they exist.
QByteArray geometry = guiSettings->GetValue(gui::mw_geometry).toByteArray();
if (geometry.isEmpty() == false)
if (!restoreGeometry(guiSettings->GetValue(gui::mw_geometry).toByteArray()))
{
restoreGeometry(geometry);
}
else
{ // By default, set the window to 70% of the screen and the debugger frame is hidden.
// By default, set the window to 70% of the screen and the debugger frame is hidden.
m_debuggerFrame->hide();
QSize defaultSize = QDesktopWidget().availableGeometry().size() * 0.7;
resize(defaultSize);
resize(QDesktopWidget().availableGeometry().size() * 0.7);
}
restoreState(guiSettings->GetValue(gui::mw_windowState).toByteArray());