mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-01-24 13:39:02 -06:00
fix: Empty popup opening when right clicking some provider tabs
This commit is contained in:
@@ -322,18 +322,20 @@ namespace hex::plugin::builtin {
|
||||
break;
|
||||
}
|
||||
|
||||
std::string popupID = std::string("ProviderMenu.") + std::to_string(tabProvider->getID());
|
||||
if (ImGui::IsMouseReleased(1) && ImGui::IsItemHovered()) {
|
||||
ImGui::OpenPopup(popupID.c_str());
|
||||
}
|
||||
|
||||
if (ImGui::BeginPopup(popupID.c_str())) {
|
||||
for (const auto &menuEntry : tabProvider->getMenuEntries()) {
|
||||
if (ImGui::MenuItem(menuEntry.name.c_str())) {
|
||||
menuEntry.callback();
|
||||
}
|
||||
if (!tabProvider->getMenuEntries().empty()) {
|
||||
std::string popupID = std::string("ProviderMenu.") + std::to_string(tabProvider->getID());
|
||||
if (ImGui::IsMouseReleased(ImGuiMouseButton_Right) && ImGui::IsItemHovered()) {
|
||||
ImGui::OpenPopup(popupID.c_str());
|
||||
}
|
||||
|
||||
if (ImGui::BeginPopup(popupID.c_str())) {
|
||||
for (const auto &menuEntry : tabProvider->getMenuEntries()) {
|
||||
if (ImGui::MenuItem(menuEntry.name.c_str())) {
|
||||
menuEntry.callback();
|
||||
}
|
||||
}
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
}
|
||||
ImGui::EndTabBar();
|
||||
|
||||
Reference in New Issue
Block a user