Skip to content
Permalink
Browse files

[ui] Harmonize 2D/3D map view toolbars

  • Loading branch information
nirvn committed Feb 12, 2019
1 parent f486640 commit 2e116b6f2815f68cc95fd2ae31b5689da016efd4
Showing with 20 additions and 8 deletions.
  1. +17 −7 src/app/3d/qgs3dmapcanvasdockwidget.cpp
  2. +3 −1 src/app/qgsmapcanvasdockwidget.cpp
@@ -47,20 +47,30 @@ Qgs3DMapCanvasDockWidget::Qgs3DMapCanvasDockWidget( QWidget *parent )

QToolBar *toolBar = new QToolBar( contentsWidget );
toolBar->setIconSize( QgisApp::instance()->iconSize( true ) );


toolBar->addAction( QgsApplication::getThemeIcon( QStringLiteral( "mActionZoomFullExtent.svg" ) ),
tr( "Zoom Full" ), this, &Qgs3DMapCanvasDockWidget::resetView );
toolBar->addAction( QgsApplication::getThemeIcon( QStringLiteral( "mActionSaveMapAsImage.svg" ) ),
tr( "Save as Image…" ), this, &Qgs3DMapCanvasDockWidget::saveAsImage );
toolBar->addAction( QgsApplication::getThemeIcon( QStringLiteral( "mIconProperties.svg" ) ),
tr( "Configure…" ), this, &Qgs3DMapCanvasDockWidget::configure );
QAction *actionAnim = toolBar->addAction( QIcon( QgsApplication::iconPath( "mTaskRunning.svg" ) ),
tr( "Animations" ), this, &Qgs3DMapCanvasDockWidget::toggleAnimations );
actionAnim->setCheckable( true );

toolBar->addSeparator();

QAction *actionIdentify = toolBar->addAction( QIcon( QgsApplication::iconPath( "mActionIdentify.svg" ) ),
tr( "Identify" ), this, &Qgs3DMapCanvasDockWidget::identify );
actionIdentify->setCheckable( true );

QAction *actionAnim = toolBar->addAction( QIcon( QgsApplication::iconPath( "mTaskRunning.svg" ) ),
tr( "Animations" ), this, &Qgs3DMapCanvasDockWidget::toggleAnimations );
actionAnim->setCheckable( true );

toolBar->addAction( QgsApplication::getThemeIcon( QStringLiteral( "mActionSaveMapAsImage.svg" ) ),
tr( "Save as Image…" ), this, &Qgs3DMapCanvasDockWidget::saveAsImage );

toolBar->addSeparator();

toolBar->addAction( QgsApplication::getThemeIcon( QStringLiteral( "mActionOptions.svg" ) ),
tr( "Configure…" ), this, &Qgs3DMapCanvasDockWidget::configure );


mCanvas = new Qgs3DMapCanvas( contentsWidget );
mCanvas->setMinimumSize( QSize( 200, 200 ) );
mCanvas->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
@@ -73,6 +73,8 @@ QgsMapCanvasDockWidget::QgsMapCanvasDockWidget( const QString &name, QWidget *pa
mMenu = new QMenu();
connect( mMenu, &QMenu::aboutToShow, this, &QgsMapCanvasDockWidget::menuAboutToShow );

mToolbar->addSeparator();

QToolButton *btnMapThemes = new QToolButton;
btnMapThemes->setAutoRaise( true );
btnMapThemes->setToolTip( tr( "Set View Theme" ) );
@@ -87,7 +89,7 @@ QgsMapCanvasDockWidget::QgsMapCanvasDockWidget( const QString &name, QWidget *pa
settingsButton->setToolTip( tr( "View Settings" ) );
settingsButton->setMenu( settingsMenu );
settingsButton->setPopupMode( QToolButton::InstantPopup );
settingsButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionMapSettings.svg" ) ) );
settingsButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionOptions.svg" ) ) );
mToolbar->addWidget( settingsButton );

connect( mActionSetCrs, &QAction::triggered, this, &QgsMapCanvasDockWidget::setMapCrs );

0 comments on commit 2e116b6

Please sign in to comment.
You can’t perform that action at this time.