Skip to content

Commit

Permalink
Fix initial state of saturation controls
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Mar 26, 2013
1 parent 3f4e2a0 commit 4e29436
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions src/app/qgsrasterlayerproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer* lyr, QgsMapCanv
comboGrayscale->setCurrentIndex(( int ) hueSaturationFilter->grayscaleMode() );

// Set initial state of saturation controls based on grayscale mode choice
toggleSaturationControls( hueSaturationFilter->grayscaleMode() == QgsHueSaturationFilter::GrayscaleOff );
toggleSaturationControls(( int )hueSaturationFilter->grayscaleMode() );

// Set initial state of colorize controls
mColorizeCheck->setChecked( hueSaturationFilter->colorizeOn() );
Expand Down Expand Up @@ -1479,18 +1479,16 @@ void QgsRasterLayerProperties::sliderTransparency_valueChanged( int theValue )
lblTransparencyPercent->setText( QString::number( myInt ) + "%" );
}//sliderTransparency_valueChanged

void QgsRasterLayerProperties::toggleSaturationControls( int theValue )
void QgsRasterLayerProperties::toggleSaturationControls( int grayscaleMode )
{
// Enable or disable saturation controls based on choice of grayscale mode
if ( theValue == 0 )
if ( grayscaleMode == 0 )
{
// Grayscale set to off, enable controls
sliderSaturation->setEnabled( true );
spinBoxSaturation->setEnabled( true );
}
else
{
// A grayscale mode is selected, disable saturation controls
sliderSaturation->setEnabled( false );
spinBoxSaturation->setEnabled( false );
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsrasterlayerproperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class QgsRasterLayerProperties : public QDialog, private Ui::QgsRasterLayerPrope
void toggleBuildPyramidsButton();

/**Enable or disable saturation controls depending on choice of grayscale mode */
void toggleSaturationControls( int theValue );
void toggleSaturationControls( int grayscaleMode );

/**Enable or disable colorize controls depending on checkbox */
void toggleColorizeControls( bool colorizeEnabled );
Expand Down

0 comments on commit 4e29436

Please sign in to comment.