Skip to content

Commit

Permalink
#10785 Work-around for legend item disappearing when highlighted
Browse files Browse the repository at this point in the history
Seen on Linux only. The legend item would be wider than anticipated by the
layout (for unknown reasons), and would be place on the next line.
Added extra with to the size hint to work around the problem.
  • Loading branch information
kriben committed Nov 13, 2023
1 parent 1c0c78a commit 3ebd9b0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ApplicationLibCode/UserInterface/RiuQwtPlotLegend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ QSize RiuQwtPlotLegend::sizeHint() const

if ( legendLayout->itemCount() % numColumns ) numRows++;

int width = numColumns * legendLayout->maxItemWidth();
// Extra width to workaround layout issue on linux
// https://github.com/OPM/ResInsight/issues/10785
const int extraWidth = 20;
const int width = numColumns * legendLayout->maxItemWidth() + extraWidth;

int maxHeight = 0;
for ( unsigned int i = 0; i < legendLayout->itemCount(); ++i )
Expand Down

0 comments on commit 3ebd9b0

Please sign in to comment.