Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
starting to refresh the scalebar composer item
  • Loading branch information
redlegoreng authored and mhugent committed Jan 22, 2013
1 parent 6dcb5f4 commit bce952c
Show file tree
Hide file tree
Showing 3 changed files with 154 additions and 88 deletions.
26 changes: 25 additions & 1 deletion src/app/composer/qgscomposerscalebarwidget.cpp
Expand Up @@ -204,7 +204,7 @@ void QgsComposerScaleBarWidget::on_mLineWidthSpinBox_valueChanged( double d )

mComposerScaleBar->beginCommand( tr( "Scalebar line width" ), QgsComposerMergeCommand::ScaleBarLineWidth );
disconnectUpdateSignal();
QPen newPen( QColor( 0, 0, 0 ) );
QPen newPen( mComposerScaleBar->pen().color() );
newPen.setWidthF( d );
mComposerScaleBar->setPen( newPen );
mComposerScaleBar->update();
Expand Down Expand Up @@ -321,6 +321,30 @@ void QgsComposerScaleBarWidget::on_mColorPushButton_clicked()
mComposerScaleBar->endCommand();
}

void QgsComposerScaleBarWidget::on_mStrokeColorPushButton_clicked()
{
if ( !mComposerScaleBar )
{
return;
}

QColor oldColor = mComposerScaleBar->pen().color();
QColor newColor = QColorDialog::getColor( oldColor, 0 );

if ( !newColor.isValid() ) //user canceled the dialog
{
return;
}

mComposerScaleBar->beginCommand( tr( "Scalebar color changed" ) );
disconnectUpdateSignal();
QPen newPen( newColor );
mComposerScaleBar->setPen( newBrush );
mComposerScaleBar->update();
connectUpdateSignal();
mComposerScaleBar->endCommand();
}

void QgsComposerScaleBarWidget::on_mUnitLabelLineEdit_textChanged( const QString& text )
{
if ( !mComposerScaleBar )
Expand Down
1 change: 1 addition & 0 deletions src/app/composer/qgscomposerscalebarwidget.h
Expand Up @@ -42,6 +42,7 @@ class QgsComposerScaleBarWidget: public QWidget, private Ui::QgsComposerScaleBar
void on_mUnitLabelLineEdit_textChanged( const QString& text );
void on_mMapUnitsPerBarUnitSpinBox_valueChanged( double d );
void on_mColorPushButton_clicked();
void on_mStrokeColorPushButton_clicked();
void on_mFontButton_clicked();
void on_mStyleComboBox_currentIndexChanged( const QString& text );
void on_mLabelBarSpaceSpinBox_valueChanged( double d );
Expand Down

0 comments on commit bce952c

Please sign in to comment.