mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#481) Restore window maximized state
This commit is contained in:
@@ -31,7 +31,8 @@ int main(int argc, char *argv[])
|
|||||||
QString platform = cvf::System::is64Bit() ? "(64bit)" : "(32bit)";
|
QString platform = cvf::System::is64Bit() ? "(64bit)" : "(32bit)";
|
||||||
window.setWindowTitle("ResInsight " + platform);
|
window.setWindowTitle("ResInsight " + platform);
|
||||||
window.setDefaultWindowSize();
|
window.setDefaultWindowSize();
|
||||||
window.show();
|
window.loadWinGeoAndDockToolBarLayout();
|
||||||
|
window.showWindow();
|
||||||
|
|
||||||
if (app.parseArguments())
|
if (app.parseArguments())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -117,7 +117,6 @@ RiuMainWindow::RiuMainWindow()
|
|||||||
|
|
||||||
// Store the layout so we can offer reset option
|
// Store the layout so we can offer reset option
|
||||||
m_initialDockAndToolbarLayout = saveState(0);
|
m_initialDockAndToolbarLayout = saveState(0);
|
||||||
loadWinGeoAndDockToolBarLayout();
|
|
||||||
|
|
||||||
sm_mainWindowInstance = this;
|
sm_mainWindowInstance = this;
|
||||||
|
|
||||||
@@ -673,8 +672,9 @@ void RiuMainWindow::saveWinGeoAndDockToolBarLayout()
|
|||||||
|
|
||||||
QByteArray layout = saveState(0);
|
QByteArray layout = saveState(0);
|
||||||
settings.setValue("dockAndToolBarLayout", layout);
|
settings.setValue("dockAndToolBarLayout", layout);
|
||||||
}
|
|
||||||
|
|
||||||
|
settings.setValue("isMaximized", isMaximized());
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
@@ -699,6 +699,23 @@ void RiuMainWindow::loadWinGeoAndDockToolBarLayout()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RiuMainWindow::showWindow()
|
||||||
|
{
|
||||||
|
// Company and appname set through QCoreApplication
|
||||||
|
QSettings settings;
|
||||||
|
|
||||||
|
showNormal();
|
||||||
|
|
||||||
|
QVariant isMax = settings.value("isMaximized", false);
|
||||||
|
if (isMax.toBool())
|
||||||
|
{
|
||||||
|
showMaximized();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -94,6 +94,7 @@ public:
|
|||||||
|
|
||||||
void hideAllDockWindows();
|
void hideAllDockWindows();
|
||||||
void loadWinGeoAndDockToolBarLayout();
|
void loadWinGeoAndDockToolBarLayout();
|
||||||
|
void showWindow();
|
||||||
|
|
||||||
void setCurrentObjectInTreeView(caf::PdmObject* object);
|
void setCurrentObjectInTreeView(caf::PdmObject* object);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user