Skip to content
Permalink
Browse files

More command compression for legend items

  • Loading branch information
nyalldawson committed Oct 24, 2017
1 parent bc23664 commit 27c3eb92c2fdf7d9bc65e401d07d09998a9544c8
@@ -101,6 +101,10 @@ class QgsLayoutItem : QgsLayoutObject, QGraphicsRectItem, QgsLayoutUndoObjectInt
UndoLegendLineSpacing,
UndoLegendRasterStrokeWidth,
UndoLegendRasterStrokeColor,
UndoLegendTitleFont,
UndoLegendGroupFont,
UndoLegendLayerFont,
UndoLegendItemFont,
UndoCustomCommand,
};

@@ -400,7 +400,7 @@ void QgsLayoutLegendWidget::titleFontChanged()
{
if ( mLegend )
{
mLegend->beginCommand( tr( "Change Title Font" ) );
mLegend->beginCommand( tr( "Change Title Font" ), QgsLayoutItem::UndoLegendTitleFont );
mLegend->setStyleFont( QgsLegendStyle::Title, mTitleFontButton->currentFont() );
mLegend->adjustBoxSize();
mLegend->update();
@@ -412,7 +412,7 @@ void QgsLayoutLegendWidget::groupFontChanged()
{
if ( mLegend )
{
mLegend->beginCommand( tr( "Change Group Font" ) );
mLegend->beginCommand( tr( "Change Group Font" ), QgsLayoutItem::UndoLegendGroupFont );
mLegend->setStyleFont( QgsLegendStyle::Group, mGroupFontButton->currentFont() );
mLegend->adjustBoxSize();
mLegend->update();
@@ -424,7 +424,7 @@ void QgsLayoutLegendWidget::layerFontChanged()
{
if ( mLegend )
{
mLegend->beginCommand( tr( "Change Layer Font" ) );
mLegend->beginCommand( tr( "Change Layer Font" ), QgsLayoutItem::UndoLegendLayerFont );
mLegend->setStyleFont( QgsLegendStyle::Subgroup, mLayerFontButton->currentFont() );
mLegend->adjustBoxSize();
mLegend->update();
@@ -436,7 +436,7 @@ void QgsLayoutLegendWidget::itemFontChanged()
{
if ( mLegend )
{
mLegend->beginCommand( tr( "Change Item Font" ) );
mLegend->beginCommand( tr( "Change Item Font" ), QgsLayoutItem::UndoLegendItemFont );
mLegend->setStyleFont( QgsLegendStyle::SymbolLabel, mItemFontButton->currentFont() );
mLegend->adjustBoxSize();
mLegend->update();
@@ -134,6 +134,10 @@ class CORE_EXPORT QgsLayoutItem : public QgsLayoutObject, public QGraphicsRectIt
UndoLegendLineSpacing, //!< Legend line spacing
UndoLegendRasterStrokeWidth, //!< Legend raster stroke width
UndoLegendRasterStrokeColor, //!< Legend raster stroke color
UndoLegendTitleFont, //!< Legend title font
UndoLegendGroupFont, //!< Legend group font
UndoLegendLayerFont, //!< Legend layer font
UndoLegendItemFont, //!< Legend item font
UndoCustomCommand, //!< Base id for plugin based item undo commands
};

0 comments on commit 27c3eb9

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