1
0
mirror of synced 2024-11-28 09:30:51 +01:00

fix: Prevent empty provider menu from being opened

This commit is contained in:
WerWolv 2023-12-18 11:58:31 +01:00
parent 1b43270ae9
commit 478d6118d8

View File

@ -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();
}
}