diff --git a/lib/libimhex/include/hex/providers/provider.hpp b/lib/libimhex/include/hex/providers/provider.hpp index 9a63c5a31..68b2677ba 100644 --- a/lib/libimhex/include/hex/providers/provider.hpp +++ b/lib/libimhex/include/hex/providers/provider.hpp @@ -30,6 +30,7 @@ namespace hex::prv { struct MenuEntry { std::string name; + const char *icon; std::function callback; }; diff --git a/plugins/builtin/source/content/providers/file_provider.cpp b/plugins/builtin/source/content/providers/file_provider.cpp index b5ad55455..03d30ab9c 100644 --- a/plugins/builtin/source/content/providers/file_provider.cpp +++ b/plugins/builtin/source/content/providers/file_provider.cpp @@ -180,13 +180,13 @@ namespace hex::plugin::builtin { FileProvider::MenuEntry loadMenuItem; if (m_loadedIntoMemory) - loadMenuItem = { "hex.builtin.provider.file.menu.direct_access"_lang, [this] { this->convertToDirectAccess(); } }; + loadMenuItem = { "hex.builtin.provider.file.menu.direct_access"_lang, ICON_VS_ARROW_SWAP, [this] { this->convertToDirectAccess(); } }; else - loadMenuItem = { "hex.builtin.provider.file.menu.into_memory"_lang, [this] { this->convertToMemoryFile(); } }; + loadMenuItem = { "hex.builtin.provider.file.menu.into_memory"_lang, ICON_VS_ARROW_SWAP, [this] { this->convertToMemoryFile(); } }; return { - { "hex.builtin.provider.file.menu.open_folder"_lang, [this] { fs::openFolderWithSelectionExternal(m_path); } }, - { "hex.builtin.provider.file.menu.open_file"_lang, [this] { fs::openFileExternal(m_path); } }, + { "hex.builtin.provider.file.menu.open_folder"_lang, ICON_VS_FOLDER_OPENED, [this] { fs::openFolderWithSelectionExternal(m_path); } }, + { "hex.builtin.provider.file.menu.open_file"_lang, ICON_VS_FILE, [this] { fs::openFileExternal(m_path); } }, loadMenuItem }; } diff --git a/plugins/builtin/source/content/providers/memory_file_provider.cpp b/plugins/builtin/source/content/providers/memory_file_provider.cpp index 6cb86e60a..f76a0bd99 100644 --- a/plugins/builtin/source/content/providers/memory_file_provider.cpp +++ b/plugins/builtin/source/content/providers/memory_file_provider.cpp @@ -78,7 +78,7 @@ namespace hex::plugin::builtin { std::vector MemoryFileProvider::getMenuEntries() { return { - MenuEntry { Lang("hex.builtin.provider.mem_file.rename"), [this] { this->renameFile(); } } + MenuEntry { Lang("hex.builtin.provider.mem_file.rename"), ICON_VS_TAG, [this] { this->renameFile(); } } }; } diff --git a/plugins/builtin/source/content/providers/view_provider.cpp b/plugins/builtin/source/content/providers/view_provider.cpp index ee798afe4..a545518c1 100644 --- a/plugins/builtin/source/content/providers/view_provider.cpp +++ b/plugins/builtin/source/content/providers/view_provider.cpp @@ -166,7 +166,7 @@ namespace hex::plugin::builtin { std::vector ViewProvider::getMenuEntries() { return { - MenuEntry { Lang("hex.builtin.provider.rename"), [this] { this->renameFile(); } } + MenuEntry { Lang("hex.builtin.provider.rename"), ICON_VS_TAG, [this] { this->renameFile(); } } }; } diff --git a/plugins/builtin/source/content/recent.cpp b/plugins/builtin/source/content/recent.cpp index 66eff110c..6f83649d4 100644 --- a/plugins/builtin/source/content/recent.cpp +++ b/plugins/builtin/source/content/recent.cpp @@ -320,7 +320,7 @@ namespace hex::plugin::builtin::recent { } if (ImGui::BeginPopup(popupID.c_str())) { - if (ImGui::MenuItem("hex.ui.common.remove"_lang)) { + if (ImGui::MenuItemEx("hex.ui.common.remove"_lang, ICON_VS_REMOVE)) { shouldRemove = true; } ImGui::EndPopup(); diff --git a/plugins/builtin/source/content/ui_items.cpp b/plugins/builtin/source/content/ui_items.cpp index 31122b8e2..812f04f98 100644 --- a/plugins/builtin/source/content/ui_items.cpp +++ b/plugins/builtin/source/content/ui_items.cpp @@ -317,7 +317,7 @@ namespace hex::plugin::builtin { static void drawProviderContextMenu(prv::Provider *provider) { for (const auto &menuEntry : provider->getMenuEntries()) { - if (ImGui::MenuItem(menuEntry.name.c_str())) { + if (ImGui::MenuItemEx(menuEntry.name.c_str(), menuEntry.icon)) { menuEntry.callback(); } } diff --git a/plugins/builtin/source/content/views/view_find.cpp b/plugins/builtin/source/content/views/view_find.cpp index e4a9a19c1..c7fd6d350 100644 --- a/plugins/builtin/source/content/views/view_find.cpp +++ b/plugins/builtin/source/content/views/view_find.cpp @@ -601,11 +601,11 @@ namespace hex::plugin::builtin { } if (ImGui::BeginPopup("FindContextMenu")) { - if (ImGui::MenuItem("hex.builtin.view.find.context.copy"_lang)) + if (ImGui::MenuItemEx("hex.builtin.view.find.context.copy"_lang, ICON_VS_COPY)) ImGui::SetClipboardText(value.c_str()); - if (ImGui::MenuItem("hex.builtin.view.find.context.copy_demangle"_lang)) + if (ImGui::MenuItemEx("hex.builtin.view.find.context.copy_demangle"_lang, ICON_VS_FILES)) ImGui::SetClipboardText(hex::plugin::builtin::demangle(value).c_str()); - if (ImGui::BeginMenu("hex.builtin.view.find.context.replace"_lang)) { + if (ImGui::BeginMenuEx("hex.builtin.view.find.context.replace"_lang, ICON_VS_REPLACE)) { if (ImGui::BeginTabBar("##replace_tabs")) { if (ImGui::BeginTabItem("hex.builtin.view.find.context.replace.hex"_lang)) { ImGuiExt::InputTextIcon("##replace_input", ICON_VS_SYMBOL_NAMESPACE, m_replaceBuffer);