Skip to content

Commit

Permalink
[labeling] Fix handling of data-defined callouts (both UI/UX and rend…
Browse files Browse the repository at this point in the history
…ering)
  • Loading branch information
nirvn authored and nyalldawson committed Mar 26, 2021
1 parent 82af02c commit a15d881
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/app/labeling/qgslabelpropertydialog.cpp
Expand Up @@ -16,6 +16,7 @@
***************************************************************************/

#include "qgslabelpropertydialog.h"
#include "qgscallout.h"
#include "qgsfontutils.h"
#include "qgslogger.h"
#include "qgsfeatureiterator.h"
Expand Down Expand Up @@ -187,6 +188,7 @@ void QgsLabelPropertyDialog::init( const QString &layerId, const QString &provid

mShowLabelChkbx->setChecked( true );
mBufferDrawChkbx->setChecked( buffer.enabled() );
mShowCalloutChkbx->setChecked( layerSettings.callout() ? layerSettings.callout()->enabled() : false );
mFontColorButton->setColor( format.color() );
mBufferColorButton->setColor( buffer.color() );
mMinScaleWidget->setScale( layerSettings.minimumScale );
Expand Down
3 changes: 0 additions & 3 deletions src/core/callouts/qgscallout.cpp
Expand Up @@ -117,9 +117,6 @@ QgsCallout::DrawOrder QgsCallout::drawOrder() const

void QgsCallout::render( QgsRenderContext &context, QRectF rect, const double angle, const QgsGeometry &anchor, QgsCalloutContext &calloutContext )
{
if ( !mEnabled )
return;

#if 0 // for debugging
QPainter *painter = context.painter();
painter->save();
Expand Down
3 changes: 1 addition & 2 deletions src/gui/qgstextformatwidget.cpp
Expand Up @@ -468,7 +468,7 @@ void QgsTextFormatWidget::initWidget()
{
updateShadowFrameStatus();
} );
connect( mCalloutDrawDDBtn, &QgsPropertyOverrideButton::activated, this, &QgsTextFormatWidget::updateCalloutFrameStatus );
connect( mCalloutDrawDDBtn, &QgsPropertyOverrideButton::changed, this, &QgsTextFormatWidget::updateCalloutFrameStatus );
connect( mCalloutsDrawCheckBox, &QCheckBox::stateChanged, this, [ = ]( int )
{
updateCalloutFrameStatus();
Expand Down Expand Up @@ -809,7 +809,6 @@ void QgsTextFormatWidget::populateDataDefinedButtons()
registerDataDefinedButton( mZIndexDDBtn, QgsPalLayerSettings::ZIndex );

registerDataDefinedButton( mCalloutDrawDDBtn, QgsPalLayerSettings::CalloutDraw );
mCalloutDrawDDBtn->registerCheckedWidget( mCalloutsDrawCheckBox );

registerDataDefinedButton( mLabelAllPartsDDBtn, QgsPalLayerSettings::LabelAllParts );
}
Expand Down

0 comments on commit a15d881

Please sign in to comment.