Skip to content

Commit

Permalink
[needs-docs] Add a "shuffle random" option to color ramp button
Browse files Browse the repository at this point in the history
Allows quick regeneration of a new set of random colors if the
current color ramp is a random color ramp.
  • Loading branch information
nyalldawson committed May 9, 2017
1 parent 499a35d commit 927faf7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/gui/qgscolorrampbutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 927faf7

Please sign in to comment.