Skip to content

Commit e40329b

Browse files
committed
GUI - reduce scope of text editor copy shortcuts
(on Windows these appear to override the shortcuts in the menubar)
1 parent 528bb17 commit e40329b

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

app/gui/qt/mainwindow.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4674,13 +4674,20 @@ void MainWindow::setUpdateInfoText(QString t)
46744674

46754675
void MainWindow::addUniversalCopyShortcuts(QTextEdit* te)
46764676
{
4677-
new QShortcut(ctrlKey("c"), te, SLOT(copy()));
4678-
new QShortcut(ctrlKey("a"), te, SLOT(selectAll()));
4677+
QShortcut* copyShortcutCtrl = new QShortcut(ctrlKey("c"), te, SLOT(copy()));
4678+
copyShortcutCtrl->setContext(Qt::WidgetShortcut);
46794679

4680-
new QShortcut(metaKey("c"), te, SLOT(copy()));
4681-
new QShortcut(metaKey("a"), te, SLOT(selectAll()));
4680+
QShortcut* selectAllShortcutCtrl = new QShortcut(ctrlKey("a"), te, SLOT(selectAll()));
4681+
selectAllShortcutCtrl->setContext(Qt::WidgetShortcut);
4682+
4683+
QShortcut* copyShortcutMeta = new QShortcut(metaKey("c"), te, SLOT(copy()));
4684+
copyShortcutMeta->setContext(Qt::WidgetShortcut);
4685+
4686+
QShortcut* selectAllShortcutMeta = new QShortcut(metaKey("a"), te, SLOT(selectAll()));
4687+
selectAllShortcutMeta->setContext(Qt::WidgetShortcut);
46824688
}
46834689

4690+
46844691
QString MainWindow::asciiArtLogo()
46854692
{
46864693
return readFile(":/images/logo.txt");

0 commit comments

Comments
 (0)