fix: Copy-as options not being disabled correctly
This commit is contained in:
parent
0321743f1e
commit
18bc5de169
@ -172,6 +172,11 @@ namespace hex {
|
||||
*/
|
||||
bool isSelectionValid();
|
||||
|
||||
/**
|
||||
* @brief Clears the current selection in the Hex Editor
|
||||
*/
|
||||
void clearSelection();
|
||||
|
||||
/**
|
||||
* @brief Gets the current selection in the Hex Editor
|
||||
* @return The current selection
|
||||
|
@ -177,6 +177,10 @@ namespace hex {
|
||||
return impl::s_currentSelection;
|
||||
}
|
||||
|
||||
void clearSelection() {
|
||||
impl::s_currentSelection.reset();
|
||||
}
|
||||
|
||||
void setSelection(const Region ®ion, prv::Provider *provider) {
|
||||
setSelection(ProviderRegion { region, provider == nullptr ? Provider::get() : provider });
|
||||
}
|
||||
|
@ -1043,8 +1043,9 @@ namespace hex::plugin::builtin {
|
||||
auto selection = ImHexApi::HexEditor::getSelection();
|
||||
auto provider = ImHexApi::Provider::get();
|
||||
|
||||
bool enabled = ImHexApi::HexEditor::isSelectionValid();
|
||||
for (const auto &[unlocalizedName, callback] : ContentRegistry::DataFormatter::impl::getEntries()) {
|
||||
if (ImGui::MenuItem(LangEntry(unlocalizedName))) {
|
||||
if (ImGui::MenuItem(LangEntry(unlocalizedName), nullptr, false, enabled)) {
|
||||
ImGui::SetClipboardText(
|
||||
callback(
|
||||
provider,
|
||||
|
Loading…
x
Reference in New Issue
Block a user