mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2657 Improved ensemble curve set legend placement and update
This commit is contained in:
@@ -171,9 +171,9 @@ void RiuSummaryQwtPlot::setZoomWindow(const QwtInterval& leftAxis, const QwtInte
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuSummaryQwtPlot::updateEnsembleLegendLayout()
|
void RiuSummaryQwtPlot::updateEnsembleLegendLayout()
|
||||||
{
|
{
|
||||||
const int startMarginX = 65;
|
|
||||||
const int startMarginY = 35;
|
|
||||||
const int spacing = 5;
|
const int spacing = 5;
|
||||||
|
int startMarginX = this->canvas()->pos().x() + spacing;
|
||||||
|
int startMarginY = this->canvas()->pos().y() + spacing;
|
||||||
|
|
||||||
int xpos = startMarginX;
|
int xpos = startMarginX;
|
||||||
int ypos = startMarginY;
|
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);
|
plot->setAxisScaleDraw(QwtPlot::xBottom, scaleDraw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RiuSummaryQwtPlot::updateLayout()
|
||||||
|
{
|
||||||
|
QwtPlot::updateLayout();
|
||||||
|
updateEnsembleLegendLayout();
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ protected:
|
|||||||
virtual QSize sizeHint() const override;
|
virtual QSize sizeHint() const override;
|
||||||
virtual QSize minimumSizeHint() const override;
|
virtual QSize minimumSizeHint() const override;
|
||||||
virtual void contextMenuEvent(QContextMenuEvent *) override;
|
virtual void contextMenuEvent(QContextMenuEvent *) override;
|
||||||
virtual void resizeEvent(QResizeEvent *e) override;
|
virtual void updateLayout() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setDefaults();
|
void setDefaults();
|
||||||
|
|||||||
Reference in New Issue
Block a user