[needs-docs] Add a "shuffle random" option to color ramp button

Allows quick regeneration of a new set of random colors if the
current color ramp is a random color ramp.
This commit is contained in:
Nyall Dawson 2017-05-09 12:03:18 +10:00
parent 499a35d0c8
commit 927faf7037

View File

@ -268,6 +268,13 @@ void QgsColorRampButton::prepareMenu()
randomColorRampAction->setChecked( isRandomColorRamp() );
mMenu->addAction( randomColorRampAction );
connect( randomColorRampAction, &QAction::triggered, this, &QgsColorRampButton::setRandomColorRamp );
if ( isRandomColorRamp() || dynamic_cast<QgsLimitedRandomColorRamp *>( mColorRamp ) )
{
QAction *shuffleRandomColorRampAction = new QAction( tr( "Shuffle random colors" ), this );
mMenu->addAction( shuffleRandomColorRampAction );
connect( shuffleRandomColorRampAction, &QAction::triggered, this, &QgsColorRampButton::colorRampChanged );
}
}
mMenu->addSeparator();