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 592fcfa74b24a1e67a12de1179300fa6dfb41e40
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/gui/qgscolorrampbutton.cpp
@@ -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.