Skip to content

Commit 8da587d

Browse files
committedApr 5, 2023
Show shortcuts in context menu for easy discovery
1 parent 895a68f commit 8da587d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
 

‎src/gui/codeeditors/qgscodeeditor.cpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ void QgsCodeEditor::contextMenuEvent( QContextMenuEvent *event )
258258
if ( languageCapabilities() & Qgis::ScriptLanguageCapability::Reformat )
259259
{
260260
QAction *reformatAction = new QAction( tr( "Reformat Code" ), menu );
261+
reformatAction->setShortcut( QStringLiteral( "Ctrl+Alt+F" ) );
261262
reformatAction->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "console/iconFormatCode.svg" ) ) );
262263
reformatAction->setEnabled( !isReadOnly() );
263264
connect( reformatAction, &QAction::triggered, this, &QgsCodeEditor::reformatCode );
@@ -275,6 +276,7 @@ void QgsCodeEditor::contextMenuEvent( QContextMenuEvent *event )
275276
if ( languageCapabilities() & Qgis::ScriptLanguageCapability::ToggleComment )
276277
{
277278
QAction *toggleCommentAction = new QAction( tr( "Toggle Comment" ), menu );
279+
toggleCommentAction->setShortcut( QStringLiteral( "Ctrl+:" ) );
278280
toggleCommentAction->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "console/iconCommentEditorConsole.svg" ) ) );
279281
toggleCommentAction->setEnabled( !isReadOnly() );
280282
connect( toggleCommentAction, &QAction::triggered, this, &QgsCodeEditor::toggleComment );

0 commit comments

Comments
 (0)
Please sign in to comment.