mirror of
https://github.com/OPM/ResInsight.git
synced 2026-09-03 20:53:13 -05:00
Histogram: Make selected sub-plot visible in histogram multi plot
Selecting a curve or a plot inside a RimHistogramMultiPlot in the project tree now scrolls the multi plot view to make the containing histogram plot visible, mirroring the existing behavior for RimSummaryMultiPlot.
This commit is contained in:
@@ -27,6 +27,8 @@
|
||||
#include "Summary/RiaSummaryPlotTools.h"
|
||||
#include "Summary/RiaSummaryTools.h"
|
||||
|
||||
#include "Histogram/RimHistogramMultiPlot.h"
|
||||
#include "Histogram/RimHistogramPlot.h"
|
||||
#include "RimEnsembleCurveSetCollection.h"
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimMultiPlot.h"
|
||||
@@ -932,6 +934,25 @@ void RiuPlotMainWindow::selectedObjectsChanged( caf::PdmUiTreeView* projectTree,
|
||||
multiSummaryPlot->makeSureIsVisible( summaryPlot );
|
||||
}
|
||||
}
|
||||
else if ( auto multiHistogramPlot = firstSelectedObject->firstAncestorOrThisOfType<RimHistogramMultiPlot>() )
|
||||
{
|
||||
// The toolbar shows fields from the histogram multi plot. When a child object is selected, the first
|
||||
// ancestor view window is the sub plot, not the multi plot. Use the multi plot as active plot view
|
||||
// window to make sure the toolbar is available for any object in the multi plot.
|
||||
m_activePlotViewWindow = multiHistogramPlot;
|
||||
|
||||
setBlockViewSelectionOnSubWindowActivated( true );
|
||||
setActiveViewer( multiHistogramPlot->dockWindowName() );
|
||||
setBlockViewSelectionOnSubWindowActivated( false );
|
||||
|
||||
updateMultiPlotToolBar();
|
||||
|
||||
auto histogramPlot = firstSelectedObject->firstAncestorOrThisOfType<RimHistogramPlot>();
|
||||
if ( histogramPlot )
|
||||
{
|
||||
multiHistogramPlot->makeSureIsVisible( histogramPlot );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( selectedWindow->dockWidget() )
|
||||
|
||||
Reference in New Issue
Block a user