Skip to content

Commit c0d35ce

Browse files
authored
Fix #14897 - Remove double undo/redo buttons (#8189)
1 parent 3a684c8 commit c0d35ce

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

src/app/qgslayerstylingwidget.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ QgsLayerStylingWidget::QgsLayerStylingWidget( QgsMapCanvas *canvas, const QList<
7575
mAutoApplyTimer->setSingleShot( true );
7676

7777
mUndoWidget = new QgsUndoWidget( this, mMapCanvas );
78+
mUndoWidget->setButtonsVisible( false );
7879
mUndoWidget->setAutoDelete( false );
7980
mUndoWidget->setObjectName( QStringLiteral( "Undo Styles" ) );
8081
mUndoWidget->hide();

src/app/qgsundowidget.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ QgsUndoWidget::QgsUndoWidget( QWidget *parent, QgsMapCanvas *mapCanvas )
3838
mPreviousCount = 0;
3939
}
4040

41+
void QgsUndoWidget::setButtonsVisible( bool show )
42+
{
43+
undoButton->setVisible( show );
44+
redoButton->setVisible( show );
45+
}
4146

4247
void QgsUndoWidget::destroyStack()
4348
{

src/app/qgsundowidget.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ class APP_EXPORT QgsUndoWidget : public QgsPanelWidget
5555
*/
5656
void setUndoStack( QUndoStack *undoStack );
5757

58+
/**
59+
* Show or hide the undo/redo buttons on the widget.
60+
* \param show Show or hide the undo/redo buttons.
61+
*/
62+
void setButtonsVisible( bool show );
63+
5864
/**
5965
* Handles destroying of stack when active layer is changed
6066
*/

0 commit comments

Comments
 (0)