diff --git a/src/gui/qgslabelinggui.cpp b/src/gui/qgslabelinggui.cpp index dc1d351e8ad9..3c51226dcfa8 100644 --- a/src/gui/qgslabelinggui.cpp +++ b/src/gui/qgslabelinggui.cpp @@ -142,6 +142,7 @@ QgsLabelingGui::QgsLabelingGui( QgsVectorLayer *layer, QgsMapCanvas *mapCanvas, connect( mBufferDrawChkBx, &QAbstractButton::toggled, this, &QgsLabelingGui::updateUi ); connect( mShapeDrawChkBx, &QAbstractButton::toggled, this, &QgsLabelingGui::updateUi ); connect( mShadowDrawChkBx, &QAbstractButton::toggled, this, &QgsLabelingGui::updateUi ); + connect( mCalloutsDrawCheckBox, &QAbstractButton::toggled, this, &QgsLabelingGui::updateUi ); connect( mDirectSymbChkBx, &QAbstractButton::toggled, this, &QgsLabelingGui::updateUi ); connect( mFormatNumChkBx, &QAbstractButton::toggled, this, &QgsLabelingGui::updateUi ); connect( mScaleBasedVisibilityChkBx, &QAbstractButton::toggled, this, &QgsLabelingGui::updateUi ); @@ -580,6 +581,7 @@ void QgsLabelingGui::updateUi() syncDefinedCheckboxFrame( mBufferDrawDDBtn, mBufferDrawChkBx, mBufferFrame ); syncDefinedCheckboxFrame( mShapeDrawDDBtn, mShapeDrawChkBx, mShapeFrame ); syncDefinedCheckboxFrame( mShadowDrawDDBtn, mShadowDrawChkBx, mShadowFrame ); + syncDefinedCheckboxFrame( mCalloutDrawDDBtn, mCalloutsDrawCheckBox, mCalloutFrame ); syncDefinedCheckboxFrame( mDirectSymbDDBtn, mDirectSymbChkBx, mDirectSymbFrame ); syncDefinedCheckboxFrame( mFormatNumDDBtn, mFormatNumChkBx, mFormatNumFrame ); diff --git a/src/gui/qgstextformatwidget.cpp b/src/gui/qgstextformatwidget.cpp index eb28e6c5a42f..9c54ff2882e6 100644 --- a/src/gui/qgstextformatwidget.cpp +++ b/src/gui/qgstextformatwidget.cpp @@ -487,6 +487,11 @@ void QgsTextFormatWidget::initWidget() { updateShadowFrameStatus(); } ); + connect( mCalloutDrawDDBtn, &QgsPropertyOverrideButton::activated, this, &QgsTextFormatWidget::updateCalloutFrameStatus ); + connect( mCalloutsDrawCheckBox, &QCheckBox::stateChanged, this, [ = ]( int ) + { + updateCalloutFrameStatus(); + } ); 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 ); @@ -784,6 +789,8 @@ void QgsTextFormatWidget::populateDataDefinedButtons() registerDataDefinedButton( mZIndexDDBtn, QgsPalLayerSettings::ZIndex ); registerDataDefinedButton( mCalloutDrawDDBtn, QgsPalLayerSettings::CalloutDraw ); + mCalloutDrawDDBtn->registerCheckedWidget( mCalloutsDrawCheckBox ); + registerDataDefinedButton( mLabelAllPartsDDBtn, QgsPalLayerSettings::LabelAllParts ); } @@ -1678,6 +1685,11 @@ void QgsTextFormatWidget::updateShadowFrameStatus() mShadowFrame->setEnabled( mShadowDrawDDBtn->isActive() || mShadowDrawChkBx->isChecked() ); } +void QgsTextFormatWidget::updateCalloutFrameStatus() +{ + mCalloutFrame->setEnabled( mCalloutDrawDDBtn->isActive() || mCalloutsDrawCheckBox->isChecked() ); +} + void QgsTextFormatWidget::setFormatFromStyle( const QString &name, QgsStyle::StyleEntity type ) { switch ( type ) diff --git a/src/gui/qgstextformatwidget.h b/src/gui/qgstextformatwidget.h index a095f985c1fe..6015cc9b7666 100644 --- a/src/gui/qgstextformatwidget.h +++ b/src/gui/qgstextformatwidget.h @@ -300,6 +300,7 @@ class GUI_EXPORT QgsTextFormatWidget : public QWidget, public QgsExpressionConte void updateShapeFrameStatus(); void updateBufferFrameStatus(); void updateShadowFrameStatus(); + void updateCalloutFrameStatus(); }; diff --git a/src/ui/qgstextformatwidgetbase.ui b/src/ui/qgstextformatwidgetbase.ui index b49c53ccaa71..4752ffd16bcf 100644 --- a/src/ui/qgstextformatwidgetbase.ui +++ b/src/ui/qgstextformatwidgetbase.ui @@ -112,7 +112,7 @@ 0 0 - 807 + 806 300 @@ -615,7 +615,7 @@ - 6 + 5 @@ -644,8 +644,8 @@ 0 0 - 775 - 405 + 781 + 395 @@ -1227,8 +1227,8 @@ font-style: italic; 0 0 - 758 - 509 + 767 + 624 @@ -2126,8 +2126,8 @@ font-style: italic; 0 0 - 775 - 405 + 781 + 395 @@ -2472,8 +2472,8 @@ font-style: italic; 0 0 - 758 - 633 + 767 + 696 @@ -3233,8 +3233,8 @@ font-style: italic; 0 0 - 775 - 405 + 767 + 406 @@ -3661,8 +3661,8 @@ font-style: italic; 0 0 - 775 - 405 + 781 + 395 @@ -3694,47 +3694,6 @@ font-style: italic; - - - - 20 - - - 0 - - - - - - - - Style - - - - - - - - - - - This callout type doesn't have any editable properties - - - Qt::AlignCenter - - - true - - - - - - - - - @@ -3761,6 +3720,49 @@ font-style: italic; + + + + + 20 + + + 1 + + + + + + + + Style + + + + + + + + + + + This callout type doesn't have any editable properties + + + Qt::AlignCenter + + + true + + + + + + + + + + @@ -3808,9 +3810,9 @@ font-style: italic; 0 - -263 - 758 - 932 + 0 + 767 + 1035 @@ -5584,8 +5586,8 @@ font-style: italic; 0 0 - 758 - 674 + 767 + 757