fix: Prevent empty provider menu from being opened
This commit is contained in:
parent
1b43270ae9
commit
478d6118d8
@ -182,7 +182,7 @@ namespace hex::plugin::builtin {
|
||||
});
|
||||
|
||||
EventFrameBegin::subscribe([] {
|
||||
if (ImGui::BeginPopup("ProviderMenu") && rightClickedProvider != nullptr) {
|
||||
if (ImGui::BeginPopup("ProviderMenu") && rightClickedProvider != nullptr && !rightClickedProvider->getMenuEntries().empty()) {
|
||||
drawProviderContextMenu(rightClickedProvider);
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
@ -351,13 +351,11 @@ namespace hex::plugin::builtin {
|
||||
break;
|
||||
}
|
||||
|
||||
if (!tabProvider->getMenuEntries().empty()) {
|
||||
if (ImGui::IsMouseReleased(ImGuiMouseButton_Right) && ImGui::IsItemHovered()) {
|
||||
rightClickedProvider = tabProvider;
|
||||
RequestOpenPopup::post("ProviderMenu");
|
||||
}
|
||||
}
|
||||
}
|
||||
ImGui::EndTabBar();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user