#6490: Improve color legends right-click menus

This commit is contained in:
Kristian Bendiksen 2020-10-08 08:58:44 +02:00 committed by Magne Sjaastad
parent 2ee4f48a88
commit b16482bb2f
4 changed files with 15 additions and 5 deletions

View File

@ -71,7 +71,7 @@ void RicCopyStandardLegendFeature::onActionTriggered( bool isChecked )
void RicCopyStandardLegendFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setIcon( QIcon( ":/Legend.png" ) );
actionToSetup->setText( "Copy Legend to Custom Legends" );
actionToSetup->setText( "Copy to Custom Color Legends" );
}
//--------------------------------------------------------------------------------------------------

View File

@ -71,7 +71,7 @@ void RicInsertColorLegendFeature::onActionTriggered( bool isChecked )
void RicInsertColorLegendFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setIcon( QIcon( ":/Legend.png" ) );
actionToSetup->setText( "New Custom Color Legend" );
actionToSetup->setText( "New Color Legend" );
}
//--------------------------------------------------------------------------------------------------
@ -86,7 +86,17 @@ RimColorLegendCollection* RicInsertColorLegendFeature::selectedColorLegendCollec
RimColorLegendCollection* colorLegendCollection = nullptr;
selectedObject->firstAncestorOrThisOfType( colorLegendCollection );
if ( colorLegendCollection ) return colorLegendCollection;
if ( colorLegendCollection )
{
// Disable the menu for standard color legends
RimColorLegend* colorLegend = dynamic_cast<RimColorLegend*>( selectedObject );
if ( colorLegend && colorLegendCollection->isStandardColorLegend( colorLegend ) )
{
return nullptr;
}
return colorLegendCollection;
}
return nullptr;
}

View File

@ -80,7 +80,7 @@ void RicInsertColorLegendItemFeature::onActionTriggered( bool isChecked )
void RicInsertColorLegendItemFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setIcon( QIcon( ":/Legend.png" ) );
actionToSetup->setText( "Append Color Legend Item" );
actionToSetup->setText( "Append Color" );
}
//--------------------------------------------------------------------------------------------------

View File

@ -34,7 +34,7 @@ CAF_PDM_SOURCE_INIT( RimColorLegendCollection, "ColorLegendCollection" );
//--------------------------------------------------------------------------------------------------
RimColorLegendCollection::RimColorLegendCollection()
{
CAF_PDM_InitObject( "Color Legend Collection", ":/Legend.png", "", "" );
CAF_PDM_InitObject( "Color Legends", ":/Legend.png", "", "" );
CAF_PDM_InitFieldNoDefault( &m_standardColorLegends,
"StandardColorLegends",