1
0
mirror of synced 2024-12-01 02:37:18 +01:00

impr: Added icons to all menu items

This commit is contained in:
WerWolv 2024-01-08 21:51:48 +01:00
parent 3a068b9719
commit bfafc692db
32 changed files with 236 additions and 103 deletions

View File

@ -639,6 +639,7 @@ namespace hex {
struct MenuItem {
std::vector<UnlocalizedString> unlocalizedNames;
const char *icon;
std::unique_ptr<Shortcut> shortcut;
View *view;
MenuCallback callback;
@ -678,6 +679,19 @@ namespace hex {
*/
void registerMainMenuItem(const UnlocalizedString &unlocalizedName, u32 priority);
/**
* @brief Adds a new main menu entry
* @param unlocalizedMainMenuNames The unlocalized names of the main menu entries
* @param icon The icon to use for the entry
* @param priority The priority of the entry. Lower values are displayed first
* @param shortcut The shortcut to use for the entry
* @param function The function to call when the entry is clicked
* @param enabledCallback The function to call to determine if the entry is enabled
* @param view The view to use for the entry. If nullptr, the shortcut will work globally
*/
void addMenuItem(const std::vector<UnlocalizedString> &unlocalizedMainMenuNames, const char *icon, u32 priority, const Shortcut &shortcut, const impl::MenuCallback &function, const impl::EnabledCallback& enabledCallback = []{ return true; }, View *view = nullptr);
/**
* @brief Adds a new main menu entry
* @param unlocalizedMainMenuNames The unlocalized names of the main menu entries
@ -698,6 +712,17 @@ namespace hex {
*/
void addMenuItemSubMenu(std::vector<UnlocalizedString> unlocalizedMainMenuNames, u32 priority, const impl::MenuCallback &function, const impl::EnabledCallback& enabledCallback = []{ return true; });
/**
* @brief Adds a new main menu sub-menu entry
* @param unlocalizedMainMenuNames The unlocalized names of the main menu entries
* @param icon The icon to use for the entry
* @param priority The priority of the entry. Lower values are displayed first
* @param function The function to call when the entry is clicked
* @param enabledCallback The function to call to determine if the entry is enabled
*/
void addMenuItemSubMenu(std::vector<UnlocalizedString> unlocalizedMainMenuNames, const char *icon, u32 priority, const impl::MenuCallback &function, const impl::EnabledCallback& enabledCallback = []{ return true; });
/**
* @brief Adds a new main menu separator
* @param unlocalizedMainMenuNames The unlocalized names of the main menu entries

View File

@ -24,7 +24,7 @@
namespace hex {
class View {
explicit View(UnlocalizedString unlocalizedName);
explicit View(UnlocalizedString unlocalizedName, const char *icon);
public:
virtual ~View() = default;
@ -82,7 +82,7 @@ namespace hex {
*/
[[nodiscard]] virtual ImGuiWindowFlags getWindowFlags() const;
[[nodiscard]] const char *getIcon() const { return m_icon; }
[[nodiscard]] bool &getWindowOpenState();
[[nodiscard]] const bool &getWindowOpenState() const;
@ -110,6 +110,7 @@ namespace hex {
bool m_windowOpen = false, m_prevWindowOpen = false;
std::map<Shortcut, ShortcutManager::ShortcutEntry> m_shortcuts;
bool m_windowJustOpened = false;
const char *m_icon;
friend class ShortcutManager;
};
@ -120,7 +121,7 @@ namespace hex {
*/
class View::Window : public View {
public:
explicit Window(UnlocalizedString unlocalizedName) : View(std::move(unlocalizedName)) {}
explicit Window(UnlocalizedString unlocalizedName, const char *icon) : View(std::move(unlocalizedName), icon) {}
void draw() final {
if (this->shouldDraw()) {
@ -139,7 +140,7 @@ namespace hex {
*/
class View::Special : public View {
public:
explicit Special(UnlocalizedString unlocalizedName) : View(std::move(unlocalizedName)) {}
explicit Special(UnlocalizedString unlocalizedName) : View(std::move(unlocalizedName), "") {}
void draw() final {
if (this->shouldDraw()) {
@ -154,7 +155,7 @@ namespace hex {
*/
class View::Floating : public View::Window {
public:
explicit Floating(UnlocalizedString unlocalizedName) : Window(std::move(unlocalizedName)) {}
explicit Floating(UnlocalizedString unlocalizedName) : Window(std::move(unlocalizedName), "") {}
[[nodiscard]] ImGuiWindowFlags getWindowFlags() const override { return ImGuiWindowFlags_NoDocking; }
};
@ -164,7 +165,7 @@ namespace hex {
*/
class View::Modal : public View {
public:
explicit Modal(UnlocalizedString unlocalizedName) : View(std::move(unlocalizedName)) {}
explicit Modal(UnlocalizedString unlocalizedName) : View(std::move(unlocalizedName), "") {}
void draw() final {
if (this->shouldDraw()) {

View File

@ -723,10 +723,14 @@ namespace hex {
}
void addMenuItem(const std::vector<UnlocalizedString> &unlocalizedMainMenuNames, u32 priority, const Shortcut &shortcut, const impl::MenuCallback &function, const impl::EnabledCallback& enabledCallback, View *view) {
addMenuItem(unlocalizedMainMenuNames, nullptr, priority, shortcut, function, enabledCallback, view);
}
void addMenuItem(const std::vector<UnlocalizedString> &unlocalizedMainMenuNames, const char *icon, u32 priority, const Shortcut &shortcut, const impl::MenuCallback &function, const impl::EnabledCallback& enabledCallback, View *view) {
log::debug("Added new menu item to menu {} with priority {}", unlocalizedMainMenuNames[0].get(), priority);
impl::getMenuItems().insert({
priority, impl::MenuItem { unlocalizedMainMenuNames, std::make_unique<Shortcut>(shortcut), view, function, enabledCallback }
priority, impl::MenuItem { unlocalizedMainMenuNames, icon, std::make_unique<Shortcut>(shortcut), view, function, enabledCallback }
});
if (shortcut != Shortcut::None) {
@ -738,18 +742,22 @@ namespace hex {
}
void addMenuItemSubMenu(std::vector<UnlocalizedString> unlocalizedMainMenuNames, u32 priority, const impl::MenuCallback &function, const impl::EnabledCallback& enabledCallback) {
addMenuItemSubMenu(std::move(unlocalizedMainMenuNames), nullptr, priority, function, enabledCallback);
}
void addMenuItemSubMenu(std::vector<UnlocalizedString> unlocalizedMainMenuNames, const char *icon, u32 priority, const impl::MenuCallback &function, const impl::EnabledCallback& enabledCallback) {
log::debug("Added new menu item sub menu to menu {} with priority {}", unlocalizedMainMenuNames[0].get(), priority);
unlocalizedMainMenuNames.emplace_back(impl::SubMenuValue);
impl::getMenuItems().insert({
priority, impl::MenuItem { unlocalizedMainMenuNames, std::make_unique<Shortcut>(), nullptr, function, enabledCallback }
priority, impl::MenuItem { unlocalizedMainMenuNames, icon, std::make_unique<Shortcut>(), nullptr, function, enabledCallback }
});
}
void addMenuItemSeparator(std::vector<UnlocalizedString> unlocalizedMainMenuNames, u32 priority) {
unlocalizedMainMenuNames.emplace_back(impl::SeparatorValue);
impl::getMenuItems().insert({
priority, impl::MenuItem { unlocalizedMainMenuNames, std::make_unique<Shortcut>(), nullptr, []{}, []{ return true; } }
priority, impl::MenuItem { unlocalizedMainMenuNames, "", std::make_unique<Shortcut>(), nullptr, []{}, []{ return true; } }
});
}

View File

@ -6,7 +6,7 @@
namespace hex {
View::View(UnlocalizedString unlocalizedName) : m_unlocalizedViewName(std::move(unlocalizedName)) { }
View::View(UnlocalizedString unlocalizedName, const char *icon) : m_unlocalizedViewName(std::move(unlocalizedName)), m_icon(icon) { }
bool View::shouldDraw() const {
return ImHexApi::Provider::isValid() && ImHexApi::Provider::get()->isAvailable();

View File

@ -1,15 +1,13 @@
// Generated by https://github.com/juliettef/IconFontCppHeaders script GenerateIconFontCppHeaders.py for languages C and C++
// from https://raw.githubusercontent.com/microsoft/vscode-codicons/main/dist/codicon.css
// for use with https://github.com/microsoft/vscode-codicons/raw/main/dist/codicon.ttf
// for use with https://github.com/microsoft/vscode-codicons/blob/main/dist/codicon.ttf
#pragma once
#define FONT_ICON_FILE_NAME_VS "codicon.ttf"
extern const unsigned int codicons_compressed_size;
extern const unsigned int codicons_compressed_data[52184/4];
#define ICON_MIN_VS 0xea60
#define ICON_MAX_VS 0xec19
#define ICON_MAX_16_VS 0xec25
#define ICON_MAX_VS 0xec25
#define ICON_VS_ADD "\xee\xa9\xa0" // U+ea60
#define ICON_VS_PLUS "\xee\xa9\xa0" // U+ea60
#define ICON_VS_GIST_NEW "\xee\xa9\xa0" // U+ea60
@ -25,6 +23,7 @@ extern const unsigned int codicons_compressed_data[52184/4];
#define ICON_VS_RECORD_KEYS "\xee\xa9\xa5" // U+ea65
#define ICON_VS_KEYBOARD "\xee\xa9\xa5" // U+ea65
#define ICON_VS_TAG "\xee\xa9\xa6" // U+ea66
#define ICON_VS_GIT_PULL_REQUEST_LABEL "\xee\xa9\xa6" // U+ea66
#define ICON_VS_TAG_ADD "\xee\xa9\xa6" // U+ea66
#define ICON_VS_TAG_REMOVE "\xee\xa9\xa6" // U+ea66
#define ICON_VS_PERSON "\xee\xa9\xa7" // U+ea67
@ -60,6 +59,7 @@ extern const unsigned int codicons_compressed_data[52184/4];
#define ICON_VS_DEBUG_BREAKPOINT "\xee\xa9\xb1" // U+ea71
#define ICON_VS_DEBUG_BREAKPOINT_DISABLED "\xee\xa9\xb1" // U+ea71
#define ICON_VS_DEBUG_HINT "\xee\xa9\xb1" // U+ea71
#define ICON_VS_TERMINAL_DECORATION_SUCCESS "\xee\xa9\xb1" // U+ea71
#define ICON_VS_PRIMITIVE_SQUARE "\xee\xa9\xb2" // U+ea72
#define ICON_VS_EDIT "\xee\xa9\xb3" // U+ea73
#define ICON_VS_PENCIL "\xee\xa9\xb3" // U+ea73
@ -179,7 +179,9 @@ extern const unsigned int codicons_compressed_data[52184/4];
#define ICON_VS_CHROME_MINIMIZE "\xee\xaa\xba" // U+eaba
#define ICON_VS_CHROME_RESTORE "\xee\xaa\xbb" // U+eabb
#define ICON_VS_CIRCLE_OUTLINE "\xee\xaa\xbc" // U+eabc
#define ICON_VS_CIRCLE "\xee\xaa\xbc" // U+eabc
#define ICON_VS_DEBUG_BREAKPOINT_UNVERIFIED "\xee\xaa\xbc" // U+eabc
#define ICON_VS_TERMINAL_DECORATION_INCOMPLETE "\xee\xaa\xbc" // U+eabc
#define ICON_VS_CIRCLE_SLASH "\xee\xaa\xbd" // U+eabd
#define ICON_VS_CIRCUIT_BOARD "\xee\xaa\xbe" // U+eabe
#define ICON_VS_CLEAR_ALL "\xee\xaa\xbf" // U+eabf
@ -214,6 +216,7 @@ extern const unsigned int codicons_compressed_data[52184/4];
#define ICON_VS_DIFF_REMOVED "\xee\xab\x9f" // U+eadf
#define ICON_VS_DIFF_RENAMED "\xee\xab\xa0" // U+eae0
#define ICON_VS_DIFF "\xee\xab\xa1" // U+eae1
#define ICON_VS_DIFF_SIDEBYSIDE "\xee\xab\xa1" // U+eae1
#define ICON_VS_DISCARD "\xee\xab\xa2" // U+eae2
#define ICON_VS_EDITOR_LAYOUT "\xee\xab\xa3" // U+eae3
#define ICON_VS_EMPTY_WINDOW "\xee\xab\xa4" // U+eae4
@ -277,6 +280,7 @@ extern const unsigned int codicons_compressed_data[52184/4];
#define ICON_VS_MEGAPHONE "\xee\xac\x9e" // U+eb1e
#define ICON_VS_MENTION "\xee\xac\x9f" // U+eb1f
#define ICON_VS_MILESTONE "\xee\xac\xa0" // U+eb20
#define ICON_VS_GIT_PULL_REQUEST_MILESTONE "\xee\xac\xa0" // U+eb20
#define ICON_VS_MORTAR_BOARD "\xee\xac\xa1" // U+eb21
#define ICON_VS_MOVE "\xee\xac\xa2" // U+eb22
#define ICON_VS_MULTIPLE_WINDOWS "\xee\xac\xa3" // U+eb23
@ -386,7 +390,9 @@ extern const unsigned int codicons_compressed_data[52184/4];
#define ICON_VS_DEBUG_BREAKPOINT_FUNCTION "\xee\xae\x88" // U+eb88
#define ICON_VS_DEBUG_BREAKPOINT_FUNCTION_DISABLED "\xee\xae\x88" // U+eb88
#define ICON_VS_DEBUG_STACKFRAME_ACTIVE "\xee\xae\x89" // U+eb89
#define ICON_VS_CIRCLE_SMALL_FILLED "\xee\xae\x8a" // U+eb8a
#define ICON_VS_DEBUG_STACKFRAME_DOT "\xee\xae\x8a" // U+eb8a
#define ICON_VS_TERMINAL_DECORATION_MARK "\xee\xae\x8a" // U+eb8a
#define ICON_VS_DEBUG_STACKFRAME "\xee\xae\x8b" // U+eb8b
#define ICON_VS_DEBUG_STACKFRAME_FOCUSED "\xee\xae\x8b" // U+eb8b
#define ICON_VS_DEBUG_BREAKPOINT_UNSUPPORTED "\xee\xae\x8c" // U+eb8c
@ -400,9 +406,11 @@ extern const unsigned int codicons_compressed_data[52184/4];
#define ICON_VS_MENU "\xee\xae\x94" // U+eb94
#define ICON_VS_EXPAND_ALL "\xee\xae\x95" // U+eb95
#define ICON_VS_FEEDBACK "\xee\xae\x96" // U+eb96
#define ICON_VS_GIT_PULL_REQUEST_REVIEWER "\xee\xae\x96" // U+eb96
#define ICON_VS_GROUP_BY_REF_TYPE "\xee\xae\x97" // U+eb97
#define ICON_VS_UNGROUP_BY_REF_TYPE "\xee\xae\x98" // U+eb98
#define ICON_VS_ACCOUNT "\xee\xae\x99" // U+eb99
#define ICON_VS_GIT_PULL_REQUEST_ASSIGNEE "\xee\xae\x99" // U+eb99
#define ICON_VS_BELL_DOT "\xee\xae\x9a" // U+eb9a
#define ICON_VS_DEBUG_CONSOLE "\xee\xae\x9b" // U+eb9b
#define ICON_VS_LIBRARY "\xee\xae\x9c" // U+eb9c
@ -431,6 +439,7 @@ extern const unsigned int codicons_compressed_data[52184/4];
#define ICON_VS_PINNED_DIRTY "\xee\xae\xb2" // U+ebb2
#define ICON_VS_PASS_FILLED "\xee\xae\xb3" // U+ebb3
#define ICON_VS_CIRCLE_LARGE_FILLED "\xee\xae\xb4" // U+ebb4
#define ICON_VS_CIRCLE_LARGE "\xee\xae\xb5" // U+ebb5
#define ICON_VS_CIRCLE_LARGE_OUTLINE "\xee\xae\xb5" // U+ebb5
#define ICON_VS_COMBINE "\xee\xae\xb6" // U+ebb6
#define ICON_VS_GATHER "\xee\xae\xb6" // U+ebb6
@ -473,4 +482,77 @@ extern const unsigned int codicons_compressed_data[52184/4];
#define ICON_VS_GIT_PULL_REQUEST_DRAFT "\xee\xaf\x9b" // U+ebdb
#define ICON_VS_DEBUG_ALL "\xee\xaf\x9c" // U+ebdc
#define ICON_VS_DEBUG_COVERAGE "\xee\xaf\x9d" // U+ebdd
#define ICON_VS_CHIP "\xee\xb0\x99" // U+ec19
#define ICON_VS_RUN_ERRORS "\xee\xaf\x9e" // U+ebde
#define ICON_VS_FOLDER_LIBRARY "\xee\xaf\x9f" // U+ebdf
#define ICON_VS_DEBUG_CONTINUE_SMALL "\xee\xaf\xa0" // U+ebe0
#define ICON_VS_BEAKER_STOP "\xee\xaf\xa1" // U+ebe1
#define ICON_VS_GRAPH_LINE "\xee\xaf\xa2" // U+ebe2
#define ICON_VS_GRAPH_SCATTER "\xee\xaf\xa3" // U+ebe3
#define ICON_VS_PIE_CHART "\xee\xaf\xa4" // U+ebe4
#define ICON_VS_BRACKET "\xee\xac\x8f" // U+eb0f
#define ICON_VS_BRACKET_DOT "\xee\xaf\xa5" // U+ebe5
#define ICON_VS_BRACKET_ERROR "\xee\xaf\xa6" // U+ebe6
#define ICON_VS_LOCK_SMALL "\xee\xaf\xa7" // U+ebe7
#define ICON_VS_AZURE_DEVOPS "\xee\xaf\xa8" // U+ebe8
#define ICON_VS_VERIFIED_FILLED "\xee\xaf\xa9" // U+ebe9
#define ICON_VS_NEWLINE "\xee\xaf\xaa" // U+ebea
#define ICON_VS_LAYOUT "\xee\xaf\xab" // U+ebeb
#define ICON_VS_LAYOUT_ACTIVITYBAR_LEFT "\xee\xaf\xac" // U+ebec
#define ICON_VS_LAYOUT_ACTIVITYBAR_RIGHT "\xee\xaf\xad" // U+ebed
#define ICON_VS_LAYOUT_PANEL_LEFT "\xee\xaf\xae" // U+ebee
#define ICON_VS_LAYOUT_PANEL_CENTER "\xee\xaf\xaf" // U+ebef
#define ICON_VS_LAYOUT_PANEL_JUSTIFY "\xee\xaf\xb0" // U+ebf0
#define ICON_VS_LAYOUT_PANEL_RIGHT "\xee\xaf\xb1" // U+ebf1
#define ICON_VS_LAYOUT_PANEL "\xee\xaf\xb2" // U+ebf2
#define ICON_VS_LAYOUT_SIDEBAR_LEFT "\xee\xaf\xb3" // U+ebf3
#define ICON_VS_LAYOUT_SIDEBAR_RIGHT "\xee\xaf\xb4" // U+ebf4
#define ICON_VS_LAYOUT_STATUSBAR "\xee\xaf\xb5" // U+ebf5
#define ICON_VS_LAYOUT_MENUBAR "\xee\xaf\xb6" // U+ebf6
#define ICON_VS_LAYOUT_CENTERED "\xee\xaf\xb7" // U+ebf7
#define ICON_VS_TARGET "\xee\xaf\xb8" // U+ebf8
#define ICON_VS_INDENT "\xee\xaf\xb9" // U+ebf9
#define ICON_VS_RECORD_SMALL "\xee\xaf\xba" // U+ebfa
#define ICON_VS_ERROR_SMALL "\xee\xaf\xbb" // U+ebfb
#define ICON_VS_TERMINAL_DECORATION_ERROR "\xee\xaf\xbb" // U+ebfb
#define ICON_VS_ARROW_CIRCLE_DOWN "\xee\xaf\xbc" // U+ebfc
#define ICON_VS_ARROW_CIRCLE_LEFT "\xee\xaf\xbd" // U+ebfd
#define ICON_VS_ARROW_CIRCLE_RIGHT "\xee\xaf\xbe" // U+ebfe
#define ICON_VS_ARROW_CIRCLE_UP "\xee\xaf\xbf" // U+ebff
#define ICON_VS_LAYOUT_SIDEBAR_RIGHT_OFF "\xee\xb0\x80" // U+ec00
#define ICON_VS_LAYOUT_PANEL_OFF "\xee\xb0\x81" // U+ec01
#define ICON_VS_LAYOUT_SIDEBAR_LEFT_OFF "\xee\xb0\x82" // U+ec02
#define ICON_VS_BLANK "\xee\xb0\x83" // U+ec03
#define ICON_VS_HEART_FILLED "\xee\xb0\x84" // U+ec04
#define ICON_VS_MAP "\xee\xb0\x85" // U+ec05
#define ICON_VS_MAP_FILLED "\xee\xb0\x86" // U+ec06
#define ICON_VS_CIRCLE_SMALL "\xee\xb0\x87" // U+ec07
#define ICON_VS_BELL_SLASH "\xee\xb0\x88" // U+ec08
#define ICON_VS_BELL_SLASH_DOT "\xee\xb0\x89" // U+ec09
#define ICON_VS_COMMENT_UNRESOLVED "\xee\xb0\x8a" // U+ec0a
#define ICON_VS_GIT_PULL_REQUEST_GO_TO_CHANGES "\xee\xb0\x8b" // U+ec0b
#define ICON_VS_GIT_PULL_REQUEST_NEW_CHANGES "\xee\xb0\x8c" // U+ec0c
#define ICON_VS_SEARCH_FUZZY "\xee\xb0\x8d" // U+ec0d
#define ICON_VS_COMMENT_DRAFT "\xee\xb0\x8e" // U+ec0e
#define ICON_VS_SEND "\xee\xb0\x8f" // U+ec0f
#define ICON_VS_SPARKLE "\xee\xb0\x90" // U+ec10
#define ICON_VS_INSERT "\xee\xb0\x91" // U+ec11
#define ICON_VS_MIC "\xee\xb0\x92" // U+ec12
#define ICON_VS_THUMBSDOWN_FILLED "\xee\xb0\x93" // U+ec13
#define ICON_VS_THUMBSUP_FILLED "\xee\xb0\x94" // U+ec14
#define ICON_VS_COFFEE "\xee\xb0\x95" // U+ec15
#define ICON_VS_SNAKE "\xee\xb0\x96" // U+ec16
#define ICON_VS_GAME "\xee\xb0\x97" // U+ec17
#define ICON_VS_VR "\xee\xb0\x98" // U+ec18
#define ICON_VS_CHIP "\xee\xb0\x99" // U+ec19
#define ICON_VS_PIANO "\xee\xb0\x9a" // U+ec1a
#define ICON_VS_MUSIC "\xee\xb0\x9b" // U+ec1b
#define ICON_VS_MIC_FILLED "\xee\xb0\x9c" // U+ec1c
#define ICON_VS_GIT_FETCH "\xee\xb0\x9d" // U+ec1d
#define ICON_VS_COPILOT "\xee\xb0\x9e" // U+ec1e
#define ICON_VS_LIGHTBULB_SPARKLE "\xee\xb0\x9f" // U+ec1f
#define ICON_VS_ROBOT "\xee\xb0\xa0" // U+ec20
#define ICON_VS_SPARKLE_FILLED "\xee\xb0\xa1" // U+ec21
#define ICON_VS_DIFF_SINGLE "\xee\xb0\xa2" // U+ec22
#define ICON_VS_DIFF_MULTIPLE "\xee\xb0\xa3" // U+ec23
#define ICON_VS_SURROUND_WITH "\xee\xb0\xa4" // U+ec24
#define ICON_VS_SHARE "\xee\xb0\xa5" // U+ec25

View File

@ -232,7 +232,7 @@ namespace hex {
}
}
static void createNestedMenu(std::span<const UnlocalizedString> menuItems, const Shortcut &shortcut, const std::function<void()> &callback, const std::function<bool()> &enabledCallback) {
static void createNestedMenu(std::span<const UnlocalizedString> menuItems, const char *icon, const Shortcut &shortcut, const std::function<void()> &callback, const std::function<bool()> &enabledCallback) {
const auto &name = menuItems.front();
if (name.get() == ContentRegistry::Interface::impl::SeparatorValue) {
@ -243,13 +243,13 @@ namespace hex {
if (name.get() == ContentRegistry::Interface::impl::SubMenuValue) {
callback();
} else if (menuItems.size() == 1) {
if (ImGui::MenuItem(Lang(name), shortcut.toString().c_str(), false, enabledCallback()))
if (ImGui::MenuItemEx(Lang(name), icon, shortcut.toString().c_str(), false, enabledCallback()))
callback();
} else {
bool isSubmenu = (menuItems.begin() + 1)->get() == ContentRegistry::Interface::impl::SubMenuValue;
if (ImGui::BeginMenu(Lang(name), isSubmenu ? enabledCallback() : true)) {
createNestedMenu({ menuItems.begin() + 1, menuItems.end() }, shortcut, callback, enabledCallback);
if (ImGui::BeginMenuEx(Lang(name), std::next(menuItems.begin())->get() == ContentRegistry::Interface::impl::SubMenuValue ? icon : nullptr, isSubmenu ? enabledCallback() : true)) {
createNestedMenu({ std::next(menuItems.begin()), menuItems.end() }, icon, shortcut, callback, enabledCallback);
ImGui::EndMenu();
}
}
@ -521,8 +521,9 @@ namespace hex {
}
for (auto &[priority, menuItem] : ContentRegistry::Interface::impl::getMenuItems()) {
const auto &[unlocalizedNames, shortcut, view, callback, enabledCallback] = menuItem;
createNestedMenu(unlocalizedNames, *shortcut, callback, enabledCallback);
const auto &[unlocalizedNames, icon, shortcut, view, callback, enabledCallback] = menuItem;
createNestedMenu(unlocalizedNames, icon, *shortcut, callback, enabledCallback);
}
};
@ -563,6 +564,11 @@ namespace hex {
ImGui::EndMenuBar();
}
if (ImGui::BeginDragDropTargetCustom(ImGui::GetCurrentWindow()->MenuBarRect(), ImGui::GetCurrentWindow()->ID)) {
ImGui::EndDragDropTarget();
}
this->beginNativeWindowFrame();
if (ImHexApi::Provider::isValid() && isAnyViewOpen()) {
@ -810,10 +816,10 @@ namespace hex {
// Draw main menu popups
for (auto &[priority, menuItem] : ContentRegistry::Interface::impl::getMenuItems()) {
const auto &[unlocalizedNames, shortcut, view, callback, enabledCallback] = menuItem;
const auto &[unlocalizedNames, icon, shortcut, view, callback, enabledCallback] = menuItem;
if (ImGui::BeginPopup(unlocalizedNames.front().get().c_str())) {
createNestedMenu({ unlocalizedNames.begin() + 1, unlocalizedNames.end() }, *shortcut, callback, enabledCallback);
createNestedMenu({ unlocalizedNames.begin() + 1, unlocalizedNames.end() }, icon, *shortcut, callback, enabledCallback);
ImGui::EndPopup();
}
}

View File

@ -342,7 +342,7 @@ namespace hex::plugin::builtin {
ContentRegistry::Interface::registerMainMenuItem("hex.builtin.menu.file", 1000);
/* Create File */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.create_file" }, 1050, CTRLCMD + Keys::N, [] {
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.create_file" }, ICON_VS_FILE, 1050, CTRLCMD + Keys::N, [] {
auto newProvider = hex::ImHexApi::Provider::createProvider("hex.builtin.provider.mem_file", true);
if (newProvider != nullptr && !newProvider->open())
hex::ImHexApi::Provider::remove(newProvider);
@ -351,12 +351,12 @@ namespace hex::plugin::builtin {
}, noRunningTasks);
/* Open File */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.open_file" }, 1100, CTRLCMD + Keys::O, [] {
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.open_file" }, ICON_VS_OPEN_PREVIEW, 1100, CTRLCMD + Keys::O, [] {
RequestOpenWindow::post("Open File");
}, noRunningTasks);
/* Open Other */
ContentRegistry::Interface::addMenuItemSubMenu({ "hex.builtin.menu.file", "hex.builtin.menu.file.open_other"}, 1150, [] {
ContentRegistry::Interface::addMenuItemSubMenu({ "hex.builtin.menu.file", "hex.builtin.menu.file.open_other"}, ICON_VS_TELESCOPE, 1150, [] {
for (const auto &unlocalizedProviderName : ContentRegistry::Provider::impl::getEntries()) {
if (ImGui::MenuItem(Lang(unlocalizedProviderName)))
ImHexApi::Provider::createProvider(unlocalizedProviderName);
@ -364,7 +364,7 @@ namespace hex::plugin::builtin {
}, noRunningTasks);
/* Reload Provider */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.reload_provider"}, 1250, CTRLCMD + Keys::R, [] {
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.reload_provider"}, ICON_VS_ARROW_SWAP, 1250, CTRLCMD + Keys::R, [] {
auto provider = ImHexApi::Provider::get();
provider->close();
@ -374,15 +374,17 @@ namespace hex::plugin::builtin {
/* Project open / save */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.project", "hex.builtin.menu.file.project.open" }, 1400,
ContentRegistry::Interface::addMenuItemSubMenu({ "hex.builtin.menu.file", "hex.builtin.menu.file.project" }, ICON_VS_NOTEBOOK, 1400, []{}, noRunningTasks);
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.project", "hex.builtin.menu.file.project.open" }, ICON_VS_ROOT_FOLDER_OPENED, 1410,
ALT + Keys::O,
openProject, noRunningTasks);
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.project", "hex.builtin.menu.file.project.save" }, 1450,
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.project", "hex.builtin.menu.file.project.save" }, ICON_VS_SAVE, 1450,
ALT + Keys::S,
saveProject, [&] { return noRunningTaskAndValidProvider() && ProjectFile::hasPath(); });
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.project", "hex.builtin.menu.file.project.save_as" }, 1500,
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.project", "hex.builtin.menu.file.project.save_as" }, ICON_VS_SAVE_AS, 1500,
ALT + SHIFT + Keys::S,
saveProjectAs, noRunningTaskAndValidProvider);
@ -391,20 +393,22 @@ namespace hex::plugin::builtin {
/* Import */
{
ContentRegistry::Interface::addMenuItemSubMenu({ "hex.builtin.menu.file", "hex.builtin.menu.file.import" }, ICON_VS_SIGN_IN, 2140, []{}, noRunningTaskAndWritableProvider);
/* IPS */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.import", "hex.builtin.menu.file.import.ips"}, 2150,
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.import", "hex.builtin.menu.file.import.ips"}, ICON_VS_GIT_PULL_REQUEST_NEW_CHANGES, 2150,
Shortcut::None,
importIPSPatch,
noRunningTaskAndWritableProvider);
/* IPS32 */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.import", "hex.builtin.menu.file.import.ips32"}, 2200,
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.import", "hex.builtin.menu.file.import.ips32"}, ICON_VS_GIT_PULL_REQUEST_NEW_CHANGES, 2200,
Shortcut::None,
importIPS32Patch,
noRunningTaskAndWritableProvider);
/* Modified File */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.import", "hex.builtin.menu.file.import.modified_file" }, 2300,
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.import", "hex.builtin.menu.file.import.modified_file" }, ICON_VS_FILES, 2300,
Shortcut::None,
importModifiedFile,
noRunningTaskAndWritableProvider);
@ -413,19 +417,21 @@ namespace hex::plugin::builtin {
/* Export */
/* Only make them accessible if the current provider is dumpable */
{
ContentRegistry::Interface::addMenuItemSubMenu({ "hex.builtin.menu.file", "hex.builtin.menu.file.export" }, ICON_VS_SIGN_OUT, 6000, []{}, isProviderDumpable);
/* Base 64 */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.export", "hex.builtin.menu.file.export.base64" }, 6000,
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.export", "hex.builtin.menu.file.export.base64" }, 6005,
Shortcut::None,
exportBase64,
isProviderDumpable);
/* Language */
ContentRegistry::Interface::addMenuItemSubMenu({ "hex.builtin.menu.file", "hex.builtin.menu.file.export", "hex.builtin.menu.file.export.as_language" }, 6010,
ContentRegistry::Interface::addMenuItemSubMenu({ "hex.builtin.menu.file", "hex.builtin.menu.file.export", "hex.builtin.menu.file.export.as_language" }, ICON_VS_CODE, 6010,
drawExportLanguageMenu,
isProviderDumpable);
/* Report */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.export", "hex.builtin.menu.file.export.report" }, 6020,
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.export", "hex.builtin.menu.file.export.report" }, ICON_VS_MARKDOWN, 6020,
Shortcut::None,
exportReport,
ImHexApi::Provider::isValid);
@ -433,13 +439,13 @@ namespace hex::plugin::builtin {
ContentRegistry::Interface::addMenuItemSeparator({ "hex.builtin.menu.file", "hex.builtin.menu.file.export" }, 6050);
/* IPS */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.export", "hex.builtin.menu.file.export.ips" }, 6100,
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.export", "hex.builtin.menu.file.export.ips" }, ICON_VS_GIT_PULL_REQUEST_NEW_CHANGES, 6100,
Shortcut::None,
exportIPSPatch,
isProviderDumpable);
/* IPS32 */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.export", "hex.builtin.menu.file.export.ips32" }, 6150,
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.export", "hex.builtin.menu.file.export.ips32" }, ICON_VS_GIT_PULL_REQUEST_NEW_CHANGES, 6150,
Shortcut::None,
exportIPS32Patch,
isProviderDumpable);
@ -448,12 +454,12 @@ namespace hex::plugin::builtin {
ContentRegistry::Interface::addMenuItemSeparator({ "hex.builtin.menu.file" }, 10000);
/* Close Provider */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.close"}, 10050, CTRLCMD + Keys::W, [] {
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.close"}, ICON_VS_CHROME_CLOSE, 10050, CTRLCMD + Keys::W, [] {
ImHexApi::Provider::remove(ImHexApi::Provider::get());
}, noRunningTaskAndValidProvider);
/* Quit ImHex */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.quit"}, 10100, ALT + Keys::F4, [] {
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.quit"}, ICON_VS_CLOSE_ALL, 10100, ALT + Keys::F4, [] {
ImHexApi::System::closeImHex();
});
}
@ -462,13 +468,13 @@ namespace hex::plugin::builtin {
ContentRegistry::Interface::registerMainMenuItem("hex.builtin.menu.edit", 2000);
/* Undo */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.menu.edit.undo" }, 1000, CTRLCMD + Keys::Z, [] {
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.menu.edit.undo" }, ICON_VS_DISCARD, 1000, CTRLCMD + Keys::Z, [] {
auto provider = ImHexApi::Provider::get();
provider->undo();
}, [&] { return ImHexApi::Provider::isValid() && ImHexApi::Provider::get()->canUndo(); });
/* Redo */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.menu.edit.redo" }, 1050, CTRLCMD + Keys::Y, [] {
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.menu.edit.redo" }, ICON_VS_REDO, 1050, CTRLCMD + Keys::Y, [] {
auto provider = ImHexApi::Provider::get();
provider->redo();
}, [&] { return ImHexApi::Provider::isValid() && ImHexApi::Provider::get()->canRedo(); });
@ -483,7 +489,7 @@ namespace hex::plugin::builtin {
if (view->hasViewMenuItemEntry()) {
auto &state = view->getWindowOpenState();
ImGui::MenuItem(Lang(view->getUnlocalizedName()), "", &state, ImHexApi::Provider::isValid() && !LayoutManager::isLayoutLocked());
ImGui::MenuItemEx(Lang(view->getUnlocalizedName()), view->getIcon(), "", state, ImHexApi::Provider::isValid() && !LayoutManager::isLayoutLocked());
}
}
@ -502,15 +508,17 @@ namespace hex::plugin::builtin {
ContentRegistry::Interface::registerMainMenuItem("hex.builtin.menu.workspace", 4000);
ContentRegistry::Interface::addMenuItemSubMenu({ "hex.builtin.menu.workspace", "hex.builtin.menu.workspace.layout" }, ICON_VS_LAYOUT, 1050, []{}, ImHexApi::Provider::isValid);
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.workspace", "hex.builtin.menu.workspace.layout", "hex.builtin.menu.workspace.layout.save" }, 1100, Shortcut::None, [] {
ui::PopupTextInput::open("hex.builtin.popup.save_layout.title", "hex.builtin.popup.save_layout.desc", [](const std::string &name) {
LayoutManager::save(name);
});
}, ImHexApi::Provider::isValid);
ContentRegistry::Interface::addMenuItemSubMenu({ "hex.builtin.menu.workspace", "hex.builtin.menu.workspace.layout" }, 1150, [] {
ContentRegistry::Interface::addMenuItemSubMenu({ "hex.builtin.menu.workspace", "hex.builtin.menu.workspace.layout" }, ICON_VS_LAYOUT, 1150, [] {
bool locked = LayoutManager::isLayoutLocked();
if (ImGui::MenuItem("hex.builtin.menu.workspace.layout.lock"_lang, nullptr, &locked, ImHexApi::Provider::isValid())) {
if (ImGui::MenuItemEx("hex.builtin.menu.workspace.layout.lock"_lang, locked ? ICON_VS_UNLOCK : ICON_VS_LOCK, nullptr, locked, ImHexApi::Provider::isValid())) {
LayoutManager::lockLayout(locked);
ContentRegistry::Settings::write("hex.builtin.setting.interface", "hex.builtin.setting.interface.layout_locked", locked);
}
@ -544,7 +552,7 @@ namespace hex::plugin::builtin {
ContentRegistry::Interface::addMenuItemSeparator({ "hex.builtin.menu.workspace" }, 3000);
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.workspace", "hex.builtin.menu.workspace.create" }, 3100, Shortcut::None, [] {
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.workspace", "hex.builtin.menu.workspace.create" }, ICON_VS_REPO_CREATE, 3100, Shortcut::None, [] {
ui::PopupTextInput::open("hex.builtin.popup.create_workspace.title", "hex.builtin.popup.create_workspace.desc", [](const std::string &name) {
WorkspaceManager::createWorkspace(name);
});

View File

@ -1,6 +1,7 @@
#include <unordered_set>
#include <imgui.h>
#include <imgui_internal.h>
#include <hex/api/event_manager.hpp>
#include <hex/api/content_registry.hpp>
@ -330,7 +331,7 @@ namespace hex::plugin::builtin::recent {
void addMenuItems() {
ContentRegistry::Interface::addMenuItemSubMenu({ "hex.builtin.menu.file" }, 1200, [] {
if (ImGui::BeginMenu("hex.builtin.menu.file.open_recent"_lang, !recent::s_recentEntriesUpdating && !s_recentEntries.empty())) {
if (ImGui::BeginMenuEx("hex.builtin.menu.file.open_recent"_lang, ICON_VS_ARCHIVE, !recent::s_recentEntriesUpdating && !s_recentEntries.empty())) {
// Copy to avoid changing list while iteration
auto recentEntries = s_recentEntries;
for (auto &recentEntry : recentEntries) {

View File

@ -75,7 +75,7 @@ namespace hex::plugin::builtin {
ViewAbout::ViewAbout() : View::Modal("hex.builtin.view.help.about.name") {
// Add "About" menu item to the help menu
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.help", "hex.builtin.view.help.about.name" }, 1000, Shortcut::None, [this] {
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.help", "hex.builtin.view.help.about.name" }, ICON_VS_INFO, 1000, Shortcut::None, [this] {
this->getWindowOpenState() = true;
});
@ -94,7 +94,7 @@ namespace hex::plugin::builtin {
// Add documentation link to the help menu
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.help", "hex.builtin.view.help.documentation" }, 5000, Shortcut::None, [] {
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.help", "hex.builtin.view.help.documentation" }, ICON_VS_BOOK, 5000, Shortcut::None, [] {
hex::openWebpage("https://docs.werwolv.net/imhex");
AchievementManager::unlockAchievement("hex.builtin.achievement.starting_out", "hex.builtin.achievement.starting_out.docs.name");
});

View File

@ -11,7 +11,7 @@ namespace hex::plugin::builtin {
ViewAchievements::ViewAchievements() : View::Floating("hex.builtin.view.achievements.name") {
// Add achievements menu item to Extas menu
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.extras", "hex.builtin.view.achievements.name" }, 2600, Shortcut::None, [&, this] {
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.extras", "hex.builtin.view.achievements.name" }, ICON_VS_SPARKLE, 2600, Shortcut::None, [&, this] {
this->getWindowOpenState() = true;
});

View File

@ -17,7 +17,7 @@
namespace hex::plugin::builtin {
ViewBookmarks::ViewBookmarks() : View::Window("hex.builtin.view.bookmarks.name") {
ViewBookmarks::ViewBookmarks() : View::Window("hex.builtin.view.bookmarks.name", ICON_VS_BOOKMARK) {
// Handle bookmark add requests sent by the API
RequestAddBookmark::subscribe(this, [this](Region region, std::string name, std::string comment, color_t color, u64 *id) {
@ -526,7 +526,7 @@ namespace hex::plugin::builtin {
void ViewBookmarks::registerMenuItems() {
/* Create bookmark */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.menu.edit.bookmark.create" }, 1900, CTRLCMD + Keys::B, [&] {
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.menu.edit.bookmark.create" }, ICON_VS_BOOKMARK, 1900, CTRLCMD + Keys::B, [&] {
if (!ImHexApi::HexEditor::isSelectionValid())
return;
@ -538,7 +538,7 @@ namespace hex::plugin::builtin {
ContentRegistry::Interface::addMenuItemSeparator({ "hex.builtin.menu.file", "hex.builtin.menu.file.import" }, 3000);
/* Import bookmarks */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.import", "hex.builtin.menu.file.import.bookmark" }, 3050, Shortcut::None, [this]{
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.import", "hex.builtin.menu.file.import.bookmark" }, ICON_VS_BOOKMARK, 3050, Shortcut::None, [this]{
fs::openFileBrowser(fs::DialogMode::Open, { { "Bookmarks File", "hexbm"} }, [&, this](const std::fs::path &path) {
try {
this->importBookmarks(ImHexApi::Provider::get(), nlohmann::json::parse(wolv::io::File(path, wolv::io::File::Mode::Read).readString()));
@ -550,7 +550,7 @@ namespace hex::plugin::builtin {
/* Export bookmarks */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.export", "hex.builtin.menu.file.export.bookmark" }, 6250, Shortcut::None, [this]{
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.export", "hex.builtin.menu.file.export.bookmark" }, ICON_VS_BOOKMARK, 6250, Shortcut::None, [this]{
fs::openFileBrowser(fs::DialogMode::Save, { { "Bookmarks File", "hexbm"} }, [&, this](const std::fs::path &path) {
nlohmann::json json;
this->exportBookmarks(ImHexApi::Provider::get(), json);

View File

@ -12,7 +12,7 @@
namespace hex::plugin::builtin {
ViewConstants::ViewConstants() : View::Window("hex.builtin.view.constants.name") {
ViewConstants::ViewConstants() : View::Window("hex.builtin.view.constants.name", ICON_VS_SYMBOL_CONSTANT) {
this->reloadConstants();
}

View File

@ -19,7 +19,7 @@ namespace hex::plugin::builtin {
using NumberDisplayStyle = ContentRegistry::DataInspector::NumberDisplayStyle;
ViewDataInspector::ViewDataInspector() : View::Window("hex.builtin.view.data_inspector.name") {
ViewDataInspector::ViewDataInspector() : View::Window("hex.builtin.view.data_inspector.name", ICON_VS_INSPECT) {
// Handle region selection
EventRegionSelected::subscribe(this, [this](const auto &region) {

View File

@ -348,7 +348,7 @@ namespace hex::plugin::builtin {
ViewDataProcessor::Workspace m_workspace;
};
ViewDataProcessor::ViewDataProcessor() : View::Window("hex.builtin.view.data_processor.name") {
ViewDataProcessor::ViewDataProcessor() : View::Window("hex.builtin.view.data_processor.name", ICON_VS_CHIP) {
ContentRegistry::DataProcessorNode::add<NodeCustom>("hex.builtin.nodes.custom", "hex.builtin.nodes.custom.custom", this);
ContentRegistry::DataProcessorNode::add<NodeCustomInput>("hex.builtin.nodes.custom", "hex.builtin.nodes.custom.input");
ContentRegistry::DataProcessorNode::add<NodeCustomOutput>("hex.builtin.nodes.custom", "hex.builtin.nodes.custom.output");
@ -393,7 +393,7 @@ namespace hex::plugin::builtin {
});
/* Import Nodes */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.import", "hex.builtin.menu.file.import.data_processor" }, 4050, Shortcut::None, [this]{
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.import", "hex.builtin.menu.file.import.data_processor" }, ICON_VS_CHIP, 4050, Shortcut::None, [this]{
fs::openFileBrowser(fs::DialogMode::Open, { {"hex.builtin.view.data_processor.name"_lang, "hexnode" } },
[&](const std::fs::path &path) {
wolv::io::File file(path, wolv::io::File::Mode::Read);
@ -405,7 +405,7 @@ namespace hex::plugin::builtin {
}, ImHexApi::Provider::isValid);
/* Export Nodes */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.export", "hex.builtin.menu.file.export.data_processor" }, 8050, Shortcut::None, [this]{
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.export", "hex.builtin.menu.file.export.data_processor" }, ICON_VS_CHIP, 8050, Shortcut::None, [this]{
fs::openFileBrowser(fs::DialogMode::Save, { {"hex.builtin.view.data_processor.name"_lang, "hexnode" } },
[&, this](const std::fs::path &path) {
wolv::io::File file(path, wolv::io::File::Mode::Create);

View File

@ -15,7 +15,7 @@ namespace hex::plugin::builtin {
}
ViewDiff::ViewDiff() : View::Window("hex.builtin.view.diff.name") {
ViewDiff::ViewDiff() : View::Window("hex.builtin.view.diff.name", ICON_VS_DIFF_SIDEBYSIDE) {
// Clear the selected diff providers when a provider is closed
EventProviderClosed::subscribe(this, [this](prv::Provider *) {

View File

@ -15,7 +15,7 @@
namespace hex::plugin::builtin {
ViewFind::ViewFind() : View::Window("hex.builtin.view.find.name") {
ViewFind::ViewFind() : View::Window("hex.builtin.view.find.name", ICON_VS_SEARCH) {
const static auto HighlightColor = [] { return (ImGuiExt::GetCustomColorU32(ImGuiCustomCol_FindHighlight) & 0x00FFFFFF) | 0x70000000; };
ImHexApi::HexEditor::addBackgroundHighlightingProvider([this](u64 address, const u8* data, size_t size, bool) -> std::optional<color_t> {

View File

@ -557,7 +557,7 @@ namespace hex::plugin::builtin {
/* Hex Editor */
ViewHexEditor::ViewHexEditor() : View::Window("hex.builtin.view.hex_editor.name") {
ViewHexEditor::ViewHexEditor() : View::Window("hex.builtin.view.hex_editor.name", ICON_VS_FILE_BINARY) {
m_hexEditor.setForegroundHighlightCallback([this](u64 address, const u8 *data, size_t size) -> std::optional<color_t> {
if (auto highlight = m_foregroundHighlights->find(address); highlight != m_foregroundHighlights->end())
return highlight->second;
@ -1069,7 +1069,7 @@ namespace hex::plugin::builtin {
ContentRegistry::Interface::addMenuItemSeparator({ "hex.builtin.menu.file" }, 1300);
/* Save */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.view.hex_editor.menu.file.save" }, 1350,
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.view.hex_editor.menu.file.save" }, ICON_VS_SAVE, 1350,
CTRLCMD + Keys::S,
save,
[] {
@ -1080,7 +1080,7 @@ namespace hex::plugin::builtin {
});
/* Save As */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.view.hex_editor.menu.file.save_as" }, 1375,
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.view.hex_editor.menu.file.save_as" }, ICON_VS_SAVE_AS, 1375,
CTRLCMD + SHIFT + Keys::S,
saveAs,
[] {
@ -1091,7 +1091,7 @@ namespace hex::plugin::builtin {
});
/* Load Encoding File */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.import", "hex.builtin.menu.file.import.custom_encoding" }, 5050, Shortcut::None,
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.import", "hex.builtin.menu.file.import.custom_encoding" }, "", 5050, Shortcut::None,
[this]{
const auto basePaths = fs::getDefaultPaths(fs::ImHexPath::Encodings);
std::vector<std::fs::path> paths;
@ -1121,7 +1121,7 @@ namespace hex::plugin::builtin {
ContentRegistry::Interface::addMenuItemSeparator({ "hex.builtin.menu.file" }, 1500);
/* Search */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.view.hex_editor.menu.file.search" }, 1550,
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.view.hex_editor.menu.file.search" }, ICON_VS_SEARCH, 1550,
CTRLCMD + Keys::F,
[this] {
this->openPopup<PopupFind>();
@ -1129,7 +1129,7 @@ namespace hex::plugin::builtin {
ImHexApi::Provider::isValid);
/* Goto */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.view.hex_editor.menu.file.goto" }, 1600,
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.view.hex_editor.menu.file.goto" }, ICON_VS_DEBUG_STEP_INTO, 1600,
CTRLCMD + Keys::G,
[this] {
this->openPopup<PopupGoto>();
@ -1137,7 +1137,7 @@ namespace hex::plugin::builtin {
ImHexApi::Provider::isValid);
/* Select */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.view.hex_editor.menu.file.select" }, 1650,
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.view.hex_editor.menu.file.select" }, ICON_VS_SELECTION, 1650,
CTRLCMD + SHIFT + Keys::A,
[this] {
auto selection = ImHexApi::HexEditor::getSelection().value_or(ImHexApi::HexEditor::ProviderRegion{ { 0, 1 }, nullptr });
@ -1150,7 +1150,7 @@ namespace hex::plugin::builtin {
ContentRegistry::Interface::addMenuItemSeparator({ "hex.builtin.menu.edit" }, 1100);
/* Copy */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.view.hex_editor.menu.edit.copy" }, 1150,
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.view.hex_editor.menu.edit.copy" }, ICON_VS_COPY, 1150,
CurrentView + CTRLCMD + Keys::C,
[] {
auto selection = ImHexApi::HexEditor::getSelection();
@ -1160,8 +1160,10 @@ namespace hex::plugin::builtin {
ImHexApi::HexEditor::isSelectionValid,
this);
ContentRegistry::Interface::addMenuItemSubMenu({ "hex.builtin.menu.edit", "hex.builtin.view.hex_editor.menu.edit.copy_as" }, ICON_VS_PREVIEW, 1190, []{}, ImHexApi::HexEditor::isSelectionValid);
/* Copy As */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.view.hex_editor.menu.edit.copy_as", "hex.builtin.view.hex_editor.copy.ascii" }, 1200,
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.view.hex_editor.menu.edit.copy_as", "hex.builtin.view.hex_editor.copy.ascii" }, ICON_VS_SYMBOL_TEXT, 1200,
CurrentView + CTRLCMD + SHIFT + Keys::C,
[] {
auto selection = ImHexApi::HexEditor::getSelection();
@ -1172,7 +1174,7 @@ namespace hex::plugin::builtin {
this);
/* Copy address */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.view.hex_editor.menu.edit.copy_as", "hex.builtin.view.hex_editor.copy.address" }, 1250,
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.view.hex_editor.menu.edit.copy_as", "hex.builtin.view.hex_editor.copy.address" }, ICON_VS_LOCATION, 1250,
Shortcut::None,
[] {
auto selection = ImHexApi::HexEditor::getSelection();
@ -1182,7 +1184,7 @@ namespace hex::plugin::builtin {
ImHexApi::HexEditor::isSelectionValid);
/* Copy custom encoding */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.view.hex_editor.menu.edit.copy_as", "hex.builtin.view.hex_editor.copy.custom_encoding" }, 1300,
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.view.hex_editor.menu.edit.copy_as", "hex.builtin.view.hex_editor.copy.custom_encoding" }, "", 1300,
Shortcut::None,
[this] {
auto selection = ImHexApi::HexEditor::getSelection();
@ -1197,7 +1199,7 @@ namespace hex::plugin::builtin {
ContentRegistry::Interface::addMenuItemSeparator({ "hex.builtin.menu.edit", "hex.builtin.view.hex_editor.menu.edit.copy_as" }, 1350);
/* Copy as... */
ContentRegistry::Interface::addMenuItemSubMenu({ "hex.builtin.menu.edit", "hex.builtin.view.hex_editor.menu.edit.copy_as" }, 1400, []{
ContentRegistry::Interface::addMenuItemSubMenu({ "hex.builtin.menu.edit", "hex.builtin.view.hex_editor.menu.edit.copy_as" }, ICON_VS_FILE_CODE, 1400, []{
auto selection = ImHexApi::HexEditor::getSelection();
auto provider = ImHexApi::Provider::get();
@ -1219,7 +1221,7 @@ namespace hex::plugin::builtin {
});
/* Paste */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.view.hex_editor.menu.edit.paste" }, 1450, CurrentView + CTRLCMD + Keys::V,
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.view.hex_editor.menu.edit.paste" }, ICON_VS_OUTPUT, 1450, CurrentView + CTRLCMD + Keys::V,
[] {
pasteBytes(ImHexApi::HexEditor::getSelection().value_or( ImHexApi::HexEditor::ProviderRegion(Region { 0, 0 }, ImHexApi::Provider::get())), true);
},
@ -1227,7 +1229,7 @@ namespace hex::plugin::builtin {
this);
/* Paste All */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.view.hex_editor.menu.edit.paste_all" }, 1500, CurrentView + CTRLCMD + SHIFT + Keys::V,
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.view.hex_editor.menu.edit.paste_all" }, ICON_VS_CLIPPY, 1500, CurrentView + CTRLCMD + SHIFT + Keys::V,
[] {
pasteBytes(ImHexApi::HexEditor::getSelection().value_or( ImHexApi::HexEditor::ProviderRegion(Region { 0, 0 }, ImHexApi::Provider::get())), false);
},
@ -1235,7 +1237,7 @@ namespace hex::plugin::builtin {
this);
/* Select All */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.view.hex_editor.menu.edit.select_all" }, 1550, CurrentView + CTRLCMD + Keys::A,
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.view.hex_editor.menu.edit.select_all" }, ICON_VS_SELECTION, 1550, CurrentView + CTRLCMD + Keys::A,
[] {
auto provider = ImHexApi::Provider::get();
ImHexApi::HexEditor::setSelection(provider->getBaseAddress(), provider->getActualSize());
@ -1247,7 +1249,7 @@ namespace hex::plugin::builtin {
ContentRegistry::Interface::addMenuItemSeparator({ "hex.builtin.menu.edit" }, 1600);
/* Set Base Address */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.view.hex_editor.menu.edit.set_base" }, 1650, Shortcut::None,
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.view.hex_editor.menu.edit.set_base" }, ICON_VS_LOCATION, 1650, Shortcut::None,
[this] {
auto provider = ImHexApi::Provider::get();
this->openPopup<PopupBaseAddress>(provider->getBaseAddress());
@ -1255,7 +1257,7 @@ namespace hex::plugin::builtin {
[] { return ImHexApi::Provider::isValid() && ImHexApi::Provider::get()->isReadable(); });
/* Resize */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.view.hex_editor.menu.edit.resize" }, 1700, Shortcut::None,
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.view.hex_editor.menu.edit.resize" }, ICON_VS_ARROW_BOTH, 1700, Shortcut::None,
[this] {
auto provider = ImHexApi::Provider::get();
this->openPopup<PopupResize>(provider->getBaseAddress());
@ -1263,7 +1265,7 @@ namespace hex::plugin::builtin {
[] { return ImHexApi::Provider::isValid() && ImHexApi::Provider::get()->isResizable(); });
/* Insert */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.view.hex_editor.menu.edit.insert" }, 1750, Shortcut::None,
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.view.hex_editor.menu.edit.insert" }, ICON_VS_INSERT, 1750, Shortcut::None,
[this] {
auto selection = ImHexApi::HexEditor::getSelection();
@ -1272,7 +1274,7 @@ namespace hex::plugin::builtin {
[] { return ImHexApi::HexEditor::isSelectionValid() && ImHexApi::Provider::isValid() && ImHexApi::Provider::get()->isResizable(); });
/* Remove */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.view.hex_editor.menu.edit.remove" }, 1800, Shortcut::None,
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.view.hex_editor.menu.edit.remove" }, ICON_VS_CLEAR_ALL, 1800, Shortcut::None,
[this] {
auto selection = ImHexApi::HexEditor::getSelection();
@ -1281,7 +1283,7 @@ namespace hex::plugin::builtin {
[] { return ImHexApi::HexEditor::isSelectionValid() && ImHexApi::Provider::isValid() && ImHexApi::Provider::get()->isResizable(); });
/* Fill */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.view.hex_editor.menu.edit.fill" }, 1810, Shortcut::None,
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.view.hex_editor.menu.edit.fill" }, ICON_VS_PAINTCAN, 1810, Shortcut::None,
[this] {
auto selection = ImHexApi::HexEditor::getSelection();
@ -1290,7 +1292,7 @@ namespace hex::plugin::builtin {
[] { return ImHexApi::HexEditor::isSelectionValid() && ImHexApi::Provider::isValid() && ImHexApi::Provider::get()->isWritable(); });
/* Jump to */
ContentRegistry::Interface::addMenuItemSubMenu({ "hex.builtin.menu.edit", "hex.builtin.view.hex_editor.menu.edit.jump_to" }, 1850,
ContentRegistry::Interface::addMenuItemSubMenu({ "hex.builtin.menu.edit", "hex.builtin.view.hex_editor.menu.edit.jump_to" }, ICON_VS_DEBUG_STEP_OUT, 1850,
[] {
auto provider = ImHexApi::Provider::get();
auto selection = ImHexApi::HexEditor::getSelection();
@ -1320,7 +1322,7 @@ namespace hex::plugin::builtin {
[] { return ImHexApi::Provider::isValid() && ImHexApi::HexEditor::isSelectionValid() && ImHexApi::HexEditor::getSelection()->getSize() <= sizeof(u64); });
/* Set Page Size */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.view.hex_editor.menu.edit.set_page_size" }, 1860, Shortcut::None,
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.view.hex_editor.menu.edit.set_page_size" }, ICON_VS_BROWSER, 1860, Shortcut::None,
[this] {
auto provider = ImHexApi::Provider::get();
this->openPopup<PopupPageSize>(provider->getPageSize());
@ -1330,7 +1332,7 @@ namespace hex::plugin::builtin {
ContentRegistry::Interface::addMenuItemSeparator({ "hex.builtin.menu.edit" }, 1900);
/* Open in new provider */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.view.hex_editor.menu.edit.open_in_new_provider" }, 1950, Shortcut::None,
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.view.hex_editor.menu.edit.open_in_new_provider" }, ICON_VS_GO_TO_FILE, 1950, Shortcut::None,
[] {
auto selection = ImHexApi::HexEditor::getSelection();

View File

@ -108,7 +108,7 @@ namespace hex::plugin::builtin {
ViewHighlightRules::ViewHighlightRules() : View::Floating("hex.builtin.view.highlight_rules.name") {
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.view.highlight_rules.menu.edit.rules" }, 1870, Shortcut::None, [&, this] {
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.view.highlight_rules.menu.edit.rules" }, ICON_VS_TAG, 1870, Shortcut::None, [&, this] {
this->getWindowOpenState() = true;
}, ImHexApi::Provider::isValid);

View File

@ -20,7 +20,7 @@ namespace hex::plugin::builtin {
using namespace hex::literals;
ViewInformation::ViewInformation() : View::Window("hex.builtin.view.information.name") {
ViewInformation::ViewInformation() : View::Window("hex.builtin.view.information.name", ICON_VS_GRAPH_LINE) {
EventDataChanged::subscribe(this, [this] {
m_dataValid = false;
m_plainTextCharacterPercentage = -1.0;

View File

@ -6,7 +6,7 @@
namespace hex::plugin::builtin {
ViewLogs::ViewLogs() : View::Floating("hex.builtin.view.logs.name") {
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.extras", "hex.builtin.view.logs.name" }, 2500, Shortcut::None, [&, this] {
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.extras", "hex.builtin.view.logs.name" }, ICON_VS_BRACKET_ERROR, 2500, Shortcut::None, [&, this] {
this->getWindowOpenState() = true;
});
}

View File

@ -16,7 +16,7 @@ using namespace std::literals::string_literals;
namespace hex::plugin::builtin {
ViewPatches::ViewPatches() : View::Window("hex.builtin.view.patches.name") {
ViewPatches::ViewPatches() : View::Window("hex.builtin.view.patches.name", ICON_VS_GIT_PULL_REQUEST_NEW_CHANGES) {
ProjectFile::registerPerProviderHandler({
.basePath = "patches.json",

View File

@ -7,7 +7,7 @@
namespace hex::plugin::builtin {
ViewPatternData::ViewPatternData() : View::Window("hex.builtin.view.pattern_data.name") {
ViewPatternData::ViewPatternData() : View::Window("hex.builtin.view.pattern_data.name", ICON_VS_DATABASE) {
m_patternDrawer = std::make_unique<ui::PatternDrawer>();
// Handle tree style setting changes

View File

@ -129,7 +129,7 @@ namespace hex::plugin::builtin {
return langDef;
}
ViewPatternEditor::ViewPatternEditor() : View::Window("hex.builtin.view.pattern_editor.name") {
ViewPatternEditor::ViewPatternEditor() : View::Window("hex.builtin.view.pattern_editor.name", ICON_VS_SYMBOL_NAMESPACE) {
m_parserRuntime = std::make_unique<pl::PatternLanguage>();
ContentRegistry::PatternLanguage::configureRuntime(*m_parserRuntime, nullptr);
@ -1217,7 +1217,7 @@ namespace hex::plugin::builtin {
void ViewPatternEditor::registerMenuItems() {
/* Import Pattern */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.import", "hex.builtin.menu.file.import.pattern" }, 4050, Shortcut::None,
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.import", "hex.builtin.menu.file.import.pattern" }, ICON_VS_FILE_CODE, 4050, Shortcut::None,
[this] {
auto provider = ImHexApi::Provider::get();
const auto basePaths = fs::getDefaultPaths(fs::ImHexPath::Patterns);
@ -1242,7 +1242,7 @@ namespace hex::plugin::builtin {
}, ImHexApi::Provider::isValid);
/* Export Pattern */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.export", "hex.builtin.menu.file.export.pattern" }, 7050, Shortcut::None,
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.menu.file.export", "hex.builtin.menu.file.export.pattern" }, ICON_VS_FILE_CODE, 7050, Shortcut::None,
[this] {
fs::openFileBrowser(fs::DialogMode::Save, { {"Pattern", "hexpat"} },
[this](const auto &path) {
@ -1263,7 +1263,7 @@ namespace hex::plugin::builtin {
}};
/* Place pattern... */
ContentRegistry::Interface::addMenuItemSubMenu({ "hex.builtin.menu.edit", "hex.builtin.view.pattern_editor.menu.edit.place_pattern" }, 3000,
ContentRegistry::Interface::addMenuItemSubMenu({ "hex.builtin.menu.edit", "hex.builtin.view.pattern_editor.menu.edit.place_pattern" }, ICON_VS_LIBRARY, 3000,
[&, this] {
if (ImGui::BeginMenu("hex.builtin.view.pattern_editor.menu.edit.place_pattern.builtin"_lang)) {
if (ImGui::BeginMenu("hex.builtin.view.pattern_editor.menu.edit.place_pattern.builtin.single"_lang)) {

View File

@ -21,7 +21,7 @@ namespace hex::plugin::builtin {
// Add the settings menu item to the Extras menu
ContentRegistry::Interface::addMenuItemSeparator({ "hex.builtin.menu.extras" }, 3000);
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.extras", "hex.builtin.view.settings.name" }, 4000, Shortcut::None, [&, this] {
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.extras", "hex.builtin.view.settings.name" }, ICON_VS_SETTINGS_GEAR, 4000, Shortcut::None, [&, this] {
this->getWindowOpenState() = true;
});
}

View File

@ -29,7 +29,7 @@ namespace hex::plugin::builtin {
using namespace std::literals::chrono_literals;
ViewStore::ViewStore() : View::Floating("hex.builtin.view.store.name") {
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.extras", "hex.builtin.view.store.name" }, 1000, Shortcut::None, [&, this] {
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.extras", "hex.builtin.view.store.name" }, ICON_VS_GLOBE, 1000, Shortcut::None, [&, this] {
if (m_requestStatus == RequestStatus::NotAttempted)
this->refresh();

View File

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

View File

@ -5,7 +5,7 @@
namespace hex::plugin::builtin {
ViewTools::ViewTools() : View::Window("hex.builtin.view.tools.name") {
ViewTools::ViewTools() : View::Window("hex.builtin.view.tools.name", ICON_VS_TOOLS) {
m_dragStartIterator = ContentRegistry::Tools::impl::getEntries().end();
}

View File

@ -8,7 +8,7 @@
namespace hex::plugin::builtin {
ViewTutorials::ViewTutorials() : View::Floating("hex.builtin.view.tutorials.name") {
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.help", "hex.builtin.view.tutorials.name" }, 4000, Shortcut::None, [&, this] {
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.help", "hex.builtin.view.tutorials.name" }, ICON_VS_COMPASS, 4000, Shortcut::None, [&, this] {
this->getWindowOpenState() = true;
});
}

View File

@ -9,7 +9,7 @@ using namespace std::literals::string_literals;
namespace hex::plugin::disasm {
ViewDisassembler::ViewDisassembler() : View::Window("hex.disassembler.view.disassembler.name") {
ViewDisassembler::ViewDisassembler() : View::Window("hex.disassembler.view.disassembler.name", ICON_VS_FILE_CODE) {
EventProviderDeleted::subscribe(this, [this](const auto*) {
m_disassembly.clear();
});

View File

@ -54,7 +54,7 @@ namespace hex::plugin::hashes {
ContentRegistry::Hashes::Hash::Function m_hash;
};
ViewHashes::ViewHashes() : View::Window("hex.hashes.view.hashes.name") {
ViewHashes::ViewHashes() : View::Window("hex.hashes.view.hashes.name", ICON_VS_KEY) {
EventRegionSelected::subscribe(this, [this](const auto &providerRegion) {
for (auto &function : m_hashFunctions.get(providerRegion.getProvider()))
function.reset();

View File

@ -13,7 +13,7 @@
namespace hex::plugin::windows {
ViewTTYConsole::ViewTTYConsole() : View::Window("hex.windows.view.tty_console.name") {
ViewTTYConsole::ViewTTYConsole() : View::Window("hex.windows.view.tty_console.name", ICON_VS_TERMINAL) {
m_comPorts = getAvailablePorts();
m_transmitDataBuffer.resize(0xFFF, 0x00);
m_receiveDataBuffer.reserve(0xFFF);

View File

@ -25,7 +25,7 @@ namespace hex::plugin::yara {
using namespace wolv::literals;
ViewYara::ViewYara() : View::Window("hex.yara_rules.view.yara.name") {
ViewYara::ViewYara() : View::Window("hex.yara_rules.view.yara.name", ICON_VS_BUG) {
yr_initialize();
ContentRegistry::FileHandler::add({ ".yar", ".yara" }, [](const auto &path) {