feat: Add shortcut editor to settings

This commit is contained in:
WerWolv
2023-11-17 14:46:21 +01:00
parent 3bd779a607
commit cec925bcdc
12 changed files with 289 additions and 55 deletions

View File

@@ -714,10 +714,12 @@ namespace hex {
priority, { unlocalizedMainMenuNames, shortcut, function, enabledCallback }
});
if (shortcut.isLocal() && view != nullptr)
ShortcutManager::addShortcut(view, shortcut, function);
else
ShortcutManager::addGlobalShortcut(shortcut, function);
if (shortcut != Shortcut::None) {
if (shortcut.isLocal() && view != nullptr)
ShortcutManager::addShortcut(view, shortcut, unlocalizedMainMenuNames.back(), function);
else
ShortcutManager::addGlobalShortcut(shortcut, unlocalizedMainMenuNames.back(), function);
}
}
void addMenuItemSubMenu(std::vector<std::string> unlocalizedMainMenuNames, u32 priority, const impl::MenuCallback &function, const impl::EnabledCallback& enabledCallback) {