Skip to content

Commit

Permalink
Adapt user interface for multiple grids
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Jul 9, 2014
1 parent a09fbc0 commit 3d922db
Show file tree
Hide file tree
Showing 3 changed files with 447 additions and 420 deletions.
29 changes: 22 additions & 7 deletions src/app/composer/qgscomposermapwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,23 @@ QgsComposerMapWidget::QgsComposerMapWidget( QgsComposerMap* composerMap ): QgsCo
mPreviewModeComboBox->insertItem( 1, tr( "Render" ) );
mPreviewModeComboBox->insertItem( 2, tr( "Rectangle" ) );

mGridTypeComboBox->insertItem( 0, tr( "Solid" ) );
mGridTypeComboBox->insertItem( 1, tr( "Cross" ) );

mAnnotationFormatComboBox->insertItem( 0, tr( "Decimal" ) );
mAnnotationFormatComboBox->insertItem( 1, tr( "DegreeMinute" ) );
mAnnotationFormatComboBox->insertItem( 2, tr( "DegreeMinuteSecond" ) );

insertAnnotationPositionEntries( mAnnotationPositionLeftComboBox );
insertAnnotationPositionEntries( mAnnotationPositionRightComboBox );
insertAnnotationPositionEntries( mAnnotationPositionTopComboBox );
insertAnnotationPositionEntries( mAnnotationPositionBottomComboBox );

insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxLeft );
insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxRight );
insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxTop );
insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxBottom );

if ( composerMap )
{
connect( composerMap, SIGNAL( itemChanged() ), this, SLOT( setGuiElementValues() ) );
Expand Down Expand Up @@ -1606,20 +1623,18 @@ void QgsComposerMapWidget::on_mAnnotationFontButton_clicked()
}
}

void QgsComposerMapWidget::on_mAnnotationFontColorButton_clicked()
void QgsComposerMapWidget::on_mAnnotationFontColorButton_colorChanged( const QColor& color )
{
QgsComposerMapGrid* grid = currentGrid();
if ( !grid )
{
return;
}

QColor c = QColorDialog::getColor( grid->gridAnnotationFontColor(), 0, tr( "Annotation color" ) );
if ( c.isValid() )
{
grid->setGridAnnotationFontColor( c );
mAnnotationFontColorButton->setColor( c );
}
mComposerMap->beginCommand( tr( "Annotation color changed" ) );
grid->setGridAnnotationFontColor( color );
mComposerMap->update();
mComposerMap->endCommand();
}

void QgsComposerMapWidget::on_mAnnotationFormatComboBox_currentIndexChanged( int index )
Expand Down
2 changes: 1 addition & 1 deletion src/app/composer/qgscomposermapwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class QgsComposerMapWidget: public QgsComposerItemBaseWidget, private Ui::QgsCom
void on_mCoordinatePrecisionSpinBox_valueChanged( int value );
void on_mDistanceToMapFrameSpinBox_valueChanged( double d );
void on_mAnnotationFontButton_clicked();
void on_mAnnotationFontColorButton_clicked();
void on_mAnnotationFontColorButton_colorChanged( const QColor &color );

protected:
void showEvent( QShowEvent * event );
Expand Down
Loading

0 comments on commit 3d922db

Please sign in to comment.