sys: Added "New File..." menu item and shortcut

This commit is contained in:
WerWolv
2022-08-28 20:55:48 +02:00
parent a620400e4e
commit 33a375910a
8 changed files with 17 additions and 7 deletions

View File

@@ -4,11 +4,14 @@
namespace hex::plugin::builtin {
void registerShortcuts() {
// New file
ShortcutManager::addGlobalShortcut(CTRL + Keys::N, [] {
EventManager::post<RequestOpenWindow>("Create File");
});
// Open file
ShortcutManager::addGlobalShortcut(CTRL + Keys::O, [] {
fs::openFileBrowser(fs::DialogMode::Open, {}, [](const auto &path) {
EventManager::post<RequestOpenFile>(path);
});
EventManager::post<RequestOpenWindow>("Open File");
});
// Close file