Disable label shadow frame by default

This commit is contained in:
Harrissou Sant-anna 2019-10-05 09:57:06 +02:00 committed by Nyall Dawson
parent e73c07b097
commit 47eb526cf2
2 changed files with 12 additions and 1 deletions

View File

@ -482,6 +482,11 @@ void QgsTextFormatWidget::initWidget()
{
updateShapeFrameStatus();
} );
connect( mShadowDrawDDBtn, &QgsPropertyOverrideButton::activated, this, &QgsTextFormatWidget::updateShadowFrameStatus );
connect( mShadowDrawChkBx, &QCheckBox::stateChanged, [ = ]( int )
{
updateShadowFrameStatus();
} );
mGeometryGeneratorType->addItem( QgsApplication::getThemeIcon( QStringLiteral( "/mIconPolygonLayer.svg" ) ), tr( "Polygon / MultiPolygon" ), QgsWkbTypes::GeometryType::PolygonGeometry );
mGeometryGeneratorType->addItem( QgsApplication::getThemeIcon( QStringLiteral( "/mIconLineLayer.svg" ) ), tr( "LineString / MultiLineString" ), QgsWkbTypes::GeometryType::LineGeometry );
@ -855,7 +860,7 @@ void QgsTextFormatWidget::updateWidgetForFormat( const QgsTextFormat &format )
// shape background
mShapeDrawChkBx->setChecked( background.enabled() );
mShapeFrame->setEnabled( background.enabled() || mBufferDrawDDBtn->isActive() );
mShapeFrame->setEnabled( background.enabled() );
mShapeTypeCmbBx->blockSignals( true );
mShapeTypeCmbBx->setCurrentIndex( mShapeTypeCmbBx->findData( background.type() ) );
mShapeTypeCmbBx->blockSignals( false );
@ -906,6 +911,7 @@ void QgsTextFormatWidget::updateWidgetForFormat( const QgsTextFormat &format )
// drop shadow
mShadowDrawChkBx->setChecked( shadow.enabled() );
mShadowFrame->setEnabled( shadow.enabled() );
mShadowUnderCmbBx->setCurrentIndex( mShadowUnderCmbBx->findData( shadow.shadowPlacement() ) );
mShadowOffsetAngleSpnBx->setValue( shadow.offsetAngle() );
mShadowOffsetSpnBx->setValue( shadow.offsetDistance() );
@ -1662,6 +1668,10 @@ void QgsTextFormatWidget::updateBufferFrameStatus()
mBufferFrame->setEnabled( mBufferDrawDDBtn->isActive() || mBufferDrawChkBx->isChecked() );
}
void QgsTextFormatWidget::updateShadowFrameStatus()
{
mShadowFrame->setEnabled( mShadowDrawDDBtn->isActive() || mShadowDrawChkBx->isChecked() );
}
void QgsTextFormatWidget::setFormatFromStyle( const QString &name, QgsStyle::StyleEntity type )
{

View File

@ -299,6 +299,7 @@ class GUI_EXPORT QgsTextFormatWidget : public QWidget, public QgsExpressionConte
void createAuxiliaryField();
void updateShapeFrameStatus();
void updateBufferFrameStatus();
void updateShadowFrameStatus();
};