Skip to content

Commit ccd5c28

Browse files
committedDec 21, 2020
Fix impossible to activate draw effects on settings in font buttons
If we ignore the enabled state when testing whether a paint effect should be saved, then we get stuck in a loop where first enabling the effect still reports the stack as a default stack so the widget immediately unchecks itself and it's impossible for users to actually modify the stack and make it definitely non-default! (cherry picked from commit c851c0f)
1 parent 4ff5558 commit ccd5c28

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
 

‎src/gui/qgstextformatwidget.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ QgsTextFormat QgsTextFormatWidget::format( bool includeDataDefinedProperties ) c
10381038
buffer.setJoinStyle( mBufferJoinStyleComboBox->penJoinStyle() );
10391039
buffer.setFillBufferInterior( mBufferTranspFillChbx->isChecked() );
10401040
buffer.setBlendMode( comboBufferBlendMode->blendMode() );
1041-
if ( mBufferEffect && !QgsPaintEffectRegistry::isDefaultStack( mBufferEffect.get() ) )
1041+
if ( mBufferEffect && ( !QgsPaintEffectRegistry::isDefaultStack( mBufferEffect.get() ) || mBufferEffect->enabled() ) )
10421042
buffer.setPaintEffect( mBufferEffect->clone() );
10431043
else
10441044
buffer.setPaintEffect( nullptr );
@@ -1052,7 +1052,7 @@ QgsTextFormat QgsTextFormatWidget::format( bool includeDataDefinedProperties ) c
10521052
mask.setSizeUnit( mMaskBufferUnitWidget->unit() );
10531053
mask.setSizeMapUnitScale( mMaskBufferUnitWidget->getMapUnitScale() );
10541054
mask.setJoinStyle( mMaskJoinStyleComboBox->penJoinStyle() );
1055-
if ( mMaskEffect && !QgsPaintEffectRegistry::isDefaultStack( mMaskEffect.get() ) )
1055+
if ( mMaskEffect && ( !QgsPaintEffectRegistry::isDefaultStack( mMaskEffect.get() ) || mMaskEffect->enabled() ) )
10561056
mask.setPaintEffect( mMaskEffect->clone() );
10571057
else
10581058
mask.setPaintEffect( nullptr );
@@ -1085,7 +1085,7 @@ QgsTextFormat QgsTextFormatWidget::format( bool includeDataDefinedProperties ) c
10851085
background.setJoinStyle( mShapePenStyleCmbBx->penJoinStyle() );
10861086
background.setOpacity( mBackgroundOpacityWidget->opacity() );
10871087
background.setBlendMode( mShapeBlendCmbBx->blendMode() );
1088-
if ( mBackgroundEffect && !QgsPaintEffectRegistry::isDefaultStack( mBackgroundEffect.get() ) )
1088+
if ( mBackgroundEffect && ( !QgsPaintEffectRegistry::isDefaultStack( mBackgroundEffect.get() ) || mBackgroundEffect->enabled() ) )
10891089
background.setPaintEffect( mBackgroundEffect->clone() );
10901090
else
10911091
background.setPaintEffect( nullptr );

‎src/gui/vector/qgsdiagramproperties.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,7 @@ void QgsDiagramProperties::apply()
882882
ds.setSpacingUnit( mBarSpacingUnitComboBox->unit() );
883883
ds.setSpacingMapUnitScale( mBarSpacingUnitComboBox->getMapUnitScale() );
884884

885-
if ( mPaintEffect && !QgsPaintEffectRegistry::isDefaultStack( mPaintEffect.get() ) )
885+
if ( mPaintEffect && ( !QgsPaintEffectRegistry::isDefaultStack( mPaintEffect.get() ) || mPaintEffect->enabled() ) )
886886
ds.setPaintEffect( mPaintEffect->clone() );
887887
else
888888
ds.setPaintEffect( nullptr );

0 commit comments

Comments
 (0)
Please sign in to comment.