Skip to content

Commit 592fcfa

Browse files
authored
Merge pull request #4522 from nyalldawson/new_random
[needs-docs] Add a "shuffle random" option to color ramp button
2 parents 3cd3e5d + 927faf7 commit 592fcfa

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/gui/qgscolorrampbutton.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,13 @@ void QgsColorRampButton::prepareMenu()
268268
randomColorRampAction->setChecked( isRandomColorRamp() );
269269
mMenu->addAction( randomColorRampAction );
270270
connect( randomColorRampAction, &QAction::triggered, this, &QgsColorRampButton::setRandomColorRamp );
271+
272+
if ( isRandomColorRamp() || dynamic_cast<QgsLimitedRandomColorRamp *>( mColorRamp ) )
273+
{
274+
QAction *shuffleRandomColorRampAction = new QAction( tr( "Shuffle random colors" ), this );
275+
mMenu->addAction( shuffleRandomColorRampAction );
276+
connect( shuffleRandomColorRampAction, &QAction::triggered, this, &QgsColorRampButton::colorRampChanged );
277+
}
271278
}
272279

273280
mMenu->addSeparator();

0 commit comments

Comments
 (0)