#4130 3D Cross Plot: Improve window management

This commit is contained in:
Gaute Lindkvist
2019-02-21 15:42:28 +01:00
parent 7e57ec39ea
commit 760fcaef43
6 changed files with 218 additions and 42 deletions

View File

@@ -512,18 +512,21 @@ void RimPlotCurve::updateCurveAppearance()
// Make sure the legend lines are long enough to distinguish between line types.
// Standard width in Qwt is 8 which is too short.
// Use 10 and scale this by curve thickness + add space for displaying symbol.
QSize legendIconSize = m_qwtPlotCurve->legendIconSize();
int symbolWidth = 0;
if (symbol)
if (m_curveThickness() > 0)
{
symbolWidth = symbol->boundingRect().size().width() + 2;
}
QSize legendIconSize = m_qwtPlotCurve->legendIconSize();
int width = std::max(10 * m_curveThickness, (symbolWidth * 3) / 2);
legendIconSize.setWidth(width);
m_qwtPlotCurve->setLegendIconSize(legendIconSize);
int symbolWidth = 0;
if (symbol)
{
symbolWidth = symbol->boundingRect().size().width() + 2;
}
int width = std::max(10 * m_curveThickness, (symbolWidth * 3) / 2);
legendIconSize.setWidth(width);
m_qwtPlotCurve->setLegendIconSize(legendIconSize);
}
}
//--------------------------------------------------------------------------------------------------