Skip to content
Permalink
Browse files
Fix initial state of saturation controls
  • Loading branch information
nyalldawson committed Mar 26, 2013
1 parent 3f4e2a0 commit 4e29436d206225c2595398f5bf1e67e46a496df0
Showing with 4 additions and 6 deletions.
  1. +3 −5 src/app/qgsrasterlayerproperties.cpp
  2. +1 −1 src/app/qgsrasterlayerproperties.h
@@ -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() );
@@ -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 );
}
@@ -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 );

0 comments on commit 4e29436

Please sign in to comment.