From 76a90b04c8518bb9ed37c89c2607fc60290e9947 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20St=C3=B8ren?= Date: Wed, 2 Dec 2015 13:58:10 +0100 Subject: [PATCH] (#616) Removed the legend scrollbars completely by keeping the legend with at required size. --- ApplicationCode/UserInterface/RiuWellLogPlot.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ApplicationCode/UserInterface/RiuWellLogPlot.cpp b/ApplicationCode/UserInterface/RiuWellLogPlot.cpp index 55d939628b..5438b41224 100644 --- a/ApplicationCode/UserInterface/RiuWellLogPlot.cpp +++ b/ApplicationCode/UserInterface/RiuWellLogPlot.cpp @@ -291,8 +291,8 @@ void RiuWellLogPlot::placeChildWidgets(int height, int width) realTrackWidth += 1; --trackWidthExtra; } - - m_legends[tIdx]->setGeometry(trackX, 0, realTrackWidth, maxLegendHeight); + int realLegendWidth = std::max(realTrackWidth, m_legends[tIdx]->sizeHint().width()); + m_legends[tIdx]->setGeometry(trackX, 0, realLegendWidth, maxLegendHeight); m_trackPlots[tIdx]->setGeometry(trackX, maxLegendHeight, realTrackWidth, trackHeight); trackX += realTrackWidth; @@ -301,7 +301,6 @@ void RiuWellLogPlot::placeChildWidgets(int height, int width) } if (m_scrollBar->isVisible()) m_scrollBar->setGeometry(trackX, maxLegendHeight, scrollBarWidth, trackHeight); - } //--------------------------------------------------------------------------------------------------