Skip to content

Commit

Permalink
Fix #14897 - Remove double undo/redo buttons (#8189)
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanW2 committed Oct 15, 2018
1 parent 3a684c8 commit c0d35ce
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/app/qgslayerstylingwidget.cpp
Expand Up @@ -75,6 +75,7 @@ QgsLayerStylingWidget::QgsLayerStylingWidget( QgsMapCanvas *canvas, const QList<
mAutoApplyTimer->setSingleShot( true );

mUndoWidget = new QgsUndoWidget( this, mMapCanvas );
mUndoWidget->setButtonsVisible( false );
mUndoWidget->setAutoDelete( false );
mUndoWidget->setObjectName( QStringLiteral( "Undo Styles" ) );
mUndoWidget->hide();
Expand Down
5 changes: 5 additions & 0 deletions src/app/qgsundowidget.cpp
Expand Up @@ -38,6 +38,11 @@ QgsUndoWidget::QgsUndoWidget( QWidget *parent, QgsMapCanvas *mapCanvas )
mPreviousCount = 0;
}

void QgsUndoWidget::setButtonsVisible( bool show )
{
undoButton->setVisible( show );
redoButton->setVisible( show );
}

void QgsUndoWidget::destroyStack()
{
Expand Down
6 changes: 6 additions & 0 deletions src/app/qgsundowidget.h
Expand Up @@ -55,6 +55,12 @@ class APP_EXPORT QgsUndoWidget : public QgsPanelWidget
*/
void setUndoStack( QUndoStack *undoStack );

/**
* Show or hide the undo/redo buttons on the widget.
* \param show Show or hide the undo/redo buttons.
*/
void setButtonsVisible( bool show );

/**
* Handles destroying of stack when active layer is changed
*/
Expand Down

0 comments on commit c0d35ce

Please sign in to comment.