Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[labeling] Fix handling of data-defined buffers (both UI/UX and rende…
…ring behavior)
  • Loading branch information
nirvn authored and github-actions[bot] committed Mar 25, 2021
1 parent 0398e73 commit 65650e0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/app/labeling/qgslabelpropertydialog.cpp
Expand Up @@ -186,6 +186,7 @@ void QgsLabelPropertyDialog::init( const QString &layerId, const QString &provid
mYCoordSpinBox->clear();

mShowLabelChkbx->setChecked( true );
mBufferDrawChkbx->setChecked( buffer.enabled() );
mFontColorButton->setColor( format.color() );
mBufferColorButton->setColor( buffer.color() );
mMinScaleWidget->setScale( layerSettings.minimumScale );
Expand Down
1 change: 0 additions & 1 deletion src/core/labeling/qgspallabeling.cpp
Expand Up @@ -3066,7 +3066,6 @@ void QgsPalLayerSettings::parseTextBuffer( QgsRenderContext &context )
}
else if ( mDataDefinedProperties.isActive( QgsPalLayerSettings::BufferDraw ) && exprVal.isNull() )
{
drawBuffer = false;
dataDefinedValues.insert( QgsPalLayerSettings::BufferDraw, QVariant( drawBuffer ) );
}

Expand Down
8 changes: 3 additions & 5 deletions src/gui/labeling/qgslabelinggui.cpp
Expand Up @@ -32,6 +32,7 @@
#include "callouts/qgscalloutwidget.h"
#include "qgslabelobstaclesettingswidget.h"
#include "qgslabellineanchorwidget.h"

#include <mutex>

#include <QButtonGroup>
Expand Down Expand Up @@ -242,6 +243,7 @@ QgsLabelingGui::QgsLabelingGui( QgsVectorLayer *layer, QgsMapCanvas *mapCanvas,

// connections for groupboxes with separate activation checkboxes (that need to honor data defined setting)
connect( mBufferDrawChkBx, &QAbstractButton::toggled, this, &QgsLabelingGui::updateUi );
connect( mBufferDrawDDBtn, &QgsPropertyOverrideButton::changed, this, &QgsLabelingGui::updateUi );
connect( mEnableMaskChkBx, &QAbstractButton::toggled, this, &QgsLabelingGui::updateUi );
connect( mShapeDrawChkBx, &QAbstractButton::toggled, this, &QgsLabelingGui::updateUi );
connect( mCalloutsDrawCheckBox, &QAbstractButton::toggled, this, &QgsLabelingGui::updateUi );
Expand Down Expand Up @@ -625,11 +627,7 @@ QgsPalLayerSettings QgsLabelingGui::layerSettings()

void QgsLabelingGui::syncDefinedCheckboxFrame( QgsPropertyOverrideButton *ddBtn, QCheckBox *chkBx, QFrame *f )
{
if ( ddBtn->isActive() && !chkBx->isChecked() )
{
chkBx->setChecked( true );
}
f->setEnabled( chkBx->isChecked() );
f->setEnabled( chkBx->isChecked() || ddBtn->isActive() );
}

bool QgsLabelingGui::eventFilter( QObject *object, QEvent *event )
Expand Down
1 change: 0 additions & 1 deletion src/gui/qgstextformatwidget.cpp
Expand Up @@ -707,7 +707,6 @@ void QgsTextFormatWidget::populateDataDefinedButtons()

// text buffer
registerDataDefinedButton( mBufferDrawDDBtn, QgsPalLayerSettings::BufferDraw );
mBufferDrawDDBtn->registerCheckedWidget( mBufferDrawChkBx );
registerDataDefinedButton( mBufferSizeDDBtn, QgsPalLayerSettings::BufferSize );
registerDataDefinedButton( mBufferUnitsDDBtn, QgsPalLayerSettings::BufferUnit );
registerDataDefinedButton( mBufferColorDDBtn, QgsPalLayerSettings::BufferColor );
Expand Down

0 comments on commit 65650e0

Please sign in to comment.