From e23582abf213469904973b13c6a2180e3eaf6080 Mon Sep 17 00:00:00 2001 From: Emmanuel Engelhart Date: Tue, 19 Oct 2021 04:08:37 +0200 Subject: [PATCH] Add CTRL+= as zoomin shortcut --- src/kiwixapp.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/kiwixapp.cpp b/src/kiwixapp.cpp index 47b7f68..59df14d 100644 --- a/src/kiwixapp.cpp +++ b/src/kiwixapp.cpp @@ -291,6 +291,12 @@ bool KiwixApp::isCurrentArticleBookmarked() #define CREATE_ACTION_ICON_SHORTCUT(ID, ICON, TEXT, SHORTCUT) \ mpa_actions[ID] = new QAction(QIcon(":/icons/" ICON ".svg"), TEXT); \ SET_SHORTCUT(ID, TEXT, SHORTCUT) +#define SET_SHORTCUTS(ID, TEXT, SHORTCUTS) \ + mpa_actions[ID]->setShortcuts(SHORTCUTS); \ + mpa_actions[ID]->setToolTip(TEXT + " (" + SHORTCUTS.first().toString() + ")" ) +#define CREATE_ACTION_SHORTCUTS(ID, TEXT, SHORTCUTS) \ + CREATE_ACTION(ID, TEXT); \ + SET_SHORTCUTS(ID, TEXT, SHORTCUTS) #define HIDE_ACTION(ID) mpa_actions[ID]->setVisible(false) #define DISABLE_ACTION(ID) mpa_actions[ID]->setDisabled(true) @@ -371,7 +377,7 @@ void KiwixApp::createAction() QIcon((type == READINGLIST_BAR) ? ":/icons/reading-list-active.svg" : ":/icons/reading-list.svg")); }); - CREATE_ACTION_SHORTCUT(ZoomInAction, gt("zoom-in"), QKeySequence::ZoomIn); + CREATE_ACTION_SHORTCUTS(ZoomInAction, gt("zoom-in"), QList({QKeySequence::ZoomIn, QKeySequence(Qt::CTRL+Qt::Key_Equal)})); CREATE_ACTION_SHORTCUT(ZoomOutAction, gt("zoom-out"), QKeySequence::ZoomOut);