Fix tiling issues for plot window

* Fix tiling for plot windows

Remove activation history restore related to a bug that was fixed in 5.12
https://bugreports.qt.io/browse/QTBUG-51761
This commit is contained in:
Magne Sjaastad
2022-11-14 18:50:07 +01:00
committed by GitHub
parent 647e248e04
commit 3b67719972
3 changed files with 29 additions and 35 deletions

View File

@@ -35,7 +35,7 @@ CAF_CMD_SOURCE_INIT( RicTileWindowsFeature, "RicTileWindowsFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicTileWindowsFeature::applyTiling( RiuMainWindowBase* mainWindow, RiaDefines::WindowTileMode requestedTileMode )
void RicTileWindowsFeature::applyTiling( RiuMainWindow* mainWindow, RiaDefines::WindowTileMode requestedTileMode )
{
auto mode = requestedTileMode;
@@ -96,6 +96,25 @@ bool RicTileWindowsFeature::isCommandChecked()
CAF_CMD_SOURCE_INIT( RicTilePlotWindowsFeature, "RicTilePlotWindowsFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicTilePlotWindowsFeature::applyTiling( RiuPlotMainWindow* mainWindow, RiaDefines::WindowTileMode requestedTileMode )
{
auto mode = requestedTileMode;
// If requested mode is set, reset tiling mode to undefined
if ( RimProject::current()->subWindowsTileModePlotWindow() == requestedTileMode )
mode = RiaDefines::WindowTileMode::UNDEFINED;
RimProject::current()->setSubWindowsTileModePlotWindow( mode );
if ( mainWindow )
{
mainWindow->mdiArea()->applyTiling();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -118,7 +137,7 @@ void RicTilePlotWindowsFeature::onActionTriggered( bool isChecked )
this->disableModelChangeContribution();
auto* mainWindow = RiuPlotMainWindow::instance();
RicTileWindowsFeature::applyTiling( mainWindow, RiaDefines::WindowTileMode::DEFAULT );
RicTilePlotWindowsFeature::applyTiling( mainWindow, RiaDefines::WindowTileMode::DEFAULT );
}
//--------------------------------------------------------------------------------------------------
@@ -257,7 +276,7 @@ void RicTilePlotWindowsVerticallyFeature::onActionTriggered( bool isChecked )
this->disableModelChangeContribution();
auto* mainWindow = RiuPlotMainWindow::instance();
RicTileWindowsFeature::applyTiling( mainWindow, RiaDefines::WindowTileMode::VERTICAL );
RicTilePlotWindowsFeature::applyTiling( mainWindow, RiaDefines::WindowTileMode::VERTICAL );
}
//--------------------------------------------------------------------------------------------------
@@ -301,7 +320,7 @@ void RicTilePlotWindowsHorizontallyFeature::onActionTriggered( bool isChecked )
this->disableModelChangeContribution();
auto* mainWindow = RiuPlotMainWindow::instance();
RicTileWindowsFeature::applyTiling( mainWindow, RiaDefines::WindowTileMode::HORIZONTAL );
RicTilePlotWindowsFeature::applyTiling( mainWindow, RiaDefines::WindowTileMode::HORIZONTAL );
}
//--------------------------------------------------------------------------------------------------

View File

@@ -23,7 +23,8 @@
#include "cafCmdFeature.h"
class RiuMainWindowBase;
class RiuMainWindow;
class RiuPlotMainWindow;
//==================================================================================================
///
@@ -33,7 +34,7 @@ class RicTileWindowsFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT;
public:
static void applyTiling( RiuMainWindowBase* mainWindow, RiaDefines::WindowTileMode requestedTileMode );
static void applyTiling( RiuMainWindow* mainWindow, RiaDefines::WindowTileMode requestedTileMode );
protected:
bool isCommandEnabled() override;
@@ -77,6 +78,9 @@ class RicTilePlotWindowsFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
public:
static void applyTiling( RiuPlotMainWindow* mainWindow, RiaDefines::WindowTileMode requestedTileMode );
protected:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override;