diff --git a/lib/libimhex/include/hex/api/content_registry.hpp b/lib/libimhex/include/hex/api/content_registry.hpp index 7c9e3cc9b..8ca31de38 100644 --- a/lib/libimhex/include/hex/api/content_registry.hpp +++ b/lib/libimhex/include/hex/api/content_registry.hpp @@ -209,7 +209,7 @@ namespace hex { class DropDown : public Widget { public: - explicit DropDown(const std::vector &items, const std::vector &settingsValues, const nlohmann::json &defaultItem) : m_items(items), m_settingsValues(settingsValues), m_defaultItem(defaultItem) { } + explicit DropDown(const std::vector &items, const std::vector &settingsValues, const nlohmann::json &defaultItem) : m_items(items), m_settingsValues(settingsValues), m_defaultItem(defaultItem) { } bool draw(const std::string &name) override; @@ -220,7 +220,7 @@ namespace hex { const nlohmann::json& getValue() const; protected: - std::vector m_items; + std::vector m_items; std::vector m_settingsValues; nlohmann::json m_defaultItem; diff --git a/lib/libimhex/source/api/content_registry.cpp b/lib/libimhex/source/api/content_registry.cpp index 93c71c897..36b4d2c9e 100644 --- a/lib/libimhex/source/api/content_registry.cpp +++ b/lib/libimhex/source/api/content_registry.cpp @@ -402,7 +402,7 @@ namespace hex { bool DropDown::draw(const std::string &name) { auto preview = ""; if (static_cast(m_value) < m_items.size()) - preview = m_items[m_value].c_str(); + preview = m_items[m_value].get().c_str(); bool changed = false; if (ImGui::BeginCombo(name.c_str(), Lang(preview))) { diff --git a/plugins/builtin/romfs/lang/en_US.json b/plugins/builtin/romfs/lang/en_US.json index ed1778c02..d05f59dbb 100644 --- a/plugins/builtin/romfs/lang/en_US.json +++ b/plugins/builtin/romfs/lang/en_US.json @@ -496,6 +496,9 @@ "hex.builtin.setting.hex_editor.highlight_color": "Selection highlight color", "hex.builtin.setting.hex_editor.pattern_parent_highlighting": "Highlight pattern parents on hover", "hex.builtin.setting.hex_editor.paste_behaviour": "Single-Byte Paste behaviour", + "hex.builtin.setting.hex_editor.paste_behaviour.none": "Ask me next time", + "hex.builtin.setting.hex_editor.paste_behaviour.everything": "Paste everything", + "hex.builtin.setting.hex_editor.paste_behaviour.selection": "Paste over selection", "hex.builtin.setting.hex_editor.sync_scrolling": "Synchronize editor scroll position", "hex.builtin.setting.hex_editor.show_highlights": "Show colorful highlightings", "hex.builtin.setting.hex_editor.show_selection": "Move selection display to hex editor footer", diff --git a/plugins/builtin/source/content/settings_entries.cpp b/plugins/builtin/source/content/settings_entries.cpp index 01073da35..7386a5f3d 100644 --- a/plugins/builtin/source/content/settings_entries.cpp +++ b/plugins/builtin/source/content/settings_entries.cpp @@ -900,7 +900,7 @@ namespace hex::plugin::builtin { ContentRegistry::Settings::add("hex.builtin.setting.hex_editor", "", "hex.builtin.setting.hex_editor.pattern_parent_highlighting", true); - std::vector pasteBehaviourNames = { "Ask me next time", "Paste everything", "Paste over selection" }; + std::vector pasteBehaviourNames = { "hex.builtin.setting.hex_editor.paste_behaviour.none", "hex.builtin.setting.hex_editor.paste_behaviour.everything", "hex.builtin.setting.hex_editor.paste_behaviour.selection" }; std::vector pasteBehaviourValues = { "none", "everything", "selection" }; ContentRegistry::Settings::add("hex.builtin.setting.hex_editor", "", "hex.builtin.setting.hex_editor.paste_behaviour", pasteBehaviourNames,