diff --git a/src/app/layout/qgslayoutshapewidget.cpp b/src/app/layout/qgslayoutshapewidget.cpp index 2c1e823ff12..03173efddf5 100644 --- a/src/app/layout/qgslayoutshapewidget.cpp +++ b/src/app/layout/qgslayoutshapewidget.cpp @@ -60,9 +60,11 @@ QgsLayoutShapeWidget::QgsLayoutShapeWidget( QgsLayoutItemShape *shape ) connect( mShapeStyleButton, &QgsSymbolButton::changed, this, &QgsLayoutShapeWidget::symbolChanged ); connect( mRadiusUnitsComboBox, &QgsLayoutUnitsComboBox::changed, this, &QgsLayoutShapeWidget::radiusUnitsChanged ); -#if 0 //TODO - mShapeStyleButton->setLayer( atlasCoverageLayer() ); -#endif + mShapeStyleButton->setLayer( coverageLayer() ); + if ( mShape->layout() ) + { + connect( &mShape->layout()->context(), &QgsLayoutContext::layerChanged, mShapeStyleButton, &QgsSymbolButton::setLayer ); + } } bool QgsLayoutShapeWidget::setNewItem( QgsLayoutItem *item ) diff --git a/src/core/layout/qgslayoutitemshape.cpp b/src/core/layout/qgslayoutitemshape.cpp index 0f59aec24fb..6bf7c3ca745 100644 --- a/src/core/layout/qgslayoutitemshape.cpp +++ b/src/core/layout/qgslayoutitemshape.cpp @@ -43,15 +43,6 @@ QgsLayoutItemShape::QgsLayoutItemShape( QgsLayout *layout ) updateBoundingRect(); update(); } ); - -#if 0 //TODO - if ( mComposition ) - { - //connect to atlas feature changes - //to update symbol style (in case of data-defined symbology) - connect( &mComposition->atlasComposition(), &QgsAtlasComposition::featureChanged, this, &QgsComposerItem::repaint ); - } -#endif } int QgsLayoutItemShape::type() const