Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
multicolumn composer legend
  • Loading branch information
blazek committed Nov 13, 2012
1 parent d8d9766 commit 1b437d3
Show file tree
Hide file tree
Showing 7 changed files with 423 additions and 136 deletions.
15 changes: 14 additions & 1 deletion src/app/composer/qgscomposerlegendwidget.cpp
Expand Up @@ -87,6 +87,7 @@ void QgsComposerLegendWidget::setGuiElements()

blockAllSignals( true );
mTitleLineEdit->setText( mLegend->title() );
mColumnCountSpinBox->setValue( mLegend->columnCount() );
mSymbolWidthSpinBox->setValue( mLegend->symbolWidth() );
mSymbolHeightSpinBox->setValue( mLegend->symbolHeight() );
mGroupSpaceSpinBox->setValue( mLegend->groupSpace() );
Expand All @@ -109,7 +110,6 @@ void QgsComposerLegendWidget::setGuiElements()
{
mMapComboBox->setCurrentIndex( mMapComboBox->findData( -1 ) );
}

blockAllSignals( false );
}

Expand Down Expand Up @@ -137,6 +137,18 @@ void QgsComposerLegendWidget::on_mTitleLineEdit_textChanged( const QString& text
}
}

void QgsComposerLegendWidget::on_mColumnCountSpinBox_valueChanged( int c )
{
if ( mLegend )
{
mLegend->beginCommand( tr( "Legend column count" ), QgsComposerMergeCommand::LegendColumnCount );
mLegend->setColumnCount( c );
mLegend->adjustBoxSize();
mLegend->update();
mLegend->endCommand();
}
}

void QgsComposerLegendWidget::on_mSymbolWidthSpinBox_valueChanged( double d )
{
if ( mLegend )
Expand Down Expand Up @@ -718,6 +730,7 @@ void QgsComposerLegendWidget::blockAllSignals( bool b )
mItemTreeView->blockSignals( b );
mCheckBoxAutoUpdate->blockSignals( b );
mMapComboBox->blockSignals( b );
mColumnCountSpinBox->blockSignals( b );
mSymbolWidthSpinBox->blockSignals( b );
mSymbolHeightSpinBox->blockSignals( b );
mGroupSpaceSpinBox->blockSignals( b );
Expand Down
1 change: 1 addition & 0 deletions src/app/composer/qgscomposerlegendwidget.h
Expand Up @@ -41,6 +41,7 @@ class QgsComposerLegendWidget: public QWidget, private Ui::QgsComposerLegendWidg

void on_mWrapCharLineEdit_textChanged( const QString& text );
void on_mTitleLineEdit_textChanged( const QString& text );
void on_mColumnCountSpinBox_valueChanged( int c );
void on_mSymbolWidthSpinBox_valueChanged( double d );
void on_mSymbolHeightSpinBox_valueChanged( double d );
void on_mGroupSpaceSpinBox_valueChanged( double d );
Expand Down
1 change: 1 addition & 0 deletions src/core/composer/qgscomposeritemcommand.h
Expand Up @@ -80,6 +80,7 @@ class CORE_EXPORT QgsComposerMergeCommand: public QgsComposerItemCommand
ComposerMapAnnotationDistance,
//composer legend
ComposerLegendText,
LegendColumnCount,
LegendSymbolWidth,
LegendSymbolHeight,
LegendGroupSpace,
Expand Down

0 comments on commit 1b437d3

Please sign in to comment.