Skip to content
Permalink
Browse files

Reorder label modes combo box

  • Loading branch information
nyalldawson committed Jan 13, 2016
1 parent 04caab2 commit 8bd92fb80f18c8e647887b8fc7686ab64e356006
Showing with 10 additions and 10 deletions.
  1. +5 −5 src/app/qgslabelingwidget.cpp
  2. +5 −5 src/ui/qgslabelingwidget.ui
@@ -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 );
}
@@ -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>

0 comments on commit 8bd92fb

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