Skip to content

Commit

Permalink
GUI - reduce scope of text editor copy shortcuts
Browse files Browse the repository at this point in the history
(on Windows these appear to override the shortcuts in the menubar)
  • Loading branch information
samaaron committed Oct 21, 2024
1 parent 528bb17 commit e40329b
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions app/gui/qt/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4674,13 +4674,20 @@ void MainWindow::setUpdateInfoText(QString t)

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

new QShortcut(metaKey("c"), te, SLOT(copy()));
new QShortcut(metaKey("a"), te, SLOT(selectAll()));
QShortcut* selectAllShortcutCtrl = new QShortcut(ctrlKey("a"), te, SLOT(selectAll()));
selectAllShortcutCtrl->setContext(Qt::WidgetShortcut);

QShortcut* copyShortcutMeta = new QShortcut(metaKey("c"), te, SLOT(copy()));
copyShortcutMeta->setContext(Qt::WidgetShortcut);

QShortcut* selectAllShortcutMeta = new QShortcut(metaKey("a"), te, SLOT(selectAll()));
selectAllShortcutMeta->setContext(Qt::WidgetShortcut);
}


QString MainWindow::asciiArtLogo()
{
return readFile(":/images/logo.txt");
Expand Down

0 comments on commit e40329b

Please sign in to comment.