Skip to content
Permalink
Browse files
Merge pull request #4522 from nyalldawson/new_random
[needs-docs] Add a "shuffle random" option to color ramp button
  • Loading branch information
nyalldawson committed May 9, 2017
2 parents 3cd3e5d + 927faf7 commit 592fcfa
Showing 1 changed file with 7 additions and 0 deletions.
@@ -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();

0 comments on commit 592fcfa

Please sign in to comment.