From bb2e0d2948f066bff79259ae639816250bccab39 Mon Sep 17 00:00:00 2001 From: Jon Jenssen Date: Tue, 26 May 2026 19:05:56 +0200 Subject: [PATCH] Work in progress --- .../Application/RiaPlotWindowRedrawScheduler.cpp | 11 +++++++++++ ApplicationLibCode/ProjectDataModel/RimMultiPlot.cpp | 1 + .../UserInterface/RiuMainWindowBase.cpp | 1 + ApplicationLibCode/UserInterface/RiuMultiPlotBook.cpp | 2 ++ 4 files changed, 15 insertions(+) diff --git a/ApplicationLibCode/Application/RiaPlotWindowRedrawScheduler.cpp b/ApplicationLibCode/Application/RiaPlotWindowRedrawScheduler.cpp index 8225ea7c08..d5da774863 100644 --- a/ApplicationLibCode/Application/RiaPlotWindowRedrawScheduler.cpp +++ b/ApplicationLibCode/Application/RiaPlotWindowRedrawScheduler.cpp @@ -18,10 +18,14 @@ #include "RiaPlotWindowRedrawScheduler.h" +#include "RimViewWindow.h" + #include "RiuMultiPlotBook.h" #include "RiuMultiPlotPage.h" #include "RiuPlotWidget.h" +#include "DockWidget.h" + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -108,6 +112,13 @@ void RiaPlotWindowRedrawScheduler::performScheduledUpdates() if ( pagesToUpdate.count( page ) > 0 ) pagesToUpdate.erase( page ); } } + + // TODO - add method to viewer interface to get dock container size + if ( auto pdmView = plotBook->ownerViewWindow() ) + { + QSize s = pdmView->dockWidget()->size(); + plotBook->resize( s ); + } plotBook->performUpdate( updateType ); } diff --git a/ApplicationLibCode/ProjectDataModel/RimMultiPlot.cpp b/ApplicationLibCode/ProjectDataModel/RimMultiPlot.cpp index 3e03e8bddb..55413b2176 100644 --- a/ApplicationLibCode/ProjectDataModel/RimMultiPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimMultiPlot.cpp @@ -353,6 +353,7 @@ void RimMultiPlot::doUpdateLayout() m_viewer->setPagePreviewModeEnabled( m_pagePreviewMode() ); m_viewer->scheduleUpdate(); + m_viewer->updateGeometry(); m_viewer->adjustSize(); } } diff --git a/ApplicationLibCode/UserInterface/RiuMainWindowBase.cpp b/ApplicationLibCode/UserInterface/RiuMainWindowBase.cpp index 62385bbf29..33afbb9d21 100644 --- a/ApplicationLibCode/UserInterface/RiuMainWindowBase.cpp +++ b/ApplicationLibCode/UserInterface/RiuMainWindowBase.cpp @@ -102,6 +102,7 @@ RiuMainWindowBase::~RiuMainWindowBase() { for ( auto v : m_projectTreeViews ) { + v->setPdmItem( nullptr ); delete v; } diff --git a/ApplicationLibCode/UserInterface/RiuMultiPlotBook.cpp b/ApplicationLibCode/UserInterface/RiuMultiPlotBook.cpp index 0ccb073da1..53c9209e56 100644 --- a/ApplicationLibCode/UserInterface/RiuMultiPlotBook.cpp +++ b/ApplicationLibCode/UserInterface/RiuMultiPlotBook.cpp @@ -452,6 +452,8 @@ void RiuMultiPlotBook::applyPagePreviewBookSize( int frameWidth ) //-------------------------------------------------------------------------------------------------- void RiuMultiPlotBook::applyBookSize( int frameWidth, int frameHeight ) { + qDebug() << "Size " << frameWidth << " x " << frameHeight << "\n"; + if ( frameWidth == 54 ) return; int totalHeight = 0; for ( auto page : m_pages ) {