Skip to content
Permalink
Browse files

Fix restoring of transparent slider

  • Loading branch information
mhugent committed Mar 24, 2012
1 parent e3ce033 commit 99c7a81a42fa4c351a6ce1919091c32271f050c1
Showing with 19 additions and 4 deletions.
  1. +19 −4 src/app/qgsrasterlayerproperties.cpp
@@ -247,11 +247,22 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer* lyr, QgsMapCanv

if ( renderer )
{
int widgetIndex = mRenderTypeComboBox->findData( renderer->type() );
QString rendererType = renderer->type();
int widgetIndex = mRenderTypeComboBox->findData( rendererType );
if ( widgetIndex != -1 )
{
mRenderTypeComboBox->setCurrentIndex( widgetIndex );
}

//prevent change between singleband color renderer and the other renderers
if ( rendererType == "singlebandcolordata" )
{
mRenderTypeComboBox->setEnabled( false );
}
else
{
mRenderTypeComboBox->removeItem( mRenderTypeComboBox->findData( "singlebandcolordata" ) );
}
}
on_mRenderTypeComboBox_currentIndexChanged( mRenderTypeComboBox->currentIndex() );
} // QgsRasterLayerProperties ctor
@@ -407,9 +418,13 @@ void QgsRasterLayerProperties::sync()
*/

//set the transparency slider
sliderTransparency->setValue( 255 - mRasterLayer->getTransparency() );
//update the transparency percentage label
sliderTransparency_valueChanged( 255 - mRasterLayer->getTransparency() );
QgsRasterRenderer* renderer = mRasterLayer->renderer();
if ( renderer )
{
sliderTransparency->setValue(( 1.0 - renderer->opacity() ) * 255 );
//update the transparency percentage label
sliderTransparency_valueChanged(( 1.0 - renderer->opacity() ) * 255 );
}

int myIndex = cboxTransparencyBand->findText( mRasterLayer->transparentBandName() );
if ( -1 != myIndex )

0 comments on commit 99c7a81

Please sign in to comment.
You can’t perform that action at this time.