Skip to content
Permalink
Browse files

Fix missing initial line label placement hint text

  • Loading branch information
nyalldawson committed Sep 2, 2020
1 parent f5ce577 commit 682740f3bd4fdf16db93b0072d00e4d531fccda2
Showing with 19 additions and 12 deletions.
  1. +18 −12 src/gui/labeling/qgslabellineanchorwidget.cpp
  2. +1 −0 src/gui/labeling/qgslabellineanchorwidget.h
@@ -59,21 +59,11 @@ QgsLabelLineAnchorWidget::QgsLabelLineAnchorWidget( QWidget *parent, QgsVectorLa
if ( !mBlockSignals )
emit changed();

QString hint;
switch ( static_cast< QgsLabelLineSettings::AnchorType >( mAnchorTypeComboBox->currentData().toInt() ) )
{
case QgsLabelLineSettings::AnchorType::Strict:
hint = tr( "Labels are placed exactly on the label anchor only, and no other fallback placements are permitted." );
break;

case QgsLabelLineSettings::AnchorType::HintOnly:
hint = tr( "The label anchor is treated as a hint for the preferred label placement, but other placements close to the anchor point are permitted." );
break;
}
mAnchorTypeHintLabel->setText( hint );
updateAnchorTypeHint();
} );

registerDataDefinedButton( mLinePlacementDDBtn, QgsPalLayerSettings::LineAnchorPercent );
updateAnchorTypeHint();
}

void QgsLabelLineAnchorWidget::setSettings( const QgsLabelLineSettings &settings )
@@ -117,3 +107,19 @@ void QgsLabelLineAnchorWidget::updateDataDefinedProperties( QgsPropertyCollectio
{
properties.setProperty( QgsPalLayerSettings::LineAnchorPercent, mDataDefinedProperties.property( QgsPalLayerSettings::LineAnchorPercent ) );
}

void QgsLabelLineAnchorWidget::updateAnchorTypeHint()
{
QString hint;
switch ( static_cast< QgsLabelLineSettings::AnchorType >( mAnchorTypeComboBox->currentData().toInt() ) )
{
case QgsLabelLineSettings::AnchorType::Strict:
hint = tr( "Labels are placed exactly on the label anchor only, and no other fallback placements are permitted." );
break;

case QgsLabelLineSettings::AnchorType::HintOnly:
hint = tr( "The label anchor is treated as a hint for the preferred label placement, but other placements close to the anchor point are permitted." );
break;
}
mAnchorTypeHintLabel->setText( hint );
}
@@ -61,6 +61,7 @@ class GUI_EXPORT QgsLabelLineAnchorWidget : public QgsLabelSettingsWidgetBase, p

bool mBlockSignals = false;

void updateAnchorTypeHint();
};

#endif // QGSLABELLINEANCHORWIDGET_H

0 comments on commit 682740f

Please sign in to comment.
You can’t perform that action at this time.