Fixed background color setting for legends and refactored Legend class hierarchy

* Added a new cafTitledOverlayFrame as a base-class for all ResInsight legend classes
  * Inherits cvf::OverlayItem
This commit is contained in:
Gaute Lindkvist
2018-04-09 13:14:19 +02:00
parent 7a09b9a146
commit 507229f84b
14 changed files with 315 additions and 390 deletions
@@ -573,7 +573,7 @@ void Rim2dIntersectionView::updateLegends()
RimGeoMechView * geoView = nullptr;
m_intersection->firstAncestorOrThisOfType(geoView);
cvf::OverlayItem* legend = nullptr;
caf::TitledOverlayFrame* legend = nullptr;
if (eclView)
{
@@ -32,6 +32,7 @@
#include "RimStimPlanColors.h"
#include "RimViewLinker.h"
#include "cafTitledOverlayFrame.h"
#include "cafCategoryLegend.h"
#include "cafCategoryMapper.h"
#include "cafOverlayScalarMapperLegend.h"
@@ -675,7 +676,7 @@ void RimLegendConfig::setTitle(const QString& title)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::OverlayItem* RimLegendConfig::legend()
caf::TitledOverlayFrame* RimLegendConfig::legend()
{
if (m_currentScalarMapper == m_categoryMapper)
{
@@ -41,6 +41,7 @@ namespace cvf
namespace caf
{
class TitledOverlayFrame;
class CategoryLegend;
class CategoryMapper;
class OverlayScalarMapperLegend;
@@ -119,7 +120,7 @@ public:
void setUiValuesFromLegendConfig(const RimLegendConfig* otherLegendConfig);
cvf::ScalarMapper* scalarMapper() { return m_currentScalarMapper.p(); }
cvf::OverlayItem* legend();
caf::TitledOverlayFrame* legend();
protected:
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);