Reorder label modes combo box

This commit is contained in:
Nyall Dawson 2016-01-13 13:36:29 +11:00
parent 04caab24a7
commit 8bd92fb80f
2 changed files with 10 additions and 10 deletions

View File

@ -44,7 +44,7 @@ void QgsLabelingWidget::adaptToLayer()
// pick the right mode of the layer
if ( mLayer->labeling() && mLayer->labeling()->type() == "rule-based" )
{
mLabelModeComboBox->setCurrentIndex( 3 );
mLabelModeComboBox->setCurrentIndex( 2 );
}
else
{
@ -59,14 +59,14 @@ void QgsLabelingWidget::adaptToLayer()
}
else
{
mLabelModeComboBox->setCurrentIndex( lyr.drawLabels ? 1 : 2 );
mLabelModeComboBox->setCurrentIndex( lyr.drawLabels ? 1 : 3 );
}
}
}
void QgsLabelingWidget::writeSettingsToLayer()
{
if ( mLabelModeComboBox->currentIndex() == 3 )
if ( mLabelModeComboBox->currentIndex() == 2 )
{
qobject_cast<QgsRuleBasedLabelingWidget*>( mWidget )->writeSettingsToLayer();
}
@ -92,7 +92,7 @@ void QgsLabelingWidget::labelModeChanged( int index )
if ( index < 0 )
return;
if ( index < 3 )
if ( index != 2 )
{
if ( QgsLabelingGui* widgetSimple = qobject_cast<QgsLabelingGui*>( mWidget ) )
{
@ -110,7 +110,7 @@ void QgsLabelingWidget::labelModeChanged( int index )
delete mWidget;
mWidget = nullptr;
if ( index == 3 )
if ( index == 2 )
{
mWidget = new QgsRuleBasedLabelingWidget( mLayer, mCanvas, this );
}

View File

@ -35,11 +35,6 @@
<normaloff>:/images/themes/default/propertyicons/labels.svg</normaloff>:/images/themes/default/propertyicons/labels.svg</iconset>
</property>
</item>
<item>
<property name="text">
<string>Discourage other labels from covering features in this layer</string>
</property>
</item>
<item>
<property name="text">
<string>Rule-based labeling</string>
@ -49,6 +44,11 @@
<normaloff>:/images/themes/default/propertyicons/labels.svg</normaloff>:/images/themes/default/propertyicons/labels.svg</iconset>
</property>
</item>
<item>
<property name="text">
<string>Discourage other labels from covering features in this layer</string>
</property>
</item>
</widget>
</item>
<item>