#6462 Add reordering to color legend items

This commit is contained in:
Magne Sjaastad
2020-09-08 09:23:27 +02:00
parent b0448043f3
commit cbce19bb65
6 changed files with 62 additions and 16 deletions

View File

@@ -23,6 +23,8 @@
#include "Rim3dView.h"
#include "RimColorLegendItem.h"
#include "cafPdmFieldReorderCapability.h"
CAF_PDM_SOURCE_INIT( RimColorLegend, "ColorLegend" );
//--------------------------------------------------------------------------------------------------
@@ -77,6 +79,15 @@ void RimColorLegend::setReadOnly( bool doReadOnly )
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimColorLegend::addReorderCapability()
{
auto reorderability = caf::PdmFieldReorderCapability::addToField( &m_colorLegendItems );
reorderability->orderChanged.connect( this, &RimColorLegend::orderChanged );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -118,6 +129,14 @@ void RimColorLegend::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrderin
this->setUiIcon( paletteIconProvider() );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimColorLegend::orderChanged( const caf::SignalEmitter* emitter )
{
onColorLegendItemHasChanged();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------