mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Better fix for legend and title in sub plots and summary dialog
This commit is contained in:
committed by
Magne Sjaastad
parent
377274cdec
commit
9391453c2c
@@ -199,6 +199,10 @@ Qt::DropActions RiuDragDrop::supportedDropActions() const
|
||||
{
|
||||
return Qt::CopyAction;
|
||||
}
|
||||
else if ( RiuTypedPdmObjects<RimPlot>::containsTypedObjects( m_dragItems ) )
|
||||
{
|
||||
// return Qt::CopyAction;
|
||||
}
|
||||
|
||||
return Qt::MoveAction;
|
||||
}
|
||||
|
||||
@@ -191,11 +191,9 @@ void RiuMultiPlotBook::removePlot( RiuQwtPlotWidget* plotWidget )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMultiPlotBook::removeAllPlots()
|
||||
{
|
||||
auto plotWidgets = m_plotWidgets;
|
||||
for ( RiuQwtPlotWidget* plotWidget : plotWidgets )
|
||||
{
|
||||
removePlot( plotWidget );
|
||||
}
|
||||
deleteAllPages();
|
||||
m_plotWidgets.clear();
|
||||
scheduleUpdate();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -483,6 +481,7 @@ QList<QPointer<RiuQwtPlotWidget>> RiuMultiPlotBook::visiblePlotWidgets() const
|
||||
QList<QPointer<RiuQwtPlotWidget>> plotWidgets;
|
||||
for ( QPointer<RiuQwtPlotWidget> plotWidget : m_plotWidgets )
|
||||
{
|
||||
CAF_ASSERT( plotWidget );
|
||||
if ( plotWidget->isChecked() )
|
||||
{
|
||||
plotWidgets.push_back( plotWidget );
|
||||
@@ -534,6 +533,7 @@ void RiuMultiPlotBook::createPages()
|
||||
row = 0;
|
||||
column = 0;
|
||||
}
|
||||
CAF_ASSERT( plotWidgets[visibleIndex] );
|
||||
page->addPlot( plotWidgets[visibleIndex] );
|
||||
page->performUpdate();
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ void RiuMultiPlotPage::insertPlot( RiuQwtPlotWidget* plotWidget, size_t index )
|
||||
m_subTitles.insert( static_cast<int>( index ), subTitle );
|
||||
|
||||
RiuQwtPlotLegend* legend = nullptr;
|
||||
if ( m_plotDefinition->legendsVisible() )
|
||||
if ( m_plotDefinition->legendsVisible() && plotWidget->plotDefinition()->legendsVisible() )
|
||||
{
|
||||
legend = new RiuQwtPlotLegend( this );
|
||||
int legendColumns = 1;
|
||||
|
||||
@@ -290,7 +290,7 @@ void RiuQwtPlotWidget::setLegendFontSize( int fontSize )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuQwtPlotWidget::setLegendVisible( bool visible )
|
||||
void RiuQwtPlotWidget::setInternalLegendVisible( bool visible )
|
||||
{
|
||||
if ( visible )
|
||||
{
|
||||
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
void setPlotTitleFontSize( int titleFontSize );
|
||||
|
||||
void setLegendFontSize( int fontSize );
|
||||
void setLegendVisible( bool visible );
|
||||
void setInternalLegendVisible( bool visible );
|
||||
|
||||
QwtInterval axisRange( QwtPlot::Axis axis ) const;
|
||||
void setAxisRange( QwtPlot::Axis axis, double min, double max );
|
||||
|
||||
@@ -131,7 +131,7 @@ RiuSummaryQwtPlot::RiuSummaryQwtPlot( RimSummaryPlot* plot, QWidget* parent /*=
|
||||
RiuQwtPlotTools::setCommonPlotBehaviour( this );
|
||||
RiuQwtPlotTools::setDefaultAxes( this );
|
||||
|
||||
setLegendVisible( true );
|
||||
setInternalLegendVisible( true );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user