Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Reorder label modes combo box
  • Loading branch information
nyalldawson committed Jan 13, 2016
1 parent 04caab2 commit 8bd92fb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/app/qgslabelingwidget.cpp
Expand Up @@ -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
{
Expand All @@ -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();
}
Expand All @@ -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 ) )
{
Expand All @@ -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 );
}
Expand Down
10 changes: 5 additions & 5 deletions src/ui/qgslabelingwidget.ui
Expand Up @@ -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>
Expand All @@ -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>
Expand Down

0 comments on commit 8bd92fb

Please sign in to comment.