Skip to content
Permalink
Browse files
Color ramp combo box: do not show "random colors" if gradients-only i…
…s on

+ added option to query whether gradients-only option is enabled
  • Loading branch information
wonder-sk committed Feb 14, 2014
1 parent 277d274 commit 8b10eb0306d97e403cf341c8b3df610a73070935
@@ -20,7 +20,10 @@ class QgsColorRampComboBox : QComboBox
//! @note not available in python bindings
// static QSize rampIconSize;

//! @note added in 2.2
void setShowGradientOnly( bool gradientOnly );
//! @note added in 2.2
bool showGradientOnly() const;

public slots:
void colorRampChanged( int index );
@@ -54,7 +54,8 @@ void QgsColorRampComboBox::populate( QgsStyleV2* style )
delete ramp;
}

addItem( tr( "Random colors" ) );
if ( !mShowGradientOnly )
addItem( tr( "Random colors" ) );
addItem( tr( "New color ramp..." ) );
connect( this, SIGNAL( activated( int ) ), SLOT( colorRampChanged( int ) ) );
}
@@ -40,7 +40,10 @@ class GUI_EXPORT QgsColorRampComboBox : public QComboBox
//! @note not available in python bindings
static QSize rampIconSize;

//! @note added in 2.2
void setShowGradientOnly( bool gradientOnly ) { mShowGradientOnly = gradientOnly; }
//! @note added in 2.2
bool showGradientOnly() const { return mShowGradientOnly; }

public slots:
void colorRampChanged( int index );

0 comments on commit 8b10eb0

Please sign in to comment.