Skip to content
Permalink
Browse files

Add icons to some shortcut configurations

  • Loading branch information
m-kuhn committed Feb 28, 2017
1 parent 5176ecf commit 8270e10e39cdc785e63dd29bd3012c04ee613b0b
Showing with 8 additions and 0 deletions.
  1. +7 −0 src/app/qgisapp.cpp
  2. +1 −0 src/gui/qgsconfigureshortcutsdialog.cpp
@@ -1080,24 +1080,31 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
connect( zoomInShortCut, &QShortcut::activated, mMapCanvas, &QgsMapCanvas::zoomIn );
zoomInShortCut->setObjectName( QStringLiteral( "ZoomInToCanvas" ) );
zoomInShortCut->setWhatsThis( tr( "Zoom in to canvas" ) );
zoomInShortCut->setProperty( "Icon", QgsApplication::getThemeIcon( QStringLiteral( "/mActionZoomIn.svg" ) ) );

QShortcut* zoomShortCut2 = new QShortcut( QKeySequence( tr( "Ctrl+=" ) ), this );
connect( zoomShortCut2, &QShortcut::activated, mMapCanvas, &QgsMapCanvas::zoomIn );
zoomShortCut2->setObjectName( QStringLiteral( "ZoomInToCanvas2" ) );
zoomShortCut2->setWhatsThis( tr( "Zoom in to canvas (secondary)" ) );
zoomShortCut2->setProperty( "Icon", QgsApplication::getThemeIcon( QStringLiteral( "/mActionZoomIn.svg" ) ) );

QShortcut* zoomOutShortCut = new QShortcut( QKeySequence( tr( "Ctrl+-" ) ), this );
connect( zoomOutShortCut, &QShortcut::activated, mMapCanvas, &QgsMapCanvas::zoomOut );
zoomOutShortCut->setObjectName( QStringLiteral( "ZoomOutOfCanvas" ) );
zoomOutShortCut->setWhatsThis( tr( "Zoom out of canvas" ) );
zoomOutShortCut->setProperty( "Icon", QgsApplication::getThemeIcon( QStringLiteral( "/mActionZoomOut.svg" ) ) );

//also make ctrl+alt+= a shortcut to switch to zoom in map tool
QShortcut* zoomInToolShortCut = new QShortcut( QKeySequence( tr( "Ctrl+Alt+=" ) ), this );
connect( zoomInToolShortCut, SIGNAL( activated() ), this, SLOT( zoomIn() ) );
zoomInToolShortCut->setObjectName( QStringLiteral( "ZoomIn2" ) );
zoomInToolShortCut->setWhatsThis( tr( "Zoom in (secondary)" ) );
zoomInToolShortCut->setProperty( "Icon", QgsApplication::getThemeIcon( QStringLiteral( "/mActionZoomIn.svg" ) ) );

QShortcut* toggleSnapping = new QShortcut( QKeySequence( tr( "S" ) ), this );
toggleSnapping->setObjectName( "toggleSnapping" );
toggleSnapping->setWhatsThis( tr( "Toggle snapping" ) );
toggleSnapping->setProperty( "Icon", QgsApplication::getThemeIcon( "/mIconSnapping.svg" ) );
connect( toggleSnapping, &QShortcut::activated, mSnappingUtils, &QgsSnappingUtils::toggleEnabled );

// Show a nice tip of the day
@@ -102,6 +102,7 @@ void QgsConfigureShortcutsDialog::populateActions()
{
actionText = shortcut->whatsThis();
sequence = shortcut->key().toString();
icon = shortcut->property( "Icon" ).value<QIcon>();
}
else
{

0 comments on commit 8270e10

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