Make menus and placeholders display appropriate custom key combos. (#4045)

* Add initial support for finding hotkey display key sequences

* Make neededArguments work

* Implement displaying key combos in SplitHeader main menu

* Make Settings search text dynamic

* Make tab hide notice use a custom hotkeys key sequence

* Make Notebook menus use custom hotkeys key combo lookup for hiding tabs

* shut up changelog ci

* Make NotebookTab menus show custom hotkeys. SCUFFED:
this does not update dynamically!

* Scuffed: Make the show prefs button setting show the key bind

* Scuffed: Make the R9K description refer to hotkeys

* @pajlada, is something like this ok?

Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
Mm2PL
2022-10-09 17:20:44 +02:00
committed by GitHub
parent 4e2da540d2
commit e604a36777
10 changed files with 248 additions and 41 deletions
+8 -2
View File
@@ -2,6 +2,8 @@
#include "Application.hpp"
#include "common/Common.hpp"
#include "controllers/hotkeys/HotkeyCategory.hpp"
#include "controllers/hotkeys/HotkeyController.hpp"
#include "singletons/Fonts.hpp"
#include "singletons/Settings.hpp"
#include "singletons/Theme.hpp"
@@ -60,12 +62,15 @@ NotebookTab::NotebookTab(Notebook *notebook)
this->showRenameDialog();
});
// XXX: this doesn't update after changing hotkeys
this->menu_.addAction(
"Close Tab",
[=]() {
this->notebook_->removePage(this->page);
},
QKeySequence("Ctrl+Shift+W"));
getApp()->hotkeys->getDisplaySequence(HotkeyCategory::Window,
"removeTab"));
this->menu_.addAction(
"Popup Tab",
@@ -75,7 +80,8 @@ NotebookTab::NotebookTab(Notebook *notebook)
container->popup();
}
},
QKeySequence("Ctrl+Shift+N"));
getApp()->hotkeys->getDisplaySequence(HotkeyCategory::Window, "popup",
{{"window"}}));
highlightNewMessagesAction_ =
new QAction("Mark Tab as Unread on New Messages", &this->menu_);