Skip to content

Commit

Permalink
Change some remaining alpha/transparency strings to opacity
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 30, 2017
1 parent 9482920 commit d4c8762
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions python/core/qgscolorramp.sip
Expand Up @@ -246,11 +246,11 @@ Creates a new QgsColorRamp from a map of properties
.. seealso:: info()
%End

void addStopsToGradient( QGradient *gradient, double alpha = 1 );
void addStopsToGradient( QGradient *gradient, double opacity = 1 );
%Docstring
Copy color ramp stops to a QGradient
\param gradient gradient to copy stops into
\param alpha alpha multiplier. Opacity of colors will be multiplied
\param opacity opacity multiplier. Opacity of colors will be multiplied
by this factor before adding to the gradient.
.. versionadded:: 2.1
%End
Expand Down
2 changes: 1 addition & 1 deletion python/gui/symbology-ng/qgsrendererwidget.sip
Expand Up @@ -57,7 +57,7 @@ class QgsRendererWidget : QgsPanelWidget
/** Change color of selected symbols*/
void changeSymbolColor();
/** Change opacity of selected symbols*/
void changeSymbolTransparency();
void changeSymbolOpacity();
/** Change units mm/map units of selected symbols*/
void changeSymbolUnit();
/** Change line widths of selected symbols*/
Expand Down
2 changes: 1 addition & 1 deletion src/core/composer/qgscomposeritem.h
Expand Up @@ -378,7 +378,7 @@ class CORE_EXPORT QgsComposerItem: public QgsComposerObject, public QGraphicsRec
* \param opacity double between 1.0 (opaque) and 0 (transparent).
* \see itemOpacity()
*/
void setItemOpacity( const double itemOpacity );
void setItemOpacity( const double opacity );

/** Returns whether effects (e.g., blend modes) are enabled for the item
* \returns true if effects are enabled
Expand Down
12 changes: 6 additions & 6 deletions src/core/qgscolorramp.cpp
Expand Up @@ -275,15 +275,15 @@ void QgsGradientColorRamp::setStops( const QgsGradientStopsList &stops )
std::sort( mStops.begin(), mStops.end(), stopLessThan );
}

void QgsGradientColorRamp::addStopsToGradient( QGradient *gradient, double alpha )
void QgsGradientColorRamp::addStopsToGradient( QGradient *gradient, double opacity )
{
//copy color ramp stops to a QGradient
QColor color1 = mColor1;
QColor color2 = mColor2;
if ( alpha < 1 )
if ( opacity < 1 )
{
color1.setAlpha( color1.alpha() * alpha );
color2.setAlpha( color2.alpha() * alpha );
color1.setAlpha( color1.alpha() * opacity );
color2.setAlpha( color2.alpha() * opacity );
}
gradient->setColorAt( 0, color1 );
gradient->setColorAt( 1, color2 );
Expand All @@ -292,9 +292,9 @@ void QgsGradientColorRamp::addStopsToGradient( QGradient *gradient, double alpha
it != mStops.constEnd(); ++it )
{
QColor rampColor = it->color;
if ( alpha < 1 )
if ( opacity < 1 )
{
rampColor.setAlpha( rampColor.alpha() * alpha );
rampColor.setAlpha( rampColor.alpha() * opacity );
}
gradient->setColorAt( it->offset, rampColor );
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgscolorramp.h
Expand Up @@ -226,11 +226,11 @@ class CORE_EXPORT QgsGradientColorRamp : public QgsColorRamp

/** Copy color ramp stops to a QGradient
* \param gradient gradient to copy stops into
* \param alpha alpha multiplier. Opacity of colors will be multiplied
* \param opacity opacity multiplier. Opacity of colors will be multiplied
* by this factor before adding to the gradient.
* \since QGIS 2.1
*/
void addStopsToGradient( QGradient *gradient, double alpha = 1 );
void addStopsToGradient( QGradient *gradient, double opacity = 1 );

protected:
QColor mColor1;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsgradientcolorrampdialog.cpp
Expand Up @@ -125,7 +125,7 @@ QgsGradientColorRampDialog::QgsGradientColorRampDialog( const QgsGradientColorRa
mSaturationCurve->attach( mPlot );

mAlphaCurve = new QwtPlotCurve();
mAlphaCurve->setTitle( QStringLiteral( "Alpha" ) );
mAlphaCurve->setTitle( QStringLiteral( "Opacity" ) );
mAlphaCurve->setPen( QPen( QColor( 50, 50, 50 ), 0.0 ) ),
mAlphaCurve->setRenderHint( QwtPlotItem::RenderAntialiased, true );
mAlphaCurve->attach( mPlot );
Expand Down
16 changes: 8 additions & 8 deletions src/ui/qgsgradientcolorrampdialogbase.ui
Expand Up @@ -148,7 +148,7 @@
<x>0</x>
<y>0</y>
<width>850</width>
<height>494</height>
<height>492</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="0,1">
Expand Down Expand Up @@ -280,7 +280,7 @@
<item>
<widget class="QCheckBox" name="mPlotAlphaCheckbox">
<property name="text">
<string>Alpha</string>
<string>Opacity</string>
</property>
</widget>
</item>
Expand Down Expand Up @@ -336,18 +336,18 @@
<header>qgsscrollarea.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsColorButton</class>
<extends>QToolButton</extends>
<header>qgscolorbutton.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsCollapsibleGroupBox</class>
<extends>QGroupBox</extends>
<header>qgscollapsiblegroupbox.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsColorButton</class>
<extends>QToolButton</extends>
<header>qgscolorbutton.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsDoubleSpinBox</class>
<extends>QDoubleSpinBox</extends>
Expand Down

0 comments on commit d4c8762

Please sign in to comment.