mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#6490: Improve color legends right-click menus
This commit is contained in:
parent
2ee4f48a88
commit
b16482bb2f
@ -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" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user