diff --git a/lib/libimhex/include/hex/api/shortcut_manager.hpp b/lib/libimhex/include/hex/api/shortcut_manager.hpp index de3660ce7..3d92c0579 100644 --- a/lib/libimhex/include/hex/api/shortcut_manager.hpp +++ b/lib/libimhex/include/hex/api/shortcut_manager.hpp @@ -37,13 +37,14 @@ EXPORT_MODULE namespace hex { }; - constexpr static auto CTRL = Key(static_cast(0x0100'0000)); - constexpr static auto ALT = Key(static_cast(0x0200'0000)); - constexpr static auto SHIFT = Key(static_cast(0x0400'0000)); - constexpr static auto SUPER = Key(static_cast(0x0800'0000)); - constexpr static auto CurrentView = Key(static_cast(0x1000'0000)); - constexpr static auto AllowWhileTyping = Key(static_cast(0x2000'0000)); - constexpr static auto CTRLCMD = Key(static_cast(0x4000'0000)); + constexpr static auto CTRL = Key(static_cast(0x0100'0000)); + constexpr static auto ALT = Key(static_cast(0x0200'0000)); + constexpr static auto SHIFT = Key(static_cast(0x0400'0000)); + constexpr static auto SUPER = Key(static_cast(0x0800'0000)); + constexpr static auto CurrentView = Key(static_cast(0x1000'0000)); + constexpr static auto AllowWhileTyping = Key(static_cast(0x2000'0000)); + constexpr static auto CTRLCMD = Key(static_cast(0x4000'0000)); + constexpr static auto ShowOnWelcomeScreen = Key(static_cast(0x8000'0000)); class Shortcut { public: diff --git a/plugins/builtin/source/content/main_menu_items.cpp b/plugins/builtin/source/content/main_menu_items.cpp index 2274b3630..6a4e0173f 100644 --- a/plugins/builtin/source/content/main_menu_items.cpp +++ b/plugins/builtin/source/content/main_menu_items.cpp @@ -384,7 +384,7 @@ namespace hex::plugin::builtin { }, noRunningTasks); /* Open File */ - ContentRegistry::UserInterface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.open_file" }, ICON_VS_FOLDER_OPENED, 1100, CTRLCMD + Keys::O + AllowWhileTyping, [] { + ContentRegistry::UserInterface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.open_file" }, ICON_VS_FOLDER_OPENED, 1100, CTRLCMD + Keys::O + AllowWhileTyping + ShowOnWelcomeScreen, [] { RequestOpenWindow::post("Open File"); }, noRunningTasks, ContentRegistry::Views::getViewByName("hex.builtin.view.hex_editor.name")); diff --git a/plugins/builtin/source/content/window_decoration.cpp b/plugins/builtin/source/content/window_decoration.cpp index d143c630d..e6335ec32 100644 --- a/plugins/builtin/source/content/window_decoration.cpp +++ b/plugins/builtin/source/content/window_decoration.cpp @@ -313,7 +313,7 @@ namespace hex::plugin::builtin { bool isMenuItemVisible(const ContentRegistry::UserInterface::impl::MenuItem &menuItem) { const auto lastFocusedView = View::getLastFocusedView(); if (lastFocusedView == nullptr && menuItem.view != nullptr) { - return false; + return menuItem.shortcut.has(ShowOnWelcomeScreen); } if (lastFocusedView != nullptr && menuItem.view != nullptr) {