mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-16 10:22:15 -05:00
#5882 Add color gradient as icon for legend palettes.
This commit is contained in:
1 parent
90596be3ee
commit
9130030d7b
5 files changed
+92
-10
No files matched your search
@@ -17,6 +17,9 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RimColorLegend.h"
|
||||
|
||||
#include "RiaColorTools.h"
|
||||
|
||||
#include "RimColorLegendItem.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RimColorLegend, "ColorLegend" );
|
||||
@@ -119,3 +122,20 @@ cvf::Color3ubArray RimColorLegend::colorArray() const
|
||||
}
|
||||
return colorArray;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::IconProvider RimColorLegend::paletteIconProvider() const
|
||||
{
|
||||
std::vector<QString> colorNames;
|
||||
std::vector<RimColorLegendItem*> legendItems = colorLegendItems();
|
||||
for ( auto legendItem : legendItems )
|
||||
{
|
||||
QColor color = RiaColorTools::toQColor( legendItem->color() );
|
||||
colorNames.push_back( color.name() );
|
||||
}
|
||||
caf::IconProvider iconProvider;
|
||||
iconProvider.setBackgroundColorGradient( colorNames );
|
||||
return iconProvider;
|
||||
}
|
||||
Reference in new issue
Block a user