Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add Panels and Toolbars submenus to View menu in Composer

  • Loading branch information...
commit c928868916192da22ef168ade3cfa525b872f5ce 1 parent 93ad1d0
Larry Shaffer dakcarto authored
Showing with 17 additions and 0 deletions.
  1. +14 −0 src/app/composer/qgscomposer.cpp
  2. +3 −0  src/app/composer/qgscomposer.h
14 src/app/composer/qgscomposer.cpp
View
@@ -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 );
@@ -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 );
3  src/app/composer/qgscomposer.h
View
@@ -338,6 +338,9 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase
QDockWidget* mItemDock;
QDockWidget* mUndoDock;
QDockWidget* mGeneralDock;
+
+ QMenu* mPanelMenu;
+ QMenu* mToolbarMenu;
};
#endif
Please sign in to comment.
Something went wrong with that request. Please try again.