1
0
mirror of synced 2024-11-13 18:50:53 +01:00

impr: Move some options into a new Extras menu

This commit is contained in:
WerWolv 2023-05-12 08:38:32 +02:00
parent 18bc5de169
commit b0876e1c35
6 changed files with 22 additions and 14 deletions

View File

@ -137,6 +137,7 @@
"hex.builtin.menu.edit.bookmark.create": "Create bookmark",
"hex.builtin.menu.edit.redo": "Redo",
"hex.builtin.menu.edit.undo": "Undo",
"hex.builtin.menu.extras": "Extras",
"hex.builtin.menu.file": "File",
"hex.builtin.menu.file.bookmark.export": "Export bookmarks",
"hex.builtin.menu.file.bookmark.import": "Import bookmarks",

View File

@ -13,7 +13,6 @@
#include <content/global_actions.hpp>
#include <content/popups/popup_notification.hpp>
#include <content/popups/popup_docs_question.hpp>
#include <content/popups/popup_text_input.hpp>
#include <wolv/io/file.hpp>
@ -461,19 +460,21 @@ namespace hex::plugin::builtin {
});
}
static void createHelpMenu() {
ContentRegistry::Interface::registerMainMenuItem("hex.builtin.menu.help", 5000);
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.help", "hex.builtin.menu.help.ask_for_help" }, 5000, CTRLCMD + SHIFT + Keys::D, [] {
PopupDocsQuestion::open();
});
static void createExtrasMenu() {
ContentRegistry::Interface::registerMainMenuItem("hex.builtin.menu.extras", 5000);
}
static void createHelpMenu() {
ContentRegistry::Interface::registerMainMenuItem("hex.builtin.menu.help", 6000);
}
void registerMainMenuEntries() {
createFileMenu();
createEditMenu();
createViewMenu();
createLayoutMenu();
createExtrasMenu();
createHelpMenu();
(void)EventManager::subscribe<EventFrameEnd>([] {

View File

@ -6,6 +6,8 @@
#include <hex/helpers/fs.hpp>
#include <hex/helpers/utils.hpp>
#include <content/popups/popup_docs_question.hpp>
#include <romfs/romfs.hpp>
namespace hex::plugin::builtin {
@ -18,9 +20,15 @@ namespace hex::plugin::builtin {
this->getWindowOpenState() = true;
});
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.help", "hex.builtin.view.help.documentation" }, 1050, Shortcut::None, [] {
ContentRegistry::Interface::addMenuItemSeparator({ "hex.builtin.menu.help" }, 2000);
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.help", "hex.builtin.view.help.documentation" }, 3000, Shortcut::None, [] {
hex::openWebpage("https://imhex.werwolv.net/docs");
});
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.help", "hex.builtin.menu.help.ask_for_help" }, 4000, CTRLCMD + SHIFT + Keys::D, [] {
PopupDocsQuestion::open();
});
}
static void link(const std::string &name, const std::string &author, const std::string &url) {

View File

@ -19,9 +19,9 @@ namespace hex::plugin::builtin {
}
});
ContentRegistry::Interface::addMenuItemSeparator({ "hex.builtin.menu.help" }, 4000);
ContentRegistry::Interface::addMenuItemSeparator({ "hex.builtin.menu.extras" }, 3000);
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.help", "hex.builtin.view.settings.name"_lang }, 4050, Shortcut::None, [&, this] {
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.extras", "hex.builtin.view.settings.name"_lang }, 4000, Shortcut::None, [&, this] {
TaskManager::doLater([] { ImGui::OpenPopup(View::toWindowName("hex.builtin.view.settings.name").c_str()); });
this->getWindowOpenState() = true;
});

View File

@ -29,9 +29,7 @@ namespace hex::plugin::builtin {
using namespace std::literals::chrono_literals;
ViewStore::ViewStore() : View("hex.builtin.view.store.name") {
ContentRegistry::Interface::addMenuItemSeparator({ "hex.builtin.menu.help" }, 2000);
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.help", "hex.builtin.view.store.name" }, 2050, Shortcut::None, [&, this] {
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.extras", "hex.builtin.view.store.name" }, 1000, Shortcut::None, [&, this] {
if (this->m_requestStatus == RequestStatus::NotAttempted)
this->refresh();
TaskManager::doLater([] { ImGui::OpenPopup(View::toWindowName("hex.builtin.view.store.name").c_str()); });

View File

@ -7,7 +7,7 @@
namespace hex::plugin::builtin {
ViewThemeManager::ViewThemeManager() : View("hex.builtin.view.theme_manager.name") {
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.help", "hex.builtin.view.theme_manager.name" }, 3000, Shortcut::None, [&, this] {
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.extras", "hex.builtin.view.theme_manager.name" }, 2000, Shortcut::None, [&, this] {
this->m_viewOpen = true;
this->getWindowOpenState() = true;
});