Skip to content
Permalink
Browse files

[composer] Add undo/redo support for item transparency and blend mode…

…s, symbol change for shapes, overviews and grid styles
  • Loading branch information
nyalldawson committed Apr 13, 2014
1 parent 20bac72 commit 5bd87c81e8ada2093ec770787eb203598d069d14
@@ -90,7 +90,8 @@ class QgsComposerMergeCommand : QgsComposerItemCommand
//item
ItemOutlineWidth,
ItemMove,
ItemRotation
ItemRotation,
ItemTransparency
};

QgsComposerMergeCommand( Context c, QgsComposerItem* item, const QString& text );
@@ -401,15 +401,19 @@ void QgsComposerItemWidget::on_mBlendModeCombo_currentIndexChanged( int index )
Q_UNUSED( index );
if ( mItem )
{
mItem->beginCommand( tr( "Item blend mode changed" ) );
mItem->setBlendMode( mBlendModeCombo->blendMode() );
mItem->endCommand();
}
}

void QgsComposerItemWidget::on_mTransparencySlider_valueChanged( int value )
{
if ( mItem )
{
mItem->beginCommand( tr( "Item transparency changed" ), QgsComposerMergeCommand::ItemTransparency );
mItem->setTransparency( value );
mItem->endCommand();
}
}

@@ -773,12 +773,18 @@ void QgsComposerMapWidget::on_mOverviewFrameStyleButton_clicked()
return;
}

mComposerMap->beginCommand( tr( "Overview frame style changed" ) );
QgsSymbolV2SelectorDialog d( mComposerMap->overviewFrameMapSymbol(), QgsStyleV2::defaultStyle(), 0 );

//QgsSymbolV2PropertiesDialog d( mComposerMap->overviewFrameMapSymbol(), 0, this );
if ( d.exec() == QDialog::Accepted )
{
updateOverviewSymbolMarker();
mComposerMap->endCommand();
}
else
{
mComposerMap->cancelCommand();
}
}

@@ -892,10 +898,16 @@ void QgsComposerMapWidget::on_mGridLineStyleButton_clicked()
return;
}

mComposerMap->beginCommand( tr( "Grid line style changed" ) );
QgsSymbolV2SelectorDialog d( mComposerMap->gridLineSymbol(), QgsStyleV2::defaultStyle(), 0 );
if ( d.exec() == QDialog::Accepted )
{
updateLineSymbolMarker();
mComposerMap->endCommand();
}
else
{
mComposerMap->cancelCommand();
}

mComposerMap->update();
@@ -111,11 +111,17 @@ void QgsComposerShapeWidget::on_mShapeStyleButton_clicked()
coverageLayer = mComposerShape->composition()->atlasComposition().coverageLayer();
}

mComposerShape->beginCommand( tr( "Shape style changed" ) );
QgsSymbolV2SelectorDialog d( mComposerShape->shapeStyleSymbol(), QgsStyleV2::defaultStyle(), coverageLayer );

if ( d.exec() == QDialog::Accepted )
{
updateShapeStyle();
mComposerShape->endCommand();
}
else
{
mComposerShape->cancelCommand();
}
}

@@ -118,7 +118,8 @@ class CORE_EXPORT QgsComposerMergeCommand: public QgsComposerItemCommand
//item
ItemOutlineWidth,
ItemMove,
ItemRotation
ItemRotation,
ItemTransparency
};

QgsComposerMergeCommand( Context c, QgsComposerItem* item, const QString& text );

0 comments on commit 5bd87c8

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