Skip to content

Commit 1cecf8e

Browse files
committedMar 21, 2013
Fix for #7398, allow alpha value change in line pattern fill color picker
- Add alpha picker and render support for: line pattern fill, line decoration symbol, font marker symbol
1 parent 03392c9 commit 1cecf8e

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed
 

‎src/core/symbology-ng/qgslinesymbollayerv2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@ QString QgsLineDecorationSymbolLayerV2::layerType() const
937937
void QgsLineDecorationSymbolLayerV2::startRender( QgsSymbolV2RenderContext& context )
938938
{
939939
QColor penColor = mColor;
940-
penColor.setAlphaF( context.alpha() );
940+
penColor.setAlphaF( mColor.alphaF() * context.alpha() );
941941

942942
double width = mWidth * QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mWidthUnit );
943943
mPen.setWidth( context.outputLineWidth( width ) );

‎src/core/symbology-ng/qgsmarkersymbollayerv2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ void QgsFontMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV2R
979979
{
980980
QPainter* p = context.renderContext().painter();
981981
QColor penColor = context.selected() ? context.selectionColor() : mColor;
982-
penColor.setAlphaF( context.alpha() );
982+
penColor.setAlphaF( mColor.alphaF() * context.alpha() );
983983
p->setPen( penColor );
984984
p->setFont( mFont );
985985

‎src/gui/symbology-ng/qgssymbollayerv2widget.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -967,6 +967,7 @@ void QgsLineDecorationSymbolLayerV2Widget::setSymbolLayer( QgsSymbolLayerV2* lay
967967

968968
// set values
969969
btnChangeColor->setColor( mLayer->color() );
970+
btnChangeColor->setColorDialogOptions( QColorDialog::ShowAlphaChannel );
970971
spinWidth->setValue( mLayer->width() );
971972

972973
mWidthUnitComboBox->blockSignals( true );
@@ -1245,6 +1246,7 @@ void QgsLinePatternFillSymbolLayerWidget::setSymbolLayer( QgsSymbolLayerV2* laye
12451246
mLineWidthSpinBox->setValue( mLayer->lineWidth() );
12461247
mOffsetSpinBox->setValue( mLayer->offset() );
12471248
mColorPushButton->setColor( mLayer->color() );
1249+
mColorPushButton->setColorDialogOptions( QColorDialog::ShowAlphaChannel );
12481250

12491251
//units
12501252
mDistanceUnitComboBox->blockSignals( true );
@@ -1485,6 +1487,7 @@ void QgsFontMarkerSymbolLayerV2Widget::setSymbolLayer( QgsSymbolLayerV2* layer )
14851487
cboFont->setCurrentFont( QFont( mLayer->fontFamily() ) );
14861488
spinSize->setValue( mLayer->size() );
14871489
btnColor->setColor( mLayer->color() );
1490+
btnColor->setColorDialogOptions( QColorDialog::ShowAlphaChannel );
14881491
spinAngle->setValue( mLayer->angle() );
14891492

14901493
//block

0 commit comments

Comments
 (0)
Please sign in to comment.