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 +++++++++ src/mainwindow.ui | 48 ++++++++++++++++++++++++------------------------ 2 files changed, 33 insertions(+), 24 deletions(-) (limited to 'src') 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); } diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 2659a65..c85bd22 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -186,7 +186,7 @@ - File + &File @@ -202,7 +202,7 @@ - Help + &Help @@ -212,14 +212,14 @@ - View + &View - Navigation + &Navigation @@ -242,7 +242,7 @@ .. - About... + &About... @@ -251,7 +251,7 @@ .. - Quit + &Quit Ctrl+Q @@ -259,7 +259,7 @@ - New Tab + New &Tab Ctrl+T @@ -271,7 +271,7 @@ .. - Close Tab + &Close Tab Ctrl+W @@ -283,7 +283,7 @@ .. - Settings + &Settings Ctrl+, @@ -295,7 +295,7 @@ .. - Back + &Back Back @@ -310,7 +310,7 @@ .. - Forward + For&ward Forward @@ -325,7 +325,7 @@ .. - Root + R&oot Go to the root directory (/) @@ -340,7 +340,7 @@ .. - Parent + &Parent Go to the parent directory @@ -355,7 +355,7 @@ .. - Refresh + &Refresh F5 @@ -367,7 +367,7 @@ :/icons/common/qt.svg:/icons/common/qt.svg - About Qt... + About &Qt... @@ -376,7 +376,7 @@ .. - Save as... + &Save as... Ctrl+S @@ -391,7 +391,7 @@ :/icons/light/actions/favourite-on.svg:/icons/light/actions/favourite-on.svg - Add to favourites + Add to &favourites Ctrl+D @@ -403,7 +403,7 @@ .. - Go to home + Go to &home Alt+Home @@ -415,7 +415,7 @@ .. - Help + &Help F1 @@ -427,7 +427,7 @@ .. - Changelog + Change&log @@ -436,12 +436,12 @@ .. - Manage Certificates… + &Manage Certificates… - View document source + View document &source Ctrl+U @@ -449,7 +449,7 @@ - New Window + New &window Opens a new window @@ -460,7 +460,7 @@ - Close Window + Close Win&dow Alt+F4 -- cgit v1.2.3