Skip to content

Commit 927faf7

Browse files
committed
[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.
1 parent 499a35d commit 927faf7

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)