mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Curve legend: Use widget size to determine the column count
This commit is contained in:
parent
e29b310566
commit
68c72c85cf
@ -76,8 +76,10 @@ QSize RiuQwtPlotLegend::sizeHint() const
|
|||||||
{
|
{
|
||||||
QMargins margins = this->contentsMargins();
|
QMargins margins = this->contentsMargins();
|
||||||
|
|
||||||
|
auto widgetSize = size();
|
||||||
|
|
||||||
int numColumns =
|
int numColumns =
|
||||||
std::max( 1, (int)legendLayout->columnsForWidth( fullSizeHint.width() - margins.left() - margins.right() ) );
|
std::max( 1, (int)legendLayout->columnsForWidth( widgetSize.width() - margins.left() - margins.right() ) );
|
||||||
int numRows = legendLayout->itemCount() / numColumns;
|
int numRows = legendLayout->itemCount() / numColumns;
|
||||||
if ( numRows == 0 )
|
if ( numRows == 0 )
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user