mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4323 Avoid time step legend showing up unexpectedly in grid cross plots
This commit is contained in:
parent
25d5120190
commit
1caed321b0
@ -58,6 +58,6 @@ void RicCreateGridCrossPlotDataSetFeature::onActionTriggered(bool isChecked)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicCreateGridCrossPlotDataSetFeature::setupActionLook(QAction* actionToSetup)
|
||||
{
|
||||
actionToSetup->setText("New Data Set");
|
||||
actionToSetup->setText("Create Data Set");
|
||||
actionToSetup->setIcon(QIcon(":/WellLogCurve16x16.png"));
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ void RicCreateGridCrossPlotFeature::setupActionLook(QAction* actionToSetup)
|
||||
}
|
||||
else
|
||||
{
|
||||
actionToSetup->setText("New Grid Cross Plot");
|
||||
actionToSetup->setText("Create Grid Cross Plot");
|
||||
}
|
||||
actionToSetup->setIcon(QIcon(":/SummaryXPlotsLight16x16.png"));
|
||||
}
|
||||
|
@ -285,29 +285,31 @@ void RiuGridCrossQwtPlot::updateLegendLayout()
|
||||
|
||||
for (RimGridCrossPlotDataSet* dataSet : crossPlot->dataSets())
|
||||
{
|
||||
if (!dataSet->isChecked() || !dataSet->legendConfig()->showLegend()) continue;
|
||||
|
||||
auto pairIt = m_legendWidgets.find(dataSet);
|
||||
if (pairIt != m_legendWidgets.end())
|
||||
if (dataSet->isChecked() && dataSet->groupingEnabled() && dataSet->legendConfig()->showLegend())
|
||||
{
|
||||
RiuCvfOverlayItemWidget* overlayWidget = pairIt->second;
|
||||
|
||||
// Show only one copy of each legend type
|
||||
if (!legendTypes.count(dataSet->groupParameter()))
|
||||
auto pairIt = m_legendWidgets.find(dataSet);
|
||||
if (pairIt != m_legendWidgets.end())
|
||||
{
|
||||
if (ypos + overlayWidget->height() + spacing > this->canvas()->height())
|
||||
RiuCvfOverlayItemWidget* overlayWidget = pairIt->second;
|
||||
|
||||
// Show only one copy of each legend type
|
||||
if (!legendTypes.count(dataSet->groupParameter()))
|
||||
{
|
||||
xpos += spacing + maxColumnWidth;
|
||||
ypos = startMarginY;
|
||||
maxColumnWidth = 0;
|
||||
if (ypos + overlayWidget->height() + spacing > this->canvas()->height())
|
||||
{
|
||||
xpos += spacing + maxColumnWidth;
|
||||
ypos = startMarginY;
|
||||
maxColumnWidth = 0;
|
||||
}
|
||||
|
||||
overlayWidget->show();
|
||||
overlayWidget->move(xpos, ypos);
|
||||
|
||||
ypos += pairIt->second->height() + spacing;
|
||||
maxColumnWidth = std::max(maxColumnWidth, pairIt->second->width());
|
||||
legendTypes.insert(dataSet->groupParameter());
|
||||
}
|
||||
|
||||
overlayWidget->show();
|
||||
overlayWidget->move(xpos, ypos);
|
||||
|
||||
ypos += pairIt->second->height() + spacing;
|
||||
maxColumnWidth = std::max(maxColumnWidth, pairIt->second->width());
|
||||
legendTypes.insert(dataSet->groupParameter());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user