Skip to content

Commit

Permalink
Add Panels and Toolbars submenus to View menu in Composer
Browse files Browse the repository at this point in the history
  • Loading branch information
dakcarto committed Aug 31, 2012
1 parent 93ad1d0 commit c928868
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/app/composer/qgscomposer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,17 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
viewMenu->addSeparator();
viewMenu->addAction( mActionRefreshView );

// Panel and toolbar submenus
mPanelMenu = new QMenu( tr( "Panels" ), this );
mPanelMenu->setObjectName( "mPanelMenu" );
mToolbarMenu = new QMenu( tr( "Toolbars" ), this );
mToolbarMenu->setObjectName( "mToolbarMenu" );
viewMenu->addSeparator();
viewMenu->addMenu( mPanelMenu );
viewMenu->addMenu( mToolbarMenu );
// toolBar already exists, add other widgets as they are created
mToolbarMenu->addAction( toolBar->toggleViewAction() );

QMenu *layoutMenu = menuBar()->addMenu( tr( "Layout" ) );
layoutMenu->addAction( mActionUndo );
layoutMenu->addAction( mActionRedo );
Expand Down Expand Up @@ -244,10 +255,13 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
setTabPosition( Qt::AllDockWidgetAreas, QTabWidget::North );
mGeneralDock = new QDockWidget( tr( "Composition" ), this );
mGeneralDock->setObjectName( "CompositionDock" );
mPanelMenu->addAction( mGeneralDock->toggleViewAction() );
mItemDock = new QDockWidget( tr( "Item Properties" ), this );
mItemDock->setObjectName( "ItemDock" );
mPanelMenu->addAction( mItemDock->toggleViewAction() );
mUndoDock = new QDockWidget( tr( "Command history" ), this );
mUndoDock->setObjectName( "CommandDock" );
mPanelMenu->addAction( mUndoDock->toggleViewAction() );

mGeneralDock->setFeatures( QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetClosable );
mItemDock->setFeatures( QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetClosable );
Expand Down
3 changes: 3 additions & 0 deletions src/app/composer/qgscomposer.h
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,9 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase
QDockWidget* mItemDock;
QDockWidget* mUndoDock;
QDockWidget* mGeneralDock;

QMenu* mPanelMenu;
QMenu* mToolbarMenu;
};

#endif

0 comments on commit c928868

Please sign in to comment.