#2657 Improved ensemble curve set legend placement and update

This commit is contained in:
Jacob Støren
2018-04-20 19:57:40 +02:00
parent 22a1448ea6
commit e2d5dd0381
2 changed files with 12 additions and 12 deletions

View File

@@ -171,9 +171,9 @@ void RiuSummaryQwtPlot::setZoomWindow(const QwtInterval& leftAxis, const QwtInte
//--------------------------------------------------------------------------------------------------
void RiuSummaryQwtPlot::updateEnsembleLegendLayout()
{
const int startMarginX = 65;
const int startMarginY = 35;
const int spacing = 5;
int startMarginX = this->canvas()->pos().x() + spacing;
int startMarginY = this->canvas()->pos().y() + spacing;
int xpos = startMarginX;
int ypos = startMarginY;
@@ -278,15 +278,6 @@ void RiuSummaryQwtPlot::contextMenuEvent(QContextMenuEvent* event)
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuSummaryQwtPlot::resizeEvent(QResizeEvent *e)
{
QwtPlot::resizeEvent(e);
updateEnsembleLegendLayout();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -407,6 +398,15 @@ void RiuSummaryQwtPlot::enableDateBasedBottomXAxis(QwtPlot* plot)
plot->setAxisScaleDraw(QwtPlot::xBottom, scaleDraw);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuSummaryQwtPlot::updateLayout()
{
QwtPlot::updateLayout();
updateEnsembleLegendLayout();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -78,7 +78,7 @@ protected:
virtual QSize sizeHint() const override;
virtual QSize minimumSizeHint() const override;
virtual void contextMenuEvent(QContextMenuEvent *) override;
virtual void resizeEvent(QResizeEvent *e) override;
virtual void updateLayout() override;
private:
void setDefaults();