Skip to content
Permalink
Browse files

Edit symbol transparency in percent values [0-100] instead of [0-1]

  • Loading branch information
wonder-sk committed Jan 31, 2012
1 parent f854acb commit f490d0a49016b6f74b65afa38584e5b4520c9122
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/gui/symbology-ng/qgsrendererv2widget.cpp
@@ -61,13 +61,14 @@ void QgsRendererV2Widget::changeSymbolTransparency()
}

bool ok;
double transparency = QInputDialog::getDouble( this, tr( "Transparency" ), tr( "Change symbol transparency" ), 1 - symbolList.at( 0 )->alpha(), 0.0, 1.0, 1, &ok );
double oldTransparency = ( 1 - symbolList.at( 0 )->alpha() ) * 100; // convert to percents
double transparency = QInputDialog::getDouble( this, tr( "Transparency" ), tr( "Change symbol transparency [%]" ), oldTransparency, 0.0, 100.0, 0, &ok );
if ( ok )
{
QList<QgsSymbolV2*>::iterator symbolIt = symbolList.begin();
for ( ; symbolIt != symbolList.end(); ++symbolIt )
{
( *symbolIt )->setAlpha( 1 - transparency );
( *symbolIt )->setAlpha( 1 - transparency / 100 );
}
refreshSymbolView();
}

0 comments on commit f490d0a

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