mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
parent
3ff5d238b1
commit
5ed12b17cd
@ -173,12 +173,13 @@ void RiuMultiPlotPage::insertPlot( RiuPlotWidget* plotWidget, size_t index )
|
|||||||
|
|
||||||
RiuQwtPlotWidget* qwtPlotWidget = dynamic_cast<RiuQwtPlotWidget*>( plotWidget );
|
RiuQwtPlotWidget* qwtPlotWidget = dynamic_cast<RiuQwtPlotWidget*>( plotWidget );
|
||||||
|
|
||||||
RiuQwtPlotLegend* legend = new RiuQwtPlotLegend( this );
|
RiuQwtPlotLegend* legend = nullptr;
|
||||||
RiuDraggableOverlayFrame* legendFrame =
|
RiuDraggableOverlayFrame* legendFrame =
|
||||||
new RiuDraggableOverlayFrame( plotWidget->getParentForOverlay(), plotWidget->overlayMargins() );
|
new RiuDraggableOverlayFrame( plotWidget->getParentForOverlay(), plotWidget->overlayMargins() );
|
||||||
|
|
||||||
if ( m_plotDefinition->legendsVisible() && plotWidget->plotDefinition()->legendsVisible() )
|
if ( m_plotDefinition->legendsVisible() && plotWidget->plotDefinition()->legendsVisible() )
|
||||||
{
|
{
|
||||||
|
legend = new RiuQwtPlotLegend( this );
|
||||||
int legendColumns = 1;
|
int legendColumns = 1;
|
||||||
if ( m_plotDefinition->legendsHorizontal() )
|
if ( m_plotDefinition->legendsHorizontal() )
|
||||||
{
|
{
|
||||||
@ -715,6 +716,8 @@ void RiuMultiPlotPage::addLegendWidget( RiuPlotWidget* plotWidget,
|
|||||||
int column,
|
int column,
|
||||||
int colSpan )
|
int colSpan )
|
||||||
{
|
{
|
||||||
|
if ( !legend ) return;
|
||||||
|
|
||||||
if ( m_plotDefinition->legendPosition() == RimPlotWindow::LegendPosition::ABOVE )
|
if ( m_plotDefinition->legendPosition() == RimPlotWindow::LegendPosition::ABOVE )
|
||||||
{
|
{
|
||||||
m_gridLayout->addWidget( legend, row, column, 1, colSpan, Qt::AlignHCenter | Qt::AlignBottom );
|
m_gridLayout->addWidget( legend, row, column, 1, colSpan, Qt::AlignHCenter | Qt::AlignBottom );
|
||||||
@ -738,6 +741,8 @@ void RiuMultiPlotPage::updateLegendVisibility( RiuPlotWidget* plotWid
|
|||||||
RiuQwtPlotLegend* legend,
|
RiuQwtPlotLegend* legend,
|
||||||
RiuDraggableOverlayFrame* legendFrame )
|
RiuDraggableOverlayFrame* legendFrame )
|
||||||
{
|
{
|
||||||
|
if ( !legend ) return;
|
||||||
|
|
||||||
if ( m_plotDefinition->legendsVisible() && !legend->isEmpty() )
|
if ( m_plotDefinition->legendsVisible() && !legend->isEmpty() )
|
||||||
{
|
{
|
||||||
updateLegendColumns( legend );
|
updateLegendColumns( legend );
|
||||||
|
Loading…
Reference in New Issue
Block a user