Skip to content
Permalink
Browse files
starting to refresh the scalebar composer item
  • Loading branch information
redlegoreng authored and mhugent committed Jan 22, 2013
1 parent 6dcb5f4 commit bce952c69d3ca2fb399d751dda56bfb43f1acca8
Showing with 154 additions and 88 deletions.
  1. +25 −1 src/app/composer/qgscomposerscalebarwidget.cpp
  2. +1 −0 src/app/composer/qgscomposerscalebarwidget.h
  3. +128 −87 src/ui/qgscomposerscalebarwidgetbase.ui
@@ -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();
@@ -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 )
@@ -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 );

0 comments on commit bce952c

Please sign in to comment.