mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#6462 Add reordering to color legend items
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user