mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Summary Multi Plot: Minor adjustments (#8856)
Remove obsolete single summary template code Always use maximized state of the QMdiSubWindow when a plot or view is deleted. Move time axis to top Set correct text for unused axis Avoid assert when layout is requested for non existing legend
This commit is contained in:
@@ -36,8 +36,8 @@ CAF_CMD_SOURCE_INIT( RicNewPlotAxisPropertiesFeature, "RicNewPlotAxisPropertiesF
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicNewPlotAxisPropertiesFeature::isCommandEnabled()
|
||||
{
|
||||
std::vector<RimSummaryPlot*> summaryPlots = caf::selectedObjectsByTypeStrict<RimSummaryPlot*>();
|
||||
return summaryPlots.size() == 1;
|
||||
auto* summaryPlot = caf::firstAncestorOfTypeFromSelectedObject<RimSummaryPlot*>();
|
||||
return ( summaryPlot != nullptr );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -45,13 +45,13 @@ bool RicNewPlotAxisPropertiesFeature::isCommandEnabled()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewPlotAxisPropertiesFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
std::vector<RimSummaryPlot*> summaryPlots = caf::selectedObjectsByTypeStrict<RimSummaryPlot*>();
|
||||
if ( summaryPlots.size() != 1 ) return;
|
||||
|
||||
RimSummaryPlot* summaryPlot = summaryPlots[0];
|
||||
auto* summaryPlot = caf::firstAncestorOfTypeFromSelectedObject<RimSummaryPlot*>();
|
||||
if ( !summaryPlot ) return;
|
||||
|
||||
RimPlotAxisProperties* newPlotAxisProperties =
|
||||
summaryPlot->addNewAxisProperties( RiaDefines::PlotAxis::PLOT_AXIS_LEFT, "New Axis" );
|
||||
summaryPlot->plotWidget()->ensureAxisIsCreated( newPlotAxisProperties->plotAxisType() );
|
||||
newPlotAxisProperties->setNameForUnusedAxis();
|
||||
|
||||
summaryPlot->updateConnectedEditors();
|
||||
RiuPlotMainWindowTools::selectAsCurrentItem( newPlotAxisProperties );
|
||||
|
||||
Reference in New Issue
Block a user