Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Some UI tweaks to graduated renderer widget
  • Loading branch information
nyalldawson committed Apr 11, 2015
1 parent 66d55da commit 0405a65
Show file tree
Hide file tree
Showing 3 changed files with 311 additions and 311 deletions.
11 changes: 7 additions & 4 deletions src/gui/symbology-ng/qgsgraduatedsymbolrendererv2widget.cpp
Expand Up @@ -419,6 +419,7 @@ QgsGraduatedSymbolRendererV2Widget::QgsGraduatedSymbolRendererV2Widget( QgsVecto

mGraduatedSymbol = QgsSymbolV2::defaultSymbol( mLayer->geometryType() );

methodComboBox->blockSignals( true );
methodComboBox->addItem( "Color" );
if ( mGraduatedSymbol->type() == QgsSymbolV2::Marker )
{
Expand All @@ -432,6 +433,7 @@ QgsGraduatedSymbolRendererV2Widget::QgsGraduatedSymbolRendererV2Widget( QgsVecto
minSizeSpinBox->setValue( .1 );
maxSizeSpinBox->setValue( 2 );
}
methodComboBox->blockSignals( false );

connect( mExpressionWidget, SIGNAL( fieldChanged( QString ) ), this, SLOT( graduatedColumnChanged( QString ) ) );
connect( viewGraduated, SIGNAL( doubleClicked( const QModelIndex & ) ), this, SLOT( rangesDoubleClicked( const QModelIndex & ) ) );
Expand All @@ -447,8 +449,6 @@ QgsGraduatedSymbolRendererV2Widget::QgsGraduatedSymbolRendererV2Widget( QgsVecto

connect( mSizeUnitWidget, SIGNAL( changed() ), this, SLOT( on_mSizeUnitWidget_changed() ) );

connect( methodComboBox, SIGNAL( currentIndexChanged( int ) ), this, SLOT( on_methodComboBox_currentChanged( int ) ) );

connectUpdateHandlers();

// initialize from previously set renderer
Expand Down Expand Up @@ -564,6 +564,7 @@ void QgsGraduatedSymbolRendererV2Widget::updateUiFromRenderer( bool updateCount
}

// set source color ramp
methodComboBox->blockSignals( true );
if ( mRenderer->graduatedMethod() == QgsGraduatedSymbolRendererV2::GraduatedColor )
{
methodComboBox->setCurrentIndex( 0 );
Expand All @@ -580,6 +581,8 @@ void QgsGraduatedSymbolRendererV2Widget::updateUiFromRenderer( bool updateCount
maxSizeSpinBox->setValue( mRenderer->maxSymbolSize() );
}
}
mMethodStackedWidget->setCurrentIndex( methodComboBox->currentIndex() );
methodComboBox->blockSignals( false );

QgsRendererRangeV2LabelFormat labelFormat = mRenderer->labelFormat();
txtLegendFormat->setText( labelFormat.format() );
Expand All @@ -598,9 +601,9 @@ void QgsGraduatedSymbolRendererV2Widget::graduatedColumnChanged( QString field )
mRenderer->setClassAttribute( field );
}

void QgsGraduatedSymbolRendererV2Widget::on_methodComboBox_currentChanged( int idx )
void QgsGraduatedSymbolRendererV2Widget::on_methodComboBox_currentIndexChanged( int idx )
{
stackedWidget->setCurrentIndex( idx );
mMethodStackedWidget->setCurrentIndex( idx );
if ( idx == 0 )
{
mRenderer->setGraduatedMethod( QgsGraduatedSymbolRendererV2::GraduatedColor );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/symbology-ng/qgsgraduatedsymbolrendererv2widget.h
Expand Up @@ -110,7 +110,7 @@ class GUI_EXPORT QgsGraduatedSymbolRendererV2Widget : public QgsRendererV2Widget
void rowsMoved();
void modelDataChanged();
void on_mSizeUnitWidget_changed();
void on_methodComboBox_currentChanged( int );
void on_methodComboBox_currentIndexChanged( int );

protected:
void updateUiFromRenderer( bool updateCount = true );
Expand Down

0 comments on commit 0405a65

Please sign in to comment.