Skip to content

Commit

Permalink
More command compression for legend items
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Nov 7, 2017
1 parent bc23664 commit 27c3eb9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions python/core/layout/qgslayoutitem.sip
Expand Up @@ -101,6 +101,10 @@ class QgsLayoutItem : QgsLayoutObject, QGraphicsRectItem, QgsLayoutUndoObjectInt
UndoLegendLineSpacing,
UndoLegendRasterStrokeWidth,
UndoLegendRasterStrokeColor,
UndoLegendTitleFont,
UndoLegendGroupFont,
UndoLegendLayerFont,
UndoLegendItemFont,
UndoCustomCommand,
};

Expand Down
8 changes: 4 additions & 4 deletions src/app/layout/qgslayoutlegendwidget.cpp
Expand Up @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand Down
4 changes: 4 additions & 0 deletions src/core/layout/qgslayoutitem.h
Expand Up @@ -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
};

Expand Down

0 comments on commit 27c3eb9

Please sign in to comment.