Skip to content

Commit

Permalink
[Style Dock] Add undo/redo button at the bottom
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanW2 committed May 10, 2016
1 parent ca914f1 commit 0d39964
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/app/qgsmapstylingwidget.cpp
Expand Up @@ -50,7 +50,17 @@ QgsMapStylingWidget::QgsMapStylingWidget( QgsMapCanvas* canvas, QWidget *parent
mLiveApplyCheck = new QCheckBox( "Live update" );
mLiveApplyCheck->setChecked( true );

mUndoButton = new QToolButton( this );
mUndoButton->setIcon( QgsApplication::getThemeIcon( "mActionUndo.png" ) );
mRedoButton = new QToolButton( this );
mRedoButton->setIcon( QgsApplication::getThemeIcon( "mActionRedo.png" ) );

connect( mUndoButton, SIGNAL( pressed() ), mUndoWidget, SLOT( undo() ) );
connect( mRedoButton, SIGNAL( pressed() ), mUndoWidget, SLOT( redo() ) );

QHBoxLayout* bottomLayout = new QHBoxLayout( );
bottomLayout->addWidget( mUndoButton );
bottomLayout->addWidget( mRedoButton );
bottomLayout->addWidget( mButtonBox );
bottomLayout->addWidget( mLiveApplyCheck );
layout->addLayout( bottomLayout );
Expand Down
4 changes: 3 additions & 1 deletion src/app/qgsmapstylingwidget.h
@@ -1,6 +1,7 @@
#ifndef QGSMAPSTYLESDOCK_H
#define QGSMAPSTYLESDOCK_H

#include <QToolButton>
#include <QWidget>
#include <QLabel>
#include <QTabWidget>
Expand Down Expand Up @@ -67,7 +68,8 @@ class APP_EXPORT QgsMapStylingWidget : public QWidget
QgsRendererV2PropertiesDialog* mVectorStyleWidget;
QDialogButtonBox* mButtonBox;
QCheckBox* mLiveApplyCheck;

QToolButton* mUndoButton;
QToolButton* mRedoButton;
};

#endif // QGSMAPSTYLESDOCK_H

0 comments on commit 0d39964

Please sign in to comment.