ResInsight/ApplicationLibCode/UserInterface/RiuMdiMaximizeWindowGuard.cpp
2021-01-11 15:27:45 +01:00

50 lines
1.5 KiB
C++

#include "RiuMdiMaximizeWindowGuard.h"
#include "RiaGuiApplication.h"
#include "RiuMainWindow.h"
#include "RiuPlotMainWindow.h"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiuMdiMaximizeWindowGuard::RiuMdiMaximizeWindowGuard()
{
{
RiuMainWindow* mainWindow = RiaGuiApplication::instance()->mainWindow();
if ( mainWindow )
{
mainWindow->enableShowFirstVisibleMdiWindowMaximized( false );
}
}
{
RiuPlotMainWindow* plotMainWindow = RiaGuiApplication::instance()->mainPlotWindow();
if ( plotMainWindow )
{
plotMainWindow->enableShowFirstVisibleMdiWindowMaximized( false );
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiuMdiMaximizeWindowGuard::~RiuMdiMaximizeWindowGuard()
{
{
RiuMainWindow* mainWindow = RiaGuiApplication::instance()->mainWindow();
if ( mainWindow )
{
mainWindow->enableShowFirstVisibleMdiWindowMaximized( true );
}
}
{
RiuPlotMainWindow* plotMainWindow = RiaGuiApplication::instance()->mainPlotWindow();
if ( plotMainWindow )
{
plotMainWindow->enableShowFirstVisibleMdiWindowMaximized( true );
}
}
}