Skip to content
Permalink
Browse files

Adapt user interface for multiple grids

  • Loading branch information
mhugent committed Jul 9, 2014
1 parent a09fbc0 commit 3d922db71c6a39c974b3f5c349b6ae046b1ebb61
Showing with 447 additions and 420 deletions.
  1. +22 −7 src/app/composer/qgscomposermapwidget.cpp
  2. +1 −1 src/app/composer/qgscomposermapwidget.h
  3. +424 −412 src/ui/qgscomposermapwidgetbase.ui
@@ -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() ) );
@@ -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 )
@@ -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 );

0 comments on commit 3d922db

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