From 7e2e8b973163e1716a08da7c798b1a7c0953fee1 Mon Sep 17 00:00:00 2001 From: Mike Skec Date: Fri, 12 Mar 2021 17:31:02 +1100 Subject: Add accelerators to menubar A bit of a hack was needed to add these to the dock menu items - the accelerators won't work in non-English languages --- src/mainwindow.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index ea34b74..18cc557 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -50,6 +50,15 @@ MainWindow::MainWindow(QApplication * app, QWidget *parent) : QAction * act = dock->toggleViewAction(); act->setShortcut(dock->property("_shortcut").toString()); // act->setIcon(dock->windowIcon()); + + // TODO: make this work in non-English languages somehow + if (act->text() == "Document Outline") + act->setText("Document &Outline"); + else if (act->text() == "Favourites") + act->setText("&Favourites"); + else if (act->text() == "History") + act->setText("&History"); + this->ui->menuView->addAction(act); } -- cgit v1.2.3