1
0
mirror of synced 2024-11-12 10:10:53 +01:00

impr: Set currently selected address in selection popup (#1125)

Set the Begin field to the current selected address
This commit is contained in:
Sergei Rebrov 2023-06-06 09:22:10 +03:00 committed by GitHub
parent 44bbbb03af
commit b4ac46f719
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -105,6 +105,8 @@ namespace hex::plugin::builtin {
class PopupSelect : public ViewHexEditor::Popup {
public:
PopupSelect(u64 address, size_t size): m_region({address, size}) {}
void draw(ViewHexEditor *editor) override {
ImGui::TextUnformatted("hex.builtin.view.hex_editor.menu.file.select"_lang);
@ -1017,7 +1019,8 @@ namespace hex::plugin::builtin {
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.file", "hex.builtin.view.hex_editor.menu.file.select" }, 1650,
CTRLCMD + SHIFT + Keys::A,
[this] {
this->openPopup<PopupSelect>();
auto selection = ImHexApi::HexEditor::getSelection();
this->openPopup<PopupSelect>(selection->getStartAddress(), selection->getSize());
},
ImHexApi::Provider::isValid);
@ -1193,4 +1196,4 @@ namespace hex::plugin::builtin {
[] { return ImHexApi::HexEditor::isSelectionValid() && ImHexApi::Provider::isValid(); });
}
}
}